NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I use imposm3 (install binary from http://imposm.org/static/rel/ on Ubuntu Server) for import OSM data (features 'protected_area' with "boundary"="protected_area" (http://wiki.openstreetmap.org/wiki/Tag:boundary%3Dprotected_area)) in PostGIS database. When I import data on full Ukraine (http://www.openstreetmap.org/relation/3791141) area I receive in table multipolygon from relation http://www.openstreetmap.org/relation/4650441 with name from http://www.openstreetmap.org/way/331465943 object. But when I import small area (Donetskaya oblast http://www.openstreetmap.org/relation/71973) I received correct polygons from http://www.openstreetmap.org/relation/4650441 relation (not multipolygon). How receive polygons from http://www.openstreetmap.org/relation/4650441 relation when importing protected_areas on Ukraine (http://www.openstreetmap.org/relation/3791141)? For import I use command:

imposm3 import -read ${BASEDIR}/osmdownloads/ukraine-latest.osm.pbf -write -cachedir ${BASEDIR}/cache -connection 'postgis://user:password@localhost:5432/uaosm?sslmode=disable&prefix=NONE' -dbschema-import public -mapping ${BASEDIR}/mapping.json -diff -srid 4326 -overwritecache

Example mapping.json file:

{
        "tags": {
            "load_all": true
        },
        "tables": {


            "protected_area_polygon": {
                "fields": [
                    {
                        "type": "geometry",
                        "name": "the_geom",
                        "key": null
                    },               
                    {
                        "type": "id",
                        "name": "osm_id",
                        "key": null
                    },
                    {
                        "type": "string",
                        "name": "name",
                        "key": "name"
                    },
                    {
                        "type": "string",
                        "name": "name_uk",
                        "key": "name:uk"
                    },  
                    {
                        "type": "string",
                        "name": "name_ru",
                        "key": "name:ru"
                    },  
                    {
                        "type": "string",
                        "name": "name_en",
                        "key": "name:en"
                    },              
                    {
                        "type": "string",
                        "name": "boundary",
                        "key": "boundary"
                    },
                    {
                        "type": "string",
                        "name": "prot_class",
                        "key": "protect_class"
                    },              
                    {
                        "type": "string",
                        "name": "prot_stat",
                        "key": "protection_status"
                    },
                    {
                        "type": "string",
                        "name": "prot_title",
                        "key": "protection_title"
                    },                  
                    {
                        "type": "string",
                        "name": "naturalt",
                        "key": "natural"
                    },              
                    {
                        "type": "string",
                        "name": "amenity",
                        "key": "amenity"
                    },
                    {
                        "type": "string",
                        "name": "leisure",
                        "key": "leisure"
                    },
                    {
                        "type": "string",
                        "name": "landuse",
                        "key": "landuse"
                    },
                    {
                        "type": "string",
                        "name": "operator",
                        "key": "operator"
                    },  
                    {
                        "type": "string",
                        "name": "place",
                        "key": "place"
                    },  
                    {
                        "type": "string",
                        "name": "website",
                        "key": "website"
                    },
                    {
                        "type": "string",
                        "name": "wikipedia",
                        "key": "wikipedia"
                    },              
                    {
                        "type": "string",
                        "name": "note",
                        "key": "note"
                    }   
                ],
                "type": "polygon",
                "mapping": {
                     "boundary": ["protected_area"]
                }
            }
        }
    }

asked 25 Jun '15, 08:13

HasT's gravatar image

HasT
11112
accept rate: 0%

edited 25 Jun '15, 08:14

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×710
×196
×134
×128
×6

question asked: 25 Jun '15, 08:13

question was seen: 4,695 times

last updated: 25 Jun '15, 08:14

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum