ramyaragupathy / hotosm-viz

HOTOSM Outreachy prototype
https://ramyaragupathy.github.io/hotosm-viz/#
MIT License
0 stars 0 forks source link

Export HOTOSM tool #10

Open ramyaragupathy opened 6 years ago

ramyaragupathy commented 6 years ago

Referencing #7, HOTOSM's export tool is another option to download OpenStreetMap data. While playing around with the interface, looks like the tool can deal with any rectangular/custom polygon boundaries. Using this ticket to document learnings.

ramyaragupathy commented 6 years ago

YAML

Eg:

buildings: 
  select: 
    - name
    - building
  types: 
    - polygons
  where: "building IS NOT NULL"
hospitals: 
  select: 
    - name
    - amenity
  where: "amenity = hospital"
waterways: 
  select: 
    - name
    - waterway
  types: 
    - lines
    - polygons
  where: "natural IN ('waterway')"

This is equivalent to:

{buildings:{select:[name, building], types:[polygons], where:"building IS NOT NULL"},
hospitals:{select:[name, amenity], where:"amenity=hospital"},
waterways:{select:[name, watrway], types:[lines, polygons], where:"natural IN ('waterway')"}
ramyaragupathy commented 6 years ago

From Network

On clicking Create Export, request payload is created & this is sent to the path /api/jobs

Example payload:

{
    "published": false,
    "feature_selection": "planet_osm_point:\n  types:\n    - points\n  select:\n    - 'access:roof'\n    - 'addr:housenumber'\n    - 'addr:street'\n    - building\n    - 'building:material'\n    - name\n    - 'roof:material'\n  where:\n    - building IS NOT NULL\nplanet_osm_polygon:\n  types:\n    - polygons\n  select:\n    - 'access:roof'\n    - 'addr:housenumber'\n    - 'addr:street'\n    - building\n    - 'building:material'\n    - name\n    - 'roof:material'\n  where:\n    - building IS NOT NULL\n",
    "export_formats": ["shp"],
    "aoi": {
        "description": "India, Tamil Nadu, Cuddalore",
        "geomType": "Polygon",
        "title": "Neyveli"
    },
    "the_geom": {
        "type": "Polygon",
        "coordinates": [
            [
                [79.49, 11.599999999999994],
                [79.49, 11.620000000000005],
                [79.51, 11.620000000000005],
                [79.51, 11.599999999999994],
                [79.49, 11.599999999999994]
            ]
        ]
    },
    "name": "Test"
}