imposm3 icon indicating copy to clipboard operation
imposm3 copied to clipboard

Need Mapping.json for all tables, all columns, without filtering

Open danilshik opened this issue 3 years ago • 3 comments

Is there a mapping.json that would contain all objects with all tags at once (probably with the exception of custom ones)?

I want to first see how it will look, and then systematically exclude unnecessary objects for import.

Now I need to list everything from here https://wiki.openstreetmap.org/wiki/Map_Features

danilshik avatar Oct 10 '20 11:10 danilshik

imho:

check the __any__ : __any__ filtering in the doc

            "mapping": {
                "__any__": ["__any__"]

example:

  • https://github.com/omniscale/imposm3/blob/master/test/any_any_mapping.json
  • "load_all": true is important!

or you can use with a specific key

  • highway: [__any__]
  • "amenity": ["__any__"]

on the other hand - you can download the Taginfo database (sqlite3) - if you need quick - planet info for tuning imposm3 mapping

  • https://taginfo.openstreetmap.org/download

for community support / best practices - the recommended mailing list is better:

  • https://groups.google.com/g/imposm

ImreSamu avatar Oct 10 '20 12:10 ImreSamu

I followed the example that you suggested to me on the link. Only points are imported in it. I tried to import both lines, polygons, and relation, but I can't

{
    "tags": {
        "load_all": true,
        "exclude": [
            "created_by",
            "source"
        ]
    },
    "tables": {
        "point": {
            "columns": [
                {
                    "type": "id",
                    "name": "osm_id"
                },
                {
                    "type": "geometry",
                    "name": "geometry"
                },
                {
                    "type": "hstore_tags",
                    "name": "tags"
                }
 
            ],
            "type": "point",
            "mapping": {
                "__any__": ["__any__"]
            }
        },
        "line" : {
            "columns": [
                {
                    "type": "id",
                    "name": "osm_id"
                },
                {
                    "type": "geometry",
                    "name": "geometry"
                },
                {
                    "type": "hstore_tags",
                    "name": "tags"
                }
 
            ],
            "type": "linestring",
            "mapping": {
                "__any__": ["__any__"]
            }
        },
        "polygon": {
            "columns": [
                {
                    "type": "id",
                    "name": "osm_id"
                },
                {
                    "type": "geometry",
                    "name": "geometry"
                },
                {
                    "type": "hstore_tags",
                    "name": "tags"
                }
 
            ],
            "type": "polygon",
            "mapping": {
                "__any__": ["__any__"]
            }
        },
        "relation": {
            "columns": [
                {
                    "type": "id",
                    "name": "osm_id"
                },
                {
                    "type": "geometry",
                    "name": "geometry"
                },
                {
                    "type": "hstore_tags",
                    "name": "tags"
                }
 
            ],
            "type": "relation",
            "mapping": {
                "__any__": ["__any__"]
            }
        },
        "relation_member": {
            "columns": [
                {
                    "type": "id",
                    "name": "osm_id"
                },
                {
                    "type": "geometry",
                    "name": "geometry"
                },
                {
                    "type": "hstore_tags",
                    "name": "tags"
                }
 
            ],
            "type": "relation_member",
            "mapping": {
                "__any__": ["__any__"]
            }
        }
 
 
    }
}

Returns this error

SQL Error: pq: Invalid type name "RELATION(2)" - valid ones are: POINT, MULTIPOINT, LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON, CIRCULARSTRING, COMPOUNDCURVE, MULTICURVE, CURVEPOLYGON, MULTISURFACE, GEOMETRY, GEOMETRYCOLLECTION, POINTM, MULTIPOINTM, LINESTRINGM, MULTILINESTRINGM, POLYGONM, MULTIPOLYGONM, CIRCULARSTRINGM, COMPOUNDCURVEM, MULTICURVEM CURVEPOLYGONM, MULTISURFACEM, TRIANGLE, TRIANGLEM, POLYHEDRALSURFACE, POLYHEDRALSURFACEM, TIN, TINM or GEOMETRYCOLLECTIONM in query SELECT AddGeometryColumn('import', 'osm_relation', 'geometry', '3857', 'RELATION', 2);

What should I correct to get a Relation? Thanks

danilshik avatar Oct 12 '20 18:10 danilshik

I followed the example that you suggested to me on the link. Only points are imported in it.

there are other examples you can adapt:

  • https://github.com/omniscale/imposm3/blob/master/test/single_table_mapping.json

or just use this mapping:

  • https://github.com/omniscale/imposm3/issues/228#issuecomment-640179860

ImreSamu avatar Oct 12 '20 21:10 ImreSamu