omniscale / imposm3

Imposm imports OpenStreetMap data into PostGIS
http://imposm.org/docs/imposm3/latest/
Apache License 2.0
730 stars 157 forks source link

Remove logic to not build GEOS geoms for linestrings #234

Closed pnorman closed 4 years ago

pnorman commented 4 years ago

Fixes #227

GEOS geometries are necessary for geojson_intersects and geojson_intersects_feature, and the performance improvement from not generating them are negligible.

In #227 we both thought that GEOS geometries for linestrings would be a performance hit but when I benchmarked this change, I found finding a performance difference difficult. An upper bound is a 3% increase to import time in my tests, which were done with

cmd/imposm/imposm import -mapping example-mapping.yml \
-connection 'postgis: host=/var/run/postgresql dbname=imposmtest' \
-overwritecache -diff \
-read $HOME/osm/planet/british-columbia-200215.osm.pbf -write

The alternative solution would be passing information to buildAndInsert about if the way needs an area column, geojson_intersects, or geojson_intersects_feature. This would add complexity and possible bugs for minimal gains. With the possible bugs, I feel removing the logic completely is a better solution.

There is another bug present with some geojson files which I am working at reducing, but this fixes #227.

pnorman commented 4 years ago

ping @olt - anything I can do to help this?