Page 1 of 1

can't read/write PointZ geometry

Posted: Wed 20 Apr 2016 07:56
by tco95ttocs
Hi guys,

i have a "small" problem, reading and writing PointZ geometries into a postgres-DB using linq.
Several weeks ago i had the problem with the normal Point geometrie, but after i read this thread it worked fine for me.
But now i have PointZ geometries.
If i want to read them i got an "GeoAPI.IO.ParseException". It looks like, that there is a problem with the NetTopologySuite.IO.WKTReader!
If i want to write them to the database, allways the Z-Value /elevation will be droped!

I tested with Postgres 9.4 with Postgis 1.5 (standard) and 2.0, with dotconnect 7.4.616, GeoAPI 1.7.4 and NetTopologySuite 1.4.0. I used VS 2013 with EF5.

Does someone know, what is wrong?

Many thanks,

Mario

Re: can't read/write PointZ geometry

Posted: Fri 22 Apr 2016 17:22
by Shalex
Looks like you have encountered a limitation of NetTopologySuite.

As a workaround, we recommend you to switch to using WKT or EWKT to send the spatial data between your application and the server via our provider in a string format: https://www.devart.com/dotconnect/postg ... rvice.html. Employ some spatial library in your application to process the spatial data in a way convenient for you, then again convert it to a string (WKT or EWKT) and send back to server if necessary.

Re: can't read/write PointZ geometry

Posted: Mon 25 Apr 2016 09:51
by tco95ttocs
thanks for the answer.
If i'm right, i have to create additional attributes (characters) for saving the string with the information from the geometry or i have to work without EF an use a normal SQL-Statement to insert/update the geometry!

So does anybody know a 3th party software which can handle EWKT?

Re: can't read/write PointZ geometry

Posted: Wed 27 Apr 2016 13:30
by Shalex
tco95ttocs wrote:If i'm right, i have to create additional attributes (characters) for saving the string with the information from the geometry or i have to work without EF an use a normal SQL-Statement to insert/update the geometry!
Leave an existing EF mapping (e.g.: the geometry database column to the DbGeometry property in your class), just switch currently used NetTopologySuite service to WKT or EWKT.
tco95ttocs wrote:So does anybody know a 3th party software which can handle EWKT?
For example, Microsoft.SqlServer.Types.dll hanles 3D objects.
We will investigate the possibility of supporting Microsoft.SqlServer.Types.dll (like it is implemented for NetTopologySuite), but there is no any timeframe at the moment.