OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2019-04-14 11:03:11

Julien Gouesse
Member
Registered: 2012-07-30
Posts: 5

How to use OSM API version 0.6 with Curl?

Hello

I have hundreds of nodes to upload into OSM, I know how to concert my GEOJSON files into OSM XML changesets but I can't use the latest version (0.6) of the OSM API with Curl to upload data, I only succeed to download data.

I already talked about my problem on StackOverflow:
https://stackoverflow.com/questions/556 … 6-and-curl

Please can somebody help me? The wiki indicates how to do that with the version 0.5 but it states that it may not work with the version 0.6 which is mostly true.

Offline

#2 2019-04-14 17:49:49

mmd
Member
Registered: 2010-11-06
Posts: 1,706

Re: How to use OSM API version 0.6 with Curl?

Instead of (unsuccessfully) talking to the API via command line tools, better use an established editor.

What kind of data do you want to upload?

Are you aware of https://wiki.openstreetmap.org/wiki/Import/Guidelines and do you fully understand its implications?

Offline

#3 2019-04-14 18:08:38

Julien Gouesse
Member
Registered: 2012-07-30
Posts: 5

Re: How to use OSM API version 0.6 with Curl?

mmd wrote:

Instead of (unsuccessfully) talking to the API via command line tools, better use an established editor.

The default online editor doesn't help for mass upload. JOSM works very well in a desktop environment but I need an occasional solution that would work in other situations when there's no JRE available.

mmd wrote:

What kind of data do you want to upload?

I want to upload numerous locations of public free billboards for non commercial activities.

mmd wrote:

Are you aware of https://wiki.openstreetmap.org/wiki/Import/Guidelines and do you fully understand its implications?

Yes and I think that those data will be very useful in France a few months before the European elections.

Thank you for your help.

In my humble opinion, this wiki article should be fixed instead of remaining unfixed for the latest version. There are different usages, talking to the API in command line is an alternative to using an editor in some situations.

I've looked at the source code of JOSM and I don't know what is wrong in my use of Curl, both use base64 encoded credentials, the authentication seems to work. Does the API allow to delete a closed changeset?

Offline

#4 2019-04-14 18:12:02

mmd
Member
Registered: 2010-11-06
Posts: 1,706

Re: How to use OSM API version 0.6 with Curl?

Julien Gouesse wrote:

I want to upload numerous locations of public free billboards for non commercial activities.

Please discuss this with the French community first before trying anything else. As I mentioned on stack overflow, simply dumping stuff into the DB like you plan to do will get your edits reverted and your user blocked.

Julien Gouesse wrote:

JOSM works very well in a desktop environment but I need an occasional solution that would work in other situations when there's no JRE available.

There are numerous other libraries available these days, and there's really no need at all to fiddle with the command line.

Julien Gouesse wrote:

In my humble opinion, this wiki article should be fixed instead of remaining unfixed for the latest version.

I just proposed to delete this page, as it promotes bad practices, like testing on the production API, instead of using the development instance for that purpose, just to name one of the many shortcomings.

Julien Gouesse wrote:

Does the API allow to delete a closed changeset?

No, once a changeset is closed, it is immutable.

Last edited by mmd (2019-04-14 18:19:35)

Offline

#5 2019-04-14 18:39:29

Julien Gouesse
Member
Registered: 2012-07-30
Posts: 5

Re: How to use OSM API version 0.6 with Curl?

mmd wrote:
Julien Gouesse wrote:

I want to upload numerous locations of public free billboards for non commercial activities.

Please discuss this with the French community first before trying anything else. As I mentioned on stack overflow, simply dumping stuff into the DB like you plan to do will get your edits reverted and your user blocked.

I don't see the point of reverting constructive and useful changes. How should I contact the French community?

mmd wrote:
Julien Gouesse wrote:

JOSM works very well in a desktop environment but I need an occasional solution that would work in other situations when there's no JRE available.

There are numerous other libraries available these days, and there's really no need at all to fiddle with the command line.

I don't see the interest of using an editor because I'm able to provide a changeset in a correct format and I don't need to use a library in this case because my use case is very simple, I've already looked at the data in the database in order to avoid creating duplicate nodes.

mmd wrote:
Julien Gouesse wrote:

In my humble opinion, this wiki article should be fixed instead of remaining unfixed for the latest version.

I just proposed to delete this page, as it promotes bad practices, like testing on the production API, instead of using the development instance for that purpose, just to name one of the many shortcomings.

Why not fixing it instead?

mmd wrote:
Julien Gouesse wrote:

Does the API allow to delete a closed changeset?

No, once a changeset is closed, it is immutable.

600px-OSM_API0.6_Changeset_successful_creation_V0.1.png
You're right according to this diagram.

Last edited by Julien Gouesse (2019-04-14 18:40:11)

Offline

#6 2019-04-14 18:51:40

mmd
Member
Registered: 2010-11-06
Posts: 1,706

Re: How to use OSM API version 0.6 with Curl?

Please forget about any technical details for a moment, as they are entirely irrelevant for the time being.

Take your time and read the Import Guidelines first: https://wiki.openstreetmap.org/wiki/Import/Guidelines and be sure to follow every step exactly as outlined on that page.

This wiki page also includes some links to your local community, which would be either the French mailing list or the French OSM forum.

Last edited by mmd (2019-04-14 18:54:33)

Offline

#7 2019-04-14 19:19:46

Julien Gouesse
Member
Registered: 2012-07-30
Posts: 5

Re: How to use OSM API version 0.6 with Curl?

Thank you. I'll use the French forum.

If I don't comply with those guidelines, I'll rather create a separate map hosted in my own server (which is exactly what I wanted to avoid as I wanted to contribute back to the community as OpenStreetMap has been very useful for me). Contributing can be fun but I find some rules really fair-fetched.

Offline

#8 2019-04-14 19:33:43

mmd
Member
Registered: 2010-11-06
Posts: 1,706

Re: How to use OSM API version 0.6 with Curl?

Ok, sounds good. Bonne chance!

Julien Gouesse wrote:

Contributing can be fun but I find some rules really fair-fetched.

Yes, imports are always a bit special and the rules are stricter, in part because of all the bad stuff that happened in the past...

By the way, maybe you can also take a look at umap, which allows you to create your own map with your own data as an overlay: https://umap.openstreetmap.fr

Last edited by mmd (2019-04-14 19:48:09)

Offline

Board footer

Powered by FluxBB