حستجو و دانلود داده های OpenStreetMap  (QGIS3)

Getting high quality data is essential for any GIS task. One great resource for free and openly licensed data is OpenStreetMap(OSM) . The OSM database consists of all types of mapping data - streets, local data, building polygons, administrative boundaries etc. Getting access to OSM data in a GIS format in QGIS is possible via the QuickOSM plugin. This tutorial explains the process for searching, downloading and using this plugin.

نمای کلی تمرین

ما مکان های همه بارها و میخانه ها در لندن را از پایگاه داده OpenStreetMap استخراج خواهیم کرد و آن را به عنوان یک لایه برداری ذخیره خواهیم کرد.

آنچه شما یاد خواهید گرفت

  • How to chain multiple queries in QuickOSM plugin.

مراحل

  1. Search and install the QuickOSM plugin from the QGIS Official Plugin Repository. See استفاده از پلاگین Plugins for instructions on downloading plugins. Make sure you have the checkbox selected. Click Close.

../../_images/1100.png
  1. Once installed, launch the plugin from Vector ‣ QuickOSM ‣ QuickOSM....

../../_images/260.png
  1. In the Quick query tab, you can set a filter to select a subset. The attributes of the map features in the OSM database are stored as Tags. Tags are represented with a key and a value. The key is a topic and a value is a specific form. See the OSM Map Features wiki page for a comprehensive list of tags for various types of features. Bars are represented using the tag amenity:bar and pubs with the tag amenity:pub. We will first extract the bars. Select amenity as the Key from the drop-down menu.

../../_images/330.png
  1. عبارت bar را از فهرست کشویی Value انتخاب کنید.

../../_images/415.png
  1. We can chain multiple queries in the latest version (v2.0.0 +) of the QuickOSM plugin. Click on the plus button next query selection bar will appear. Click on the first selection box where we can get option And and Or. And will select only feature which is true for all queries. Or will select all features which are true for any of the queries. Click Or to select both bar and pub features.

../../_images/514.png
  1. Select amenity as the Key from the drop-down menu. Then select pub from the Value drop-down menu.

../../_images/614.png
  1. برای محدود کردن جستجو در محدوده شهر ، "London" را به عنوان: In وارد کنید.

../../_images/714.png
  1. بخش Advanced را باز کنید. در مدل داده OSM ، عارضه ها با استفاده از گره ها ، راه ها و روابط `nodes, ways and relations نشان داده می شوند. از آنجا که به عارضه های نقطه ای علاقه مند هستیم ، می توانید فقط``Node`` و Points را انتخاب کنید. کلیک کنید: برای اجرای پرس و جو بر روی Run query کلیک نمایید.

../../_images/814.png
  1. Once the query finishes, switch to the main QGIS window. You will see a new layer called amenity_bar_amenity_pub_London added to the Layers panel. The canvas will show the locations of the bars and pubs that were extracted.

../../_images/914.png
  1. Open the Attribute table of the layer. There are 2091 features. The column amenity contains the category whether the feature is pub or bar. Using this categorical column, lets style our layer.

../../_images/1019.png
  1. Click on the Open the Layer Styling panel icon, select Categorized then in Value select amenity then click Classify. Now the layer will be styled with 2 color featuring both bars and pubs.

../../_images/1122.png
  1. Now right-click on the layer, Export ‣ Save Feature As... to export the layer as GeoPackage.

../../_images/1220.png
  1. In the Save Vector Layer as... dialog box, in Format choose GeoPackage, in File name click ... and browse to the directory where you want to save the data and name the output london.gpkg. In Layer name enter bar_and_pubs. Click OK.

../../_images/1318.png
  1. Now a GeoPackage layer london_bar_and_pubs will be added to the canvas.

../../_images/1416.png

If you want to give feedback or share your experience with this tutorial, please comment below. (requires GitHub account)