[OSM-talk] Some tools to help community-driven imports

2014-12-06 Thread Guillaume Pratte
Hello,

I am writing to share some tools that we have developed in preparation for the 
City of Montreal open data community-driven import. (Said import is in 
preparation and has not yet begun.)

These tools cover converting .csv files to .osm files and splitting .osm files 
for the Tasking Manager. The code is available in the following GitHub project:

 https://github.com/OsmQc/mtl2osm https://github.com/OsmQc/mtl2osm

See this post for all the details:

 http://www.openstreetmap.org/user/Zethradon/diary/28183 
http://www.openstreetmap.org/user/Zethradon/diary/28183

I’ll skip most of the post to cover the main points I would like to share with 
the mailing list.

## csv2osm: a tool for converting .csv files

As ogr2osm cannot easily read .csv files as an input, I wrote a script that is 
similar to ogr2osm and provide the same translator concept, and works 
exclusively for .csv files. The script is called csv2osm and can be found here:

 https://github.com/OsmQc/mtl2osm/blob/master/mtl2osm/csv2osm.py 
https://github.com/OsmQc/mtl2osm/blob/master/mtl2osm/csv2osm.py

Translators for this script have the same entry point as ogr2osm (the 
filterTags function). For example, Montreal's open dataset for bike parkings is 
provided as a .csv file. The translator for this dataset parses the description 
of each bike parking to extract the capacity and provides the following tags 
for each points.

 
https://github.com/OsmQc/mtl2osm/blob/master/mtl2osm/donnees/arceaux-a-velos/traducteur-arceaux-a-velos.py
 
https://github.com/OsmQc/mtl2osm/blob/master/mtl2osm/donnees/arceaux-a-velos/traducteur-arceaux-a-velos.py

Instructions on using the script is available here:

 https://github.com/OsmQc/mtl2osm/blob/master/mtl2osm/donnees/arceaux-a-velos/ 
https://github.com/OsmQc/mtl2osm/blob/master/mtl2osm/donnees/arceaux-a-velos/


## Splitting .osm files for the HOT Tasking Manager

We are planning to use the HOT Tasking Manager for our import. To ease 
importing the generated .osm dataset into JOSM (for manual reconciliation with 
OSM data), we had to write a script that splits the .osm files into a series of 
sub-files, one per sub-task. Essentially the .osm file is split-up according to 
a grid defined in JSON format. This allows to see in JOSM only the part of the 
data for the task, instead of having to download the data for the whole city. 
Code is available here:

 https://github.com/OsmQc/mtl2osm/blob/master/mtl2osm/osm_grid_splitter.py 
https://github.com/OsmQc/mtl2osm/blob/master/mtl2osm/osm_grid_splitter.py

I hope these tools can be of benefit to the OpenStreetMap community. Do not 
hesitate to reply if you have any question. I know the documentation on these 
tools is not 100% complete, so I'll certainly post more details if there is 
interest in them.

Guillaume___
talk mailing list
talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Some tools to help community-driven imports

2014-12-06 Thread Clifford Snow
On Sat, Dec 6, 2014 at 9:56 PM, Guillaume Pratte 
guilla...@guillaumepratte.net wrote:

 ## Splitting .osm files for the HOT Tasking Manager

 We are planning to use the HOT Tasking Manager for our import. To ease
 importing the generated .osm dataset into JOSM (for manual reconciliation
 with OSM data), we had to write a script that splits the .osm files into a
 series of sub-files, one per sub-task. Essentially the .osm file is
 split-up according to a grid defined in JSON format. This allows to see in
 JOSM only the part of the data for the task, instead of having to download
 the data for the whole city. Code is available here:

  https://github.com/OsmQc/mtl2osm/blob/master/mtl2osm/osm_grid_splitter.py

 I hope these tools can be of benefit to the OpenStreetMap community. Do
 not hesitate to reply if you have any question. I know the documentation on
 these tools is not 100% complete, so I'll certainly post more details if
 there is interest in them.


Thanks - this is just what I've been looking for. We wrote a clunky python
script but yours looks much more elegant. I'll give it a try in the next
week or so when I get finished cleaning up some buildings and addresses.

Clifford


-- 
@osm_seattle
osm_seattle.snowandsnow.us
OpenStreetMap: Maps with a human touch
___
talk mailing list
talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk