igor
July 17, 2022, 10:15am
1
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
I'm trying to get the first value, but it's unsuccessfull.
Could you help me please ?
Many thanks.
TIMAI2
July 17, 2022, 1:07pm
2
This, returns the first set of coordinates, is this what you want ?
from:
or are you trying to plot the Polygon to a Map?
igor
July 17, 2022, 2:06pm
4
Yes I do.
I'm trying to plot the Polygon
igor
July 17, 2022, 2:19pm
5
Actually, I'd like to create a list of all the first values in order to plot the Polygon
Dictionary rounds decimal numbers.
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
igor
July 17, 2022, 3:19pm
8
Sorry, but there's something I don't understand
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
a Map component
a Polygon component
code to center the map on one of the coordinate pairs in the polygon
This code is not optimized but works.
Another idea:
watch out
(latitude, longitude) for (longitude, latitude)
TIMAI2
July 17, 2022, 3:44pm
11
Your polygon points put me in the Indian Ocean off the coast of Somalia...
(what looks like a red dot, due to the zoom)
(latitude, longitude) for (longitude, latitude)
1 Like
TIMAI2
July 17, 2022, 3:50pm
13
Thought they might be round the wrong way.....
TIMAI2
July 17, 2022, 3:54pm
14
Now south-west of Bordeaux, France
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.