Page 1 of 1

Issue with EWKT

Posted: Tue 15 Nov 2016 11:58
by Ossi
What is wrong with ToString() method with DBGeometry (ExtendendWkt)?

Code: Select all

> var geom = Devart.Data.PostgreSql.Entity.Spatials.PgSqlExtendedWktSpatialServices.CreateGeometry("LINESTRING(50027.21876 19769.808585,50030.39452 19797.435555,50035.47266 19821.66406,50039.70704 19836.53906,50045.3164 19853.115235,50057.17188 19880.7441475,50067.86328 19900.7207125,50074.10546 19910.921865,50088.82032 19931.748055,50097.28516 19942.375,50116.76172 19963.2011725,50134.01562 19978.5039075)");

//geometry object is created and all is good.
Console.Out.WriteLine(geom.AsText());
//LINESTRING(50027.21876 19769.808585,50030.39452 19797.435555,50035.47266 19821.66406,50039.70704 19836.53906,50045.3164 19853.115235,50057.17188 19880.7441475,50067.86328 19900.7207125,50074.10546 19910.921865,50088.82032 19931.748055,50097.28516 19942.375,50116.76172 19963.2011725,50134.01562 19978.5039075)

Console.Out.WriteLine(geom.ToString());
Invalid Extended Well-Known Text (EWKT) value 'LINESTRING(50027.21876 19769.808585,50030.39452 19797.435555,50035.47266 19821.66406,50039.70704 19836.53906,50045.3164 19853.115235,50057.17188 19880.7441475,50067.86328 19900.7207125,50074.10546 19910.921865,50088.82032 19931.748055,50097.28516 19942.375,50116.76172 19963.2011725,50134.01562 19978.5039075)'.
  + Devart.Common.Entity.b9.a(string, out int, out string, bool, bool, int)
  + Devart.Common.Entity.b9.b(string, out int, out string)
  + Devart.Common.Entity.EntityExtendedWktSpatialServices.CreateWellKnownValue(System.Data.Entity.Spatial.DbGeometry)
  + System.Data.Entity.Spatial.DbGeometry.ToString()

//ok, perhaps it is invalid or something...?
geom.IsValid;
This functionality is not supported by Extended Well-Known Text (EWKT) spatial service.
  + Devart.Common.Entity.EntitySpatialServices.GetIsValid(System.Data.Entity.Spatial.DbGeometry)
  + System.Data.Entity.Spatial.DbGeometry.get_IsValid()

Re: Issue with EWKT

Posted: Thu 17 Nov 2016 09:51
by Shalex
Thank you for your report. We will investigate the issue and notify you.

Re: Issue with EWKT

Posted: Wed 30 Nov 2016 19:29
by Shalex
1. Please use "SRID=0;LINESTRING([...]" instead of "LINESTRING([...]" to fix the issue with ToString().
EWKT = SRID + WKT

2. IsValid doesn't work with WKT / EWKT / WKB.