Opened 9 years ago

Closed 9 years ago

#2932 closed defect (fixed)

Shapefile import deficiencies (patch)

Reported by: Toby Speight Owned by: cbro@…
Priority: major Milestone:
Component: merkaartor Version:
Keywords: Cc:


The current implementation of shapefile reading has the following issues:

  • Coincident nodes are not shared between features
  • Polygons with holes are not converted to multipolygon relations
  • Projection is done one node at a time, rather than a geometry at a time (x2 performance hit(*))

(*) I'm guessing that the GDAL library can use SIMD instructions when doing bulk transforms, which might explain this.

My patch is tested and ready to apply.

Note that the Ordnance Survey "VectorMap? District" NaturalFeature_Area.shp tiles have lots of 'Custom Landform' polygons with holes, so performance can be improved by generating a more specific file using ogr2ogr to crop or select features. It may be an idea to somehow allow the user to specifiy what feature types should be imported...

Attachments (1)

2392.patch (10.6 KB) - added by Toby Speight 9 years ago.
Patch to overhaul shapefile import

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by Toby Speight

Attachment: 2392.patch added

Patch to overhaul shapefile import

comment:1 Changed 9 years ago by Chris Browet

Please go ahead. If you are sure of your stuff, you don't have to go thru trac/patch... It's not like the trunk is supposed to be bulletproof ;-)

Small trick if you are not aware: If you put something like "(fixes #nnnn)", with nnnn being a trac ticket number, in you commit message, the ticket will be closed when you commit, with a back reference to the changeset.

comment:2 Changed 9 years ago by tspeight

Resolution: fixed
Status: newclosed

(In [21132]) Extend and rework shapfile importer (fixes #2932).

Note: See TracTickets for help on using tickets.