Generate GeoJSON Data

Options

I'm looking to generate GeoJSON Data to be passed to Mapbox as seen here: https://docs.mapbox.com/mapbox-gl-js/assets/earthquakes.geojson

Does anyone know how I would go about doing this?

Tagged:

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    Transforming data into json is a xano primitive. But getting the specific shapes to define geojson regions and the like is basically something you do in the function stack. What is your input you want to export as geojson?

  • Patopt
    Patopt Member
    Options

    I've actually already got all the data in Xano, including the coordinates to map points on the map. I just need to query my Xano database and return the output in the GEOJSON format.

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    I don't think that's a built-in filter or function, but GeoJSON is just a convention for structuring data in JSON. Xano thinks natively in JSON, so you can construct the object you need by looping over your output in the function stack.

    Thisdata reshaping is something we often work on in our daily State Change Pro office hours. It's not about the one tool that will just do it for you, but rather getting into an iterative process to move from what you have to what you need. Repeatedly run-and-debugging your way through the process (build a little, check the output, continue) will let you build it a lot faster.