Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
danilshik opened this issue Oct 10, 2020 · 3 comments
Open

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

danilshik opened this issue Oct 10, 2020 · 3 comments

Comments

@danilshik
Copy link

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

@ImreSamu
Copy link
Contributor

imho:

check the __any__ : __any__ filtering in the doc

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

example:

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

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

@danilshik
Copy link
Author

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

@ImreSamu
Copy link
Contributor

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:

or just use this mapping:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants