Convert nominatim data

Hallo again to everybody,
I try to get from nominatim data, latitude and longitude to compare the distance between two object.
When I cal the nominatim I call it with ajax on this way:

			$.ajax({ type: "GET",   
					 url: ""+street_to_find+"&format=json",   
					 async: true,
					 success : function(text)
						 response = text;
						 risposta = JSON.stringify(response);

(the alert are to control the program)

in my case the complete request become:'ingegneria+perugia&format=json

and this is the data that I get

[{"place_id":249038748,"licence":"Data © OpenStreetMap contributors, ODbL 1.0.","osm_type":"way","osm_id":702281107,"boundingbox":["43.1129387","43.1143331","12.3562089","12.3619221"],"lat":"43.1134662","lon":"12.359101","display_name":"Viale dell'Ingegneria, Santa Lucia, Perugia, Umbria, 06127, Italia","class":"highway","type":"tertiary","importance":0.50001}]

As you can see I receive data between square bracket and I can’t parse it.
Yes, I can remove the bracket, (is not possible to parse the [0] item) , but is not elegance.
How can I solve it?


22 posts - 5 participants

Read full topic

Ce sujet de discussion accompagne la publication sur