0

I have a project that compares shapefiles with JSON files containing geographical data retrieved from OpenStreetMap via Overpass API.

The problem is that comparing data takes a long time when I get a lot of objects, and for some of the cities I have 7000 OSM objects to compare with 16000 shapefile objects. I have noticed that the LineString objects in the shapefile are very segmented, and would like to join LineString segments with the same field-attributes into LineStrings, without having them transformed into MultiLineStrings. That way I can speed up the execution of the script.

The script currently imports GDAL ogr and Shapely modules, but can import other modules, like Fiona if that is better.

he1ix
  • 383
  • 2
  • 11
Skippern
  • 1
  • 2
  • 1
    You may want to post over at [Geographic Information Systems](http://gis.stackexchange.com). – wwii Mar 13 '15 at 22:34
  • 1. Can you profile the execution and provide some sample code? 2. I do not know the objects. Can you provide 5 samples, each with only the necessary information contained to join them? 3. How are the objects represented in your program? Are they dictionaries? 4. Is it possible to reduce the query to get less objects that can be joined as successfully? – User Mar 14 '15 at 07:58
  • 1. I have no idea how to attack this part of the problem, and therefor can't see how I can suggest a sample code - 2. I could upload a few examples of the shapefiles, but currently work with reduced bandwidth and have no place to host them. - 3 The JSON is represented as a dict, converted between string and JSON with json.dumps and json.loads, the shapefile is loaded as a GeoJSON - The query is already split in 78 chunks, and I am not able to split further as I have no certain data to limit area further – Skippern Mar 14 '15 at 21:52

0 Answers0