Fork me on GitHub



ST_OSMDownloader(GEOMETRY geom, VARCHAR path);
ST_OSMDownloader(GEOMETRY geom, VARCHAR path, BOOLEAN delete);


Download data from the OSM api using a bounding box (geom). The result is stored in an .osm file which the place and the name are defined in the path. If the delete parameter is equal to one (true), then the .osm file will be overwritten if it already exists.


Download OSM data:

CALL ST_OSMDownloader('POLYGON((-1.55 47.24, -1.55 47.25, 
                                -1.54 47.25, -1.54 47.24, 
                                -1.55 47.24))'::geometry, 

Read OSM file:

CALL OSMRead('/your_url/test.osm');

Note that the OSMRead function is described HERE.


On the left a screenshot from the OpenStreetMap website and on the right the result, with the building reconstruction (see OSMRead).

See also