[OSM-talk] OpenStreetMap duplicate key
victini at netcourrier.com
victini at netcourrier.com
Sat Jul 16 10:12:28 UTC 2022
Hello,
I'm doing some extracting with the Overpass API on OSM to extract some fuelstation on several european countries.
Everything worked fine when I last used the code (few weeks ago).
But today, I have a problem while extracting some amenities.
I use a Java Code and here is my GET request:
https://lz4.overpass-api.de/api/interpreter?data=[out:json];area[%22ISO3166-1%22=%22AD%22];area[amenity=%22fuel%22](area);out%20center%20meta;
It seems to work correctly when inserting this as a URL but as long as I use it in the Java code, I have an error "org.json.JSONException: Duplicate key "amenity"" when trying to get a new JSONObject on org.json.
I looked at the fuelstations that I got and there is only one that seems incorrect:
{
"type": "area",
"id": 3602660789,
"tags": {
"amenity": "fuel",
"amenity": "fuel",
"brand": "BP",
"brand": "BP",
"brand:wikidata": "Q152057",
"brand:wikidata": "Q152057",
"brand:wikipedia": "en:BP",
"brand:wikipedia": "en:BP",
"fuel:diesel": "yes",
"fuel:diesel": "yes",
"fuel:octane_100": "yes",
"fuel:octane_100": "yes",
"fuel:octane_95": "yes",
"fuel:octane_95": "yes",
"name": "BP",
"name": "BP",
"operator": "BP",
"operator": "ΚΑΛΥΨΩ ΜΟÎ?. Ε.Î .Ε. Î?ο 72",
"payment:hellenic_fuels_SA": "yes",
"payment:hellenic_fuels_SA": "yes",
"type": "multipolygon",
"type": "multipolygon"
}
}
where all the keys are duplicates.
I tried with another country (e.g. AL) and I got the same error.
The exact same fuelstation with the same id caused this error.
What is weird is that when inserting the query on the browser, everything work correctly.
Here is my Java code:
.....
It fails when creating the JSONObject named JSONResponse.
How can I solve this problem? Is it a problem coming from OSM? The code worked all fine weeks ago but not anymore.
I hope you can provide me some help.
Best regards.
Mr. CALINSKI
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20220716/9a52dccf/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline_1657966348_683528624_0.png
Type: image/png
Size: 26875 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20220716/9a52dccf/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline_1657966348_683528624_1.png
Type: image/png
Size: 83137 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20220716/9a52dccf/attachment-0003.png>
More information about the talk
mailing list