data relation and executeintersectionquery

Topics: Data Access, General Topics
Feb 22, 2008 at 11:37 AM
Greets

I have two questions:

1 - Im trying to bound my map tosome external data (which don't placed in map's shape file or map's mssqlspatial table) but can not find a way to do it. How can I bound my data over let's say "oid" field of a map's mssqlspatial table. I want to show some info on the map using my extra tables, stored procedures , etc.

2 - Ive used layer's DataSource.ExecuteIntersectionQuery and it gave me lots of rows including the correct row , but I can not determine which one is the correct one. If there's a method that gives the exact row, will you please tell me which one is that.

Thank you for your incoming attention.

cemilman
Coordinator
Feb 25, 2008 at 11:07 PM
Hi cemilman -

I'm not sure I'm answering exactly here, but this might help:

1) Extra data in a map layer is known as "attributes", and you can associate it by doing a join on the server and just returning the join as extra attributes. If you are joining on the OID, it should be pretty simple. Any other approach of delivering extra data along with the results would take considerably more work, since you need to have some kind of geospatial reference for the data to show up.

2) The reason that DataSource.ExecuteIntersectionQuery returns more data than expected depends on the data provider and the data. If you are using the ShapeFile provider, for example, the intersection is based on the feature extents, not the feature geometry (so it's not true feature intersection), and will give you too many results. The only way out of this for SharpMap v0.9 is to use the NetTopologySuite Data Provider. Another reason is that two features could overlap, and your query could intersect the overlapped region. In this case, generally you want both of these, since both are "correct" according to the query.
Feb 28, 2008 at 10:07 PM
Thank you codekaizen, Ive worked on NTS a bit and found an answer to my 2nd question and using mssql data provider, my first question seems ok with your answer.

regards.