This project has moved. For the latest updates, please go here.

PostGIS.cs, ExecuteIntersectionQuery (OnExecuteIntersectionQuery)

Topics: Data Access, SharpMap v0.9 / v1.x, WinForms Controls
Nov 6, 2013 at 12:30 PM

i got errors calling ExecuteIntersectionQuery on a PostGis-Layer.

I traced into PostGIS.cs and found the ExecuteIntersectionQuery working pretty well, returning a feature dataset from the correct layer as it should.
After that, OnExecuteIntersectionQuery was raised and the error occured in line

using (var cmd = new NpgsqlCommand(strSql, conn))

No wonder because for example the queried table had nothing to do with the layer a.s.o.

I placed a "return" in the first line of OnExecuteIntersectionQuery and everything works fine.

Am i working with an outdated Version (v1.0-FINAL)? Is OnExecuteIntersectionQuery experimental code forgotten do delete? Should i post a patch?
Nov 6, 2013 at 1:35 PM
PostGis derives from BaseProvider. That means
  • it must override ExecuteIntersectionQuery for Envelope/BoundingBox queries and
  • OnExecuteIntersectionQuery for IGeometry queries.
OnExecuteIntersectionQuery is protected and called from BaseProvider.

All in all it seems right to me, and the last time I ran the postgis unit test, that worked, too.
Maybe the issue is related to your SRID problem?
Nov 7, 2013 at 3:24 PM
Maybe the issue is related to your SRID problem?
Give me another day or two. I have to redo the change in PostGIS.cs to better document the problem or to find out that it really was a side effect of SRID -1.