[mapguide-users] SQL Server Spatial and SRS for geometry data type

Gunter Becker gunter.becker at csogis.de
Wed Jul 17 03:11:50 PDT 2013


Hi,

I'm struggling with inserting geometries into SQL Server. After a coordinate
system transformation all my geometries now have the appropriate SRS
(SRID=25832). Before SRID was just 0.

Now when inserting new geometries via MapGuide/FDO into the tables I
realized that sometimes they are written in the correct SRS (SRID=25832) and
sometimes not (SRID=0). So I debugged the SQL that was send from
MapGuide/FDO to the SQL Server and found out that the provider determine the
SRID from the first row of the table where the geometry should be insert in:

SELECT TOP 1 [geom].STSrid as srid from [tablename]

BUT, when the first row has no geometry (geom=NULL) then this query returns
NULL and the new geometry is written into the table with SRID=0 instead of
the correct SRID=25832. (As a side note: that wouldn't have happen if there
is a where-clause in this query like " WHERE geom IS NOT NULL")

MapGuide doesn't show up the new geometry since it has the wrong SRS. 
Is there a way to insert the geometry with the correct SRS? Can I use fdo
schema tables? 
If yes, then which tables do I have to use to achieve my goal? Any other
ideas?

Thanks, Gunter



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/SQL-Server-Spatial-and-SRS-for-geometry-data-type-tp5067010.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list