Problem with coordinates in an JSON file

Hello,

When I'm using this block, it returns only he second value of the coordinates.
The JSON is : https://geo.api.gouv.fr/communes?codePostal=33610&fields=nom,code,contour,departement,population&format=json&geometry=centre
json

I'm trying to get the first value, but it's unsuccessfull.

Could you help me please ?

Many thanks.

This, returns the first set of coordinates, is this what you want ?

image

from:

image

or are you trying to plot the Polygon to a Map?

Yes I do.
I'm trying to plot the Polygon

Actually, I'd like to create a list of all the first values in order to plot the Polygon

Dictionary rounds decimal numbers.

  • 0.632862 to 0.63286

How to plot the polygon:

Tim has provided basically all you need to capture all the coordinates. You can plot the polygon using the Map component, the Polygon component and the Polygon1.PointsFromString Block

Sorry, but there's something I don't understand :frowning:
When I use your block, the polygon is not plotted.
Could you help me or show me that it works on your device, please ?

You need

This code is not optimized but works. :slight_smile:

Another idea:

watch out
(latitude, longitude) for (longitude, latitude)

Your polygon points put me in the Indian Ocean off the coast of Somalia...

image
(what looks like a red dot, due to the zoom)

(latitude, longitude) for (longitude, latitude)

1 Like

Thought they might be round the wrong way.....

Now south-west of Bordeaux, France

image

1 Like

yes the latitude and longitude are indeed reversed. I once coded a way to compensate for that convention. May take me a while to find the code. :slight_smile:

borrar_json234.aia (6.9 KB)

In this topic
https://community.appinventor.mit.edu/t/geofence-check-if-a-point-is-inside-a-polygon-javascript-map/57091
@SteveJG and @Juan_Antonio showed codes about Geofence.
I've added @SteveJG 's Geofence code to this example. Tap on the map.

borrar_json_geofence.aia (7.9 KB)