[MAPSERVER-USERS] ms sql 2008 spatial - still problems???

BrainDrain paulborodaev at gmail.com
Fri Sep 12 07:54:24 EDT 2008


I tried to use ms sql 2008 layer with ms4w 2.2.9
my steps:
downloading mapdotnet & extracting msplugin_mssql2008.dll...done
importing data into mssql2008 using geometry data type (with FME) ...done
creating layer def:
...
 TYPE POLYGON
 CONNECTIONTYPE PLUGIN
 PLUGIN "c:\ms4w\app\WEMSite\Bin\msplugin_mssql2008.dll"
 CONNECTION "server=localhost;uid=...;pwd=...;database=geodb;Integrated
Security=false"
 DATA "GEOM from dbo.Construct USING UNIQUE id USING SRID=0"
...
done
and then exceptions:
1) At server (asp.net) side on layer.open 
"msMSSQL2008LayerGetItems(): Query error. msMSSQL2008LayerGetItems: tried to
find the geometry column in the results from the database, but couldnt find
it.  Is it miss-capitialized? 'GEOM'"
googling - doesn't help, adding geometry_columns table (as it is in postgis
db) and populating it - doesn't help, looking up in mapmssql2008.c - doesn't
help, using sql profiler to catch what plugin requests - doesn't help
(((((((
2) Ok: excluding layer.open() from code and waiting just for cgi response:
Error executing MSSQL2008 SQL statement: SELECT
GEOM.STAsBinary(),convert(varchar(20), id) from dbo.Construct WHERE
GEOM.STIntersects(Geometry::STGeomFromText('POLYGON((-4850978.88931604
-7029571.83269322,-4800721.99088196 -7029571.83269322,-4800721.99088196
-6979314.93425899,-4850978.88931604 -6979314.93425899,-4850978.88931604
-7029571.83269322))',0)) = 1 -[Microsoft][ODBC SQL Server Driver][SQL
Server]A .NET Framework error occurred during execution of user-defined
routine or aggregate "geometry": System.ArgumentException: 24144: This
operation cannot be completed because the instance is not valid. Use
MakeValid to convert the instance to a valid instance. Note that MakeValid
may cause the points of a geometry instance to shift slightly.
System.ArgumentException: в
Microsoft.SqlServer.Types.SqlGeometry.ThrowIfInvalid() в
Microsoft.SqlServer.Types.SqlGeometry.STIntersects(SqlGeometry other) . 
Ok: executing "delete from dbo.Construct where GEOM.STIsValid()<>1" fixes
the 2nd problem
but what about 1st??? without solving this I'll not be able to perform
queries.



-- 
View this message in context: http://www.nabble.com/ms-sql-2008-spatial---still-problems----tp19454300p19454300.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list