Hi

I'm trying to import some 25D shapefile into PostgreSQL. Geotools code for
reading the shapefile is like from the tutorial (
http://docs.geotools.org/stable/userguide/library/data/shape.html).

PostgreSQL throws an missing Z value error:

Caused by: java.sql.BatchUpdateException: Batch entry 0 INSERT INTO
"afu_generierung_tiefenlayer_staging"."ebene_daten_dhm"("the_geom",
"daten_id", "ebene_id", "beschreibu")VALUES(ST_GeomFromWKB(?,2056),
'17380103', '100', '00_DHM.ts') was aborted: ERROR: Column has Z dimension
but geometry does not  Call getNextException to see other errors in the
batch.

What I noticed: Geotools interprets the shapefile as Multipolygon whereas
OGR sees only PolygonZ. Looking at some shapefile related Geotools code, I
guess that 25d shapefiles should work? Or is the z value just ignored after
reading? (
https://github.com/geotools/geotools/blob/master/modules/plugin/shapefile/src/main/java/org/geotools/data/shapefile/shp/PolygonHandler.java#L117
)

An example can be found here:
https://drive.google.com/file/d/1BpfJtALzN-UrfPVLJ6dY0lnC7kf5KuPZ/view?usp=sharing

Any help is appreciated.

regards
Stefan
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to