<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Daniel Torres</title>
    <description>The latest articles on DEV Community by Daniel Torres (@toodaniels).</description>
    <link>https://dev.to/toodaniels</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F210591%2Fd9c4b2c3-a778-4712-9b1c-3b9e43315edd.jpeg</url>
      <title>DEV Community: Daniel Torres</title>
      <link>https://dev.to/toodaniels</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/toodaniels"/>
    <language>en</language>
    <item>
      <title>How to get streets data using overpass Api</title>
      <dc:creator>Daniel Torres</dc:creator>
      <pubDate>Thu, 31 Mar 2022 03:42:04 +0000</pubDate>
      <link>https://dev.to/toodaniels/how-to-get-streets-data-using-overpass-api-2b2g</link>
      <guid>https://dev.to/toodaniels/how-to-get-streets-data-using-overpass-api-2b2g</guid>
      <description>&lt;p&gt;I will show you a simple and fastly way to get the streets geometry and another information from OSM(open streeet maps), to do this, we will use Overpass turbo. &lt;/p&gt;

&lt;p&gt;According the &lt;a href="https://wiki.openstreetmap.org/" rel="noopener noreferrer"&gt;wiki of open street maps&lt;/a&gt;, Overpass turbo is  is a web based data mining tool for OpenStreetMap that run runs any kind of Overpass API query and shows the results on an interactive map.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;a href="https://overpass-turbo.eu/" rel="noopener noreferrer"&gt;https://overpass-turbo.eu/&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Select in &lt;em&gt;Wizard&lt;/em&gt; &lt;/li&gt;
&lt;li&gt;Write &lt;code&gt;highway=* and type:way&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;em&gt;build and run query&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Overpass turbo will create automatically the following query&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

[out:json][timeout:25];
(
    way["highway"]({{bbox}});
);
out body;
&amp;gt;;
out skel qt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And now you can run it and see all the streets geometries drawn on the map.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl1fz5e7rtecgjl1w9rud.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl1fz5e7rtecgjl1w9rud.png" alt="Cuautla streets on overpass turbo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, you can click on &lt;em&gt;Export&lt;/em&gt; and click on GeoJSON &lt;em&gt;download&lt;/em&gt; button.&lt;/p&gt;

&lt;p&gt;Also, you can use the &lt;code&gt;Query Wizard&lt;/code&gt; to find another type of places, the following query have been generated writing only the word "shop", and it returns the shops places.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

[out:json][timeout:25];
(
    node["shop"]({{bbox}});
    way["shop"]({{bbox}});
    relation["shop"]({{bbox}});
);
out body;
&amp;gt;;
out skel qt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In addition, if you don't want to get only the streets selected on the web IU, you can replace &lt;code&gt;{{bbox}}&lt;/code&gt; to your manually selected coordinates.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

[out:json][timeout:25];
(
    way["highway"](
        18.806908708848084,
        -98.95872831344604,
        18.825777549841018,
        -98.94263505935669
    );
);
out body;
&amp;gt;;
out skel qt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now, you can use another tool to show this information such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://kepler.gl/demo" rel="noopener noreferrer"&gt;Kepler&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://geojson.io/" rel="noopener noreferrer"&gt;Geojson.io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.qgis.org/es/site/" rel="noopener noreferrer"&gt;QGIS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In case you need to obtain many more geometries, I recommend you to use a tool like &lt;a href="https://osm2po.de/" rel="noopener noreferrer"&gt;osm2po&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For know more about this topic, please check the documentation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://wiki.openstreetmap.org/wiki/Main_Page" rel="noopener noreferrer"&gt;https://wiki.openstreetmap.org/wiki/Main_Page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.openstreetmap.org/wiki/API" rel="noopener noreferrer"&gt;https://wiki.openstreetmap.org/wiki/API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.openstreetmap.org/wiki/Overpass_API" rel="noopener noreferrer"&gt;https://wiki.openstreetmap.org/wiki/Overpass_API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL" rel="noopener noreferrer"&gt;https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>geospatial</category>
      <category>openstreetmaps</category>
      <category>overpassapi</category>
      <category>openstreetmap</category>
    </item>
  </channel>
</rss>
