[mapguide-users] Re: Need to draw lines, points, possibly polygons to database

anand anand.speck at gmail.com
Fri Oct 28 01:49:12 EDT 2011


hi,
Currently I can draw a polygon and line string on my map. I am using
1) Basic web layout
2) Geometry data (in sql server 2008)
3) My insert query is like: 

//insert into tablename (geom) values
(geometry::STGeomFromText(POLYGON((202403.97840364207
2029510.2210948558,202345.52336107957 2029507.0613628253,202403.97840364207
2029510.2210948558)),1)

 
 but when i try to insert the polygon coordinates into my sql server 2008
database, it is showing an error. The following is the error:


A .NET Framework error occurred during execution of user-defined routine or
aggregate "geometry":   System.FormatException: 24114: The label P in the
input well-known text (WKT) is not valid. Valid labels are POINT,
LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, or
GEOMETRYCOLLECTION.  System.FormatException:      at
Microsoft.SqlServer.Types.OpenGisWktReader.ParseTaggedText(OpenGisType type)    
at Microsoft.SqlServer.Types.OpenGisWktReader.Read(OpenGisType type, Int32
srid)     at
Microsoft.SqlServer.Types.SqlGeometry.GeometryFromText(OpenGisType type,
SqlChars text, Int32 srid)     at
Microsoft.SqlServer.Types.SqlGeometry.STGeomFromText(SqlChars
geometryTaggedText, Int32 srid)  .



Thanks & regards,
Anand

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Need-to-draw-lines-points-possibly-polygons-to-database-tp6860154p6938912.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list