geometalab / osmaxx

OpenStreetMap Arbitrary Excerpt Export - Get the OpenStreetMap data you want in the file format you need
http://osmaxx.hsr.ch/
MIT License
26 stars 3 forks source link

GIS export of Haiti failing #829

Closed das-g closed 7 years ago

das-g commented 7 years ago

osmaxx/conversion/converters/converter_gis/bootstrap/sql/filter/building/010_building.sql is causing

sqlalchemy.exc.DataError: (psycopg2.DataError) Geometry type (MultiLineString) does not match column type (MultiPolygon)

https://sentry.njo.ch/geometalab/osmaxxprod/issues/306/

das-g commented 7 years ago

I've imported the PBF from https://osmaxx.hsr.ch/media/osmaxx/outputfiles/c3209bb7-f594-4d75-8ff5-def9d80f6b14/haiti_wgs-84_2017-03-24_pbf_full-detail.zip with osm2pgsql 0.88.1 (installed with apt on Ubuntu 16.04) as follows:

osm2pgsql --create --extra-attributes --slim --latlon \
--host localhost --database osm_haiti --prefix osm \
--style osmaxx/conversion/converters/converter_gis/bootstrap/styles/terminal.style \
--tag-transform-script osmaxx/conversion/converters/converter_gis/bootstrap/styles/style.lua\
--number-processes 8 --username postgres --hstore-all \
--input-reader pbf ~/Downloads/pbf/Haiti.pbf

and the Query

SELECT count(*)
FROM osm_polygon
WHERE ST_GeometryType(ST_Multi(way)) != 'ST_MultiPolygon';

resulted in 0.

das-g commented 7 years ago

OSMaxx uses osm2pgsql compiled from the GitHub repo openstreetmap/osm2pgsql's default branch. Maybe that is behaving differently?

das-g commented 7 years ago

Confirmed fixed on https://osmaxx.hsr.ch: The affected building (way 392328412) is now exported correctly as an area.

Using osm2pgsql from tag 0.92.0 instead of from branch master (5f28a4fa1f94e315c123abd4b29d3d41ec111e5b) has done the trick.