can't read/write PointZ geometry

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
tco95ttocs
Posts: 7
Joined: Wed 20 Apr 2016 06:56

can't read/write PointZ geometry

Post by tco95ttocs » Wed 20 Apr 2016 07:56

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

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: can't read/write PointZ geometry

Post by Shalex » Fri 22 Apr 2016 17:22

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.

tco95ttocs
Posts: 7
Joined: Wed 20 Apr 2016 06:56

Re: can't read/write PointZ geometry

Post by tco95ttocs » Mon 25 Apr 2016 09:51

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?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: can't read/write PointZ geometry

Post by Shalex » Wed 27 Apr 2016 13:30

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.

Post Reply