Thứ Năm, 24 tháng 6, 2021

EDITING OPEN STREET MAP (osm) IN JOSM

 Below is the description on how to edit an Open Street Map file (osm) in JOSM

-          OpenStreetMap is a free and open-source map tool that utilizes data from satellite images and local geographical knowledge.

-          JOSM or Java Open Street Map Editor is the tool for editing the osm map.

           

OSMnx developed by Jeff Boeing is a great tool for analyzing street centrality such as efficiency, straightness, betweenness, etc. Nevertheless, it does not allow you to add or remove edges, the task sometimes you need to perform. That task is a kind of what-if scenario analysis in urban planning. You may ask, “what will happen with straightness or betweenness if I add an edge between point A and point B?” Thus, there is the need for editing a network. Fortunately, JOSM allows you to edit an osm file and OSMnx allows you to download that osm file 😊

This is the python line to download osm in OSMnx:

G = ox.graph_from_file('name_of_osm_file.osm', simplify=True, retain_all=True)

I.     Download data from Open Street Map

First, you need to open the Open Street Map, locating the area that you want to download your street network. To do that you will use a bounding box to export data of your area.

In this tutorial, I will use an example of Al Bateen area, a downtown area in Abu Dhabi.

Here is the screenshot of the location of Al Bateen in downtown Abu Dhabi

Enter the coordinates. In case you know the name of the place, enter the name.


Fine-tuning the selected area by adjusting latitudes and longitudes of the bounding box. The more precise you define the bounding box, the more time you save in editing in JOSM.

Click Export. Look at the download folder and change to the appropriate name of the osm file.

 I.        Edit data in JOSM

Most of the time you will switch back and forth between Selection Mode (S) and Delete Mode (Shift+Delete) and Draw Mode (A) in JOSM

Select Mode: Mode àSelect mode (S)


Or hit S

 

-    Delete Mode

 



Or Shift+ Delete

Be patient. You need to remove all unneeded edges (i.e., roads, ways, or alleys) until you are satisfied with the network that you have.

Sometimes, you need to add some edges. Again, switching between draw mode (A) and selection mode (S).

 

a.       Use the draw function of JOSM to draw a box around an area that you want to create the network.

-          To draw a bounding box, approximately draw a box with edges that match the length of the box. For example, I draw an edge with a length of 800m. Pay attention to the status bar where it shows the length of an object. If you don’t have a perfect square box. Don’t worry, you can correct that.

-          Select all edges, hit Q, all corners have 90 degrees. All corners of the box have 90 degrees.



So, the red lines represent the bounding box. To make this bounding box a perfect square, select all edges and hit Q. It will make the box a perfect square.

Now you have a bounding box of that area.

a.       Now you want to trim all edges that go outside of the bounding box. Because JOSM is not an AutoCAD program, so you need to be patient and cut individual edges.

Select an edge that goes outside the bounding box: change to Select Mode (S), left-click to the edge.

Draw a node of that node at the intersection of the bounding box and the edge that goes outside the box.


Hit A and add a node in the intersection of the edge and the bounding box. This node belongs to the edge.


Note: add only a node, do not draw a line!

Now change to the Delete mode to trim the edges that go outside the bounding box. Shift+left click to delete part of the edge that goes outside the bounding box.


The result is that part of the edge was clipped.

Working the same way, you can cut all edges that go outside the box. You will have results similar to the below image.


Finally, remember to delete the bounding box. Shift+delete to delete segments of the bounding box.

Important Note: after finishing the deletion. Make sure that you delete all nodes and edges that are needed to delete, select View à zoom to data. If you see only the network inside the bounding box, it means you delete all needed nodes and edges, otherwise, some nodes and edges still outside the box that wait for your action. Sometimes they are too small and too far so be careful.

For example, in the below figure.

Can you see some green nodes on the left side? Be sure to delete all of them. After that select Viewà Zoom to Data to make sure that you don’t have unwanted nodes or edges outside the bounding box.

I.        Tricks to manipulate the network

a.       Dividing a way into equal part:

Tools à Distribute nodes: Shift+ B

First, adding a node (hit A) to a line, left-click. Don’t worry about the precision, add a node at any position of the street. 

(Remember, adding a node, do not draw a line)


Now select the street (S and left click) again and Shift + B, the node(s) will line up in equal distances.


a.       Draw a parallel line

Modes à Parallel (or Shift + P)

Click Shift + P then click to the street that you want to draw a parallel line to.

Can you see it? Dragging the line close to the point that you just created. So now you drew a line that starts in the middle of one segment and parallels to another segment.

If you want to create a line that parallels the original line with a certain distance (100m for example), drag and pay attention to the fifth position of the status bar; that bar shows the distance.


This is the status bar, at the fifth position of the status bar, you see the distance between the new segment and the old segment.

a.       Draw 0, 90 degrees, and so on

If you want to draw with the precision of certain angles, use the fourth position in the status bar.


 Hover the cursor over the fourth position, right-click to select a degree that you want to use. For example, 0, 90

Hover over the edge that you want to connect (and you want to create an orthogonal edge). Once it turns yellow, then click the segment to add another endpoint.

Note: Sometimes, the opposite edge does not turn yellow immediately, right-click, it will show a menu bar, hit ESC ,then the opposite edge turns to yellow. I don’t know why it works, but it works.

You have a street with 90 degrees.

a.       Adding the city map.

Sometimes, you need to add an Open Street Map beneath your street network so that you can trace and add edges (roads, ways, alleys, etc.)

Imagery à OpenStreetMap (Standard Black & White)




 



 


 



 





 



 






 


 



Không có nhận xét nào:

Kevin Lynch- Good City Form- Hinh thuc hoan hao cua thanh pho