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

Access all fields including Contexts #169

Open
ollie10 opened this issue Jul 27, 2023 · 0 comments
Open

Access all fields including Contexts #169

ollie10 opened this issue Jul 27, 2023 · 0 comments

Comments

@ollie10
Copy link

ollie10 commented Jul 27, 2023

Hello everyone,

I'm trying to use the library to deserialize the result of some geocoding / reverse geocoding returned from the MapTiler API.

They claim their response type is a Standard GeoJson with a FeatureCollection and Features Array.

Now my question is: stating they have much more information like the OSM tags and the context array, how can I access those properties?

An example of returned data is this one:

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "properties": {
                "ref": "osm:w186051440",
                "country_code": "sv",
                "kind": "street",
                "place_type_name": [
                    "dirección"
                ]
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -89.021450355649,
                    13.624615191117352
                ]
            },
            "bbox": [
                -89.02265902608632,
                13.623938743362018,
                -89.01993792504071,
                13.625057031669611
            ],
            "center": [
                -89.021450355649,
                13.624615191117352
            ],
            "place_name": "Calle El Amate, República de El Salvador",
            "place_type": [
                "address"
            ],
            "place_type_name": [
                "dirección"
            ],
            "relevance": 0.586667,
            "context": [
                {
                    "ref": "osm:n2823774053",
                    "country_code": "sv",
                    "kind": "place",
                    "osm:place_type": "village",
                    "id": "place.4177223",
                    "text": "San Miguel Tepezontes",
                    "text_es": "San Miguel Tepezontes"
                },
                {
                    "ref": "osm:r3624477",
                    "country_code": "sv",
                    "kind": "admin_area",
                    "id": "region.3368",
                    "text": "Departamento de La Paz",
                    "text_es": "Departamento de La Paz"
                },
                {
                    "ref": "osm:r1520612",
                    "country_code": "sv",
                    "kind": "admin_area",
                    "id": "country.1217",
                    "text": "República de El Salvador",
                    "language": "es",
                    "text_es": "República de El Salvador",
                    "language_es": "es"
                }
            ],
            "id": "address.25046469",
            "text": "Calle El Amate",
            "text_es": "Calle El Amate",
            "place_name_es": "Calle El Amate, San Miguel Tepezontes, Departamento de La Paz, República de El Salvador"
        }
    ],
    "query": [
        "calle",
        "el",
        "amate",
        "soyapango"
    ],
    "attribution": "<a href=\"https://www.maptiler.com/copyright/\" target=\"_blank\">&copy; MapTiler</a> <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">&copy; OpenStreetMap contributors</a>"
}
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

1 participant