OpenStreetMap logo OpenStreetMap

baditaflorin's Diary

Recent diary entries

How to create a translation file to convert a shp file to osm

Posted by baditaflorin on 31 October 2017 in English. Last updated on 1 November 2017.

Obviously but very importantly:

  • Before copying anything into OSM the license needs to be properly vetted.
  • If you are planning to perform any kind of bulk update, the full extent of the Import Guidelines applies.

After comparing Tiger 2017 for 16 US states until now, using shp2cygnus, a tool that I written at Telenav to be able to compare big datasets in a automatic way, to identify roads that are present in the dataset, but not in OSM

After posting on the talk-us, some people told that it would be more useful to run this tool on other datasets, from state or local authorities.

In this article, I want to teach you how to create your own translation file, so that if you have a shp file, you can use Cygnus to compare this with OSM, using this link http://cygnus.improve-osm.org If you have a shp were the size is bigger then 50*50 km, you can send me a email and I can process it for you.

But you need to learn how to create your own translation file.

So, first step.

  1. Find your data

See full entry

Yesterday we had our anniversary OSM Time meetup, where we celebrated 13th years of OSM, and we also had a workshop for the participants, to learn how they can extract information’s from OSM, using overpass API and overpass-turbo.

See full entry

Location: Center, Cluj-Napoca, Cluj Metropolitan Area, Cluj, Romania

1. The most simple way is to count just the ways with the highway tag that are at version 1

But …

This fails when we approach the fact that when you split a way, the longer segment will remain with the WAY id, and the smaller way will get a new ID, meaning that it will be version 1. Alt text

2. We can use the nodes of the ways

Using the nodes as a identifier, because even if the way is new, all of the nodes are still from the old way, meaning that the timestamp will be different, the user that created the node will be a different user then the user of the way.

3. But how can we find out this in OverPass ?

See full entry

If i try to use the copy and paste function from the keyboard, more times than not it will not work.

Only when using the menu Edit -> copy it will copy and paste in the first go.

Are you having the same problem or there is something local with me and my colleagues from the map analyst team that we are having this problem ?

I made a ticket https://josm.openstreetmap.de/ticket/13620

And for simplicity, also, a video showing the error.

https://youtu.be/56ZLaZ_BM64

How to find out the total length of highway per type of road / per Country in PostGIS

using the OSM postgis Script Repository This is a part of the final result.

  • Step 1. - Download the North-America osm.pbf file from Geofabrik __(7.4 Gb)__

The link is here You can use this command line to download the file in linux.

wget http://download.geofabrik.de/north-america-latest.osm.pbf
  • Step 2. - Load the data into PostGIS using the scope.sh utility tool

You can find the script here https://github.com/baditaflorin/osm-postgis-scripts/ The aim of this tool is to simplify the process of importing a osm.pbf file into PostGIS. Now the procedure is complicated and you first have to create the database, then to enable postGIS and Hstore on that database, etc

See full entry

Hello dear OSM community.

It was been a while since i posted in the diary.

I had made a new script that i had put in the OSM postGIS scripts repo https://github.com/baditaflorin/osm-postgis-scripts

You can find it in the statistics folder, under the name highway_length_per_type_different_attr.sql

How can you do the same for your country or region ?

First, download and run the scope.sh (linux) or the scope.bat (win) utility that you will use to load the file into postGIS.

After you load the file in postGIS, you just have to connect to the database either in PgAdmin or via Qgis Dbmanager and copy and paste the code.

It took 20 seconds to generate this result for the map of Romania (~150 MB pbf file)

jh

Please help me with ideas of what other scripts would there be interesting for you. Thanks and see you at SOTM in 3 weeks

I define a grid city as a city formed from straight roads.

You can read more and see a video where i try to explain here https://josm.openstreetmap.de/ticket/13224

Now, if we have a matrix of 7*7 grid, we have to click almost 50 times to add the city.

With this solution, we should only add the vertical and horizontal lines, clicking 14 times, and then using the Validation, it will see that we have 49 Crossing ways, and would offer the possibility to fix, by merging the overlapping ways together

A B C D E F G

1 1 2 2 3 3 4 4 5 5 6 6 7 7

A B C D E F G 

https://josm.openstreetmap.de/ticket/13224