Error exporting geometry from shape to PostGIS

Added by Fabio Vinci about 2 years ago

Dear all,

I'm trying to export data from shape file to a PostGIS database. If I disable the mapping of the geometry, all the attributes are correctly exported in the DB. It seems that the problem is related only to the geometry.
Any suggestion?

Thanks,
Fabio


Replies (3)

RE: Error exporting geometry from shape to PostGIS - Added by Simon Templer about 2 years ago

Hi Fabio,

do you get any error message in the Error Log or reports that gives some hint about what may be going wrong?

Best,
Simon

RE: Error exporting geometry from shape to PostGIS - Added by Fabio Vinci almost 2 years ago

Dear Simon,

in the meanwhile I performed some tests and I identified the problem. It is related to the different geometry type between source shape file and target PostGIS table (e.g. MultiLineString vs LineString). There is no export problem if the geometry types are the same.

But, even though I have converted the geometry of the shape from MultiLineString to LineString, Hale recognizes it always as MultiLineString.

Have you an idea on this?

As workaround for this issue, I have imported the shape in a new PostGIS table, in order to change the geometry type from MultiLineString to LineString and I have used it as source schema/dataset.

I have another problem, using PostGIS as source schema, related to the "Classification function": assign is unsuccessful for the empty fields. Both using the dropdown box "For unmapped source values" and using explicit tab.

Have you any suggestion?

Best,
Fabio

RE: Error exporting geometry from shape to PostGIS - Added by Simon Templer almost 2 years ago

Hi Fabio,

But, even though I have converted the geometry of the shape from MultiLineString to LineString, Hale recognizes it always as MultiLineString.

This could be an issue with the Shapefile reader, that it uses MultiLineString even for LineString only Shapefiles.

The best solution for this would be if we can read from the database schema which geometry type is expected and try to convert it accordingly. I'm not sure though right now, how easy it is to do that with the JDBC driver.

I have another problem, using PostGIS as source schema, related to the "Classification function": assign is unsuccessful for the empty fields. Both using the dropdown box "For unmapped source values" and using explicit tab.

If the source property is not there, a mapping on it will not be executed. You can use an Assign with a lower priority to assign a default value to the target property for these cases.

Hope that helps

Best,
Simon

(1-3/3)