Converting free data from RGC to .gpx

There are a lot of points (waterfalls, train stations, villages, …) and lines (streets, railways, local borders, …) from the Congo-Zaire, still missing at OSM at the RGC website for free (if source is mentionned): “les données du RGC sont libres d’utilisation mais nous vous demandons de citer les sources : « Ces données géographiques proviennent du Référentiel Géographique Commun (www.rgc.cd) ».”

At the website are .zip files
If I open the .zip file, there is a folder with the following documents: *.dbf, *.sbx, *.shx, *.prj, *.shp, *.sbn, *.sbn.xml

To convert this to *.gpx, I tried probabely everything (who was for free) I could find in the last four weeks on the internet and runs on MacOS X 10.4 or online. Unfortunately, nothing works or if it seems to work, there where no ways, but only one point in the middle of the ocean :frowning:

Could someone have a look at the docs at “Fichiers vectoriels” at rgc.cd an tell me how to convert them to .gpx?

Thank you very much.

I am preparing an email to ask for the technical details of the available data. I have looked at their specs, which is quite complete with explanation of each available field and the possible values, but it doesn’t explain how to open the data. I presume the data is contained in the .dbf file, which must be some kind of database dump file.

It indeed seems to be a good source of data to import into OSM. This can be a valuable import project. Männedorf, have you set up a page on the Wiki to keep the info about this upload? I think it would be useful to have such a page.

I’ll keep you updated on when I’ll send the mail and get a response. And FYI, I’m French, so it can be useful for communicating with the RGC, as all the info on their site is in French. I suppose you can speak/read it at least a little bit?

I’ve sent the following email to sig@rgc.cd on Wed, 21 Jul 2010 15:00:37 +0200:

Bonjour,

Je suis un contributeur du projet OpenStreetMap
(http://www.openstreetmap.org). Petite description de OSM (tiré du
wiki):
“OpenStreetMap crée et fournit des données géographiques libres,
telles que des cartes routières ou cyclables, à quiconque en aura
besoin. Cet outil est né parce que la plupart des cartes que vous
pensez libres ont des restrictions légales ou techniques qui nous
empêchent de les utiliser de façon créative, productive ou innovante.”

Nous avons découvert vos données géographiques sur votre site rgc.cd,
et nous serions intéressés par le fait de les importer dans OSM, afin
d’augmenter la qualité et le nombre d’informations disponibles pour le
Congo sur OSM. Évidemment, afin de respecter vos conditions, les
données importées seraient accompagnées d’une balise
“source=Référentiel Géographique Commun - www.rgc.cd”. Merci de me
confirmer que ceci remplit vos conditions.

Vous pouvez voir l’état actuel de la carte du Congo ici:
http://www.openstreetmap.org/?lat=-2.79&lon=23.33&zoom=6&layers=M

Afin d’évaluer le travail nécessaire à l’importation d’une partie des
données disponibles sur votre site, j’ai entrepris de télécharger
l’archive des Localités depuis http://www.rgc.cd/doctech/Localite.zip.
La structure interne de cette archive est la suivante:

Localite.dbf
Localite.lyr
Localite.prj
Localite.sbn
Localite.sbx
Localite.shp
Localite.shp.xml
Localite.shx

J’ai essaye de trouver dans vos spécifications [1] comment ouvrir ces
données, mais je n’ai pas pu trouver cette information. Je suppose que
le fichier .dbf est celui qui contient les données (est-ce un dump
d’une base de données?), mais je ne sais pas dans quel programme
ouvrir ce fichier. Et que contiennent les autres fichiers?
Pourriez-vous me faire parvenir ou m’indiquer ou trouver de
l’information sur le format de ces fichiers?

Cordialement,
Emilien Klein.

[1] http://www.rgc.cd/doctech/RGC%20Specifications%20V4.7.pdf

On CloudMade’s site I found the following info:

Shapefiles
Native Extension: .shp, .shx, .dbf (souds familiar?)

Shapefiles are a data exchange format created by ESRI which are one of the most widely used geodata formats. When we talk about a “shapefile” we are usually talking about three different files – .shp, .shx, .dbf. All three files must all be present in order to use the data. Each shapefile can hold only one geometry type. Our files are split into several categories – highway, which contains features like roads and footpaths, natural, which contains area features like parks and forests, poi (point of interest), which contains point features like amenities and tourist attractions, administrative boundaries and finally coastlines and water bodies. Because shapefiles are widely used they can be combined with other geodata and used inside GIS (Geographic Information Systems), such as the open source QGIS application.

It then links to a Wikipiedia page.

How to import data from shapefiles.

This is the answer I just got. For clarification, there is no problem importing this data as long as we credit them.
The question about following the updates is a good one, any thoughts about this?

Bonjour Emilien,

Je ne vois pas de problème à l’utilisation des données RGC pour alimenter openstreetmap. Les données sont libres d’utilisation. Nous demandons simplement de mentionner la source tel que vous le décrivez dans votre mail. Cependant, la base de données a été constituée de toutes les données partagées par les partenaires actifs en RDC et jusque aujourd’hui la base de données du RGC a été évolutive et des mises à jour étaient faites en continu. J’ai d’ailleurs plusieurs fichiers à poster dans les prochains jours. Comment comptez vous suivre les éventuelles update à l’avenir?

Les fichiers vectoriels dont vous parlez sont au format ESRI lisibles dans la plupart des logiciel SIG, y compris open source.

Bien cordialement,
Xavier Blaes


GIS coordinator - UNDP - DRC / www.rgc.cd

+243 81 57 51 259 (DRCongo) / +32 486 613 623 (Belgium)

When you are planning now to try an import of the data, have a look at http://wiki.openstreetmap.org/wiki/Imports before, it can be helpful.

I kow this site, but “Geo Converter” from HSR does not convert the files from RGC, and I never runned scripts (on my Macintosh is no “windows prompter”) – if someone could tell me step by step, this would be helpfull.

I tried also QGIS: There I can open the SHP files an see the points or ways, but when I save it as GPX to import to OSM, OSM does not accept the GPX, because there is no time stamp.

Following to another message in this forum, I opened the file with GPS TrackMaker*. It works and I saw the routes. The I savec it as gpx, but osm refused again the gpx, because there is no time stamp.

Someone else wrote in 2009 in this forum, there is a possibility to open a gpx with RouteConverter*, but the results there ar quite crazy: it announced 500 tracks, but shows just two points somewhere in Chad (the ways should be and where in QGIS and GPS Track Maker in the Congo).

*Windows, I could use it while visiting a friend.

Converting data is my daily business, but here (SHP-data from RGC to GPX for OSM), it seams to be impossible!?
I am sorry, but after two week end turning around because of this stupid time stamp, and no one who can really help (?), I am demoralised.

  • Is there a software to open SHP and just save as GPX who is accepted by OSM?
  • or is somehwhere a step-by-step tutorial (“you can download the script here … and use it simple with xyz file in comand line” is not helpfull enough for me)

In the shape file from RGC are a lot of information. It should be possible to convert them all, for example name, elevation, source,… or by ways: railway, double/single track, gauge, operator, … This should not be as complicated (I do this at work with 1000s of data every day, not railways and maps, but sales, customers, etc.).

Hi,

You must not upload GPX files converted from shapefiles, that option is only meant for uploading original data collected with GPS. Fortunately that is not necessary at all.
There are at least two alternatives, probably more. Most simple is to open the converted gpx file with JOSM. JOSM can convert gpx layer into OSM data layer, and then you can feed in the tags, download the existing OSM data, solve the conflicts and finally upload.
A bit more automatic way is to use ogr2osm.py python utility. For more information see http://wiki.openstreetmap.org/wiki/Ogr2osm

If the datasets from RGC are big it might be better to do some thinking and planning first. The imports mailing list is made for this. Contact imports@openstreetmap.org

Finally, I got the data to OSM. I used this way:

  • install Merkaartor
  • import the shp file
  • check the tags (for example “SRC GEO” changed to “source”)
  • add missing tags (f.ex. “railway=rail”)
  • click on the way
  • right mous click → Features → Forced Upload
  • Upload data
  • login at OSM
  • click on my name
  • check the “edit” page: yes the way is there!
  • open potlatch: check the tags: 90% of the ways are well tagged, some times, all tags went lost, I added them again (it was just a empty route).

Warning:

The data from RGC are not accurate.

I compared at Katanga the Tenke-Dilolo-Railway-Line with the existing OSM data and aerial view.
I did the same at he Matadi-Kinshasa-Railway-Line.
That is why I tagged allways “fixme=yes”.

Data from RGC can be used where no data are avaible to start, but they should be refined f.ex. with GPS tracks or local knowledge little by little.

I’m glad you were able to convert the data. I’ve never really used Merkaartor, so I didn’t know it could open the shp files directly, that’s great (if JOSM could do that it would be great!)

So we could use the RGC data to start where no data is present, but leave it out when it’s already mapped, if local knowledge/aerial info is more accurate.

Keep up the good work Männedorf!