OpenStreetMap 로고 OpenStreetMap

Saving shapes from vector tiles to a shapefile

Answerquest님이 English로 2023년 10월 14일에 게시함. 최근 2023년 10월 15일에 업데이트됨.
  1. From XYZ tiles in browser, drag Openstreetmap to Layers
    https://server.nikhilvj.co.in/dump/img/vector-tiles-guide/vt-0-osm.webp

  2. In left “Browser” pane, Vector Tiles > New Generic Connection
    https://server.nikhilvj.co.in/dump/img/vector-tiles-guide/vt-1-addvector.webp

  3. Put in a layer name, the URL https://indianopenmaps.fly.dev/google-buildings/{z}/{x}/{y}.pbf, and a min and max zoom like 7 and 14.
    https://server.nikhilvj.co.in/dump/img/vector-tiles-guide/vt-2-vectorurl.webp
    - Don’t worry, QGIS will still show the data when you zoom deeper than 14.
    - This is just for telling qgis till what level vector data is available.
    - Check with the tile layer publisher what their max zoom is.
    - It’s usually useless to have smaller min-zoom value, as the tile server will anyways give redacted data at those levels.
    - If you want to extract the whole data for your region, you better be seeing the map at at least the specified max zoom so that you don’t miss out any shapes.

  4. Use “Select features by area” or a variant of that to select the features you want.
    https://server.nikhilvj.co.in/dump/img/vector-tiles-guide/vt-3-select.webp
    - You can use Shift / Ctrl to move around the map and add more shapes to the selection.
    - Note: stay on a higher/deeper zoom (ie, you should not zoom out too much) so that the shapes aren’t redacted in your view.
    - If you zoom out, what vector tile tech does is: it drops some shapes or does simplification / aggregation so that it doesn’t need to load up all the data over the larger area.

  5. Menu > Edit > Copy Features
    https://server.nikhilvj.co.in/dump/img/vector-tiles-guide/vt-4-copy.webp

  6. Menu > Edit > Paste Features As > New Vector Layer
    https://server.nikhilvj.co.in/dump/img/vector-tiles-guide/vt-5-paste.webp

  7. In the box that opens, select geojson or your preferred format, choose a folder / filename
    https://server.nikhilvj.co.in/dump/img/vector-tiles-guide/vt-6-file-crs.webp
    - Remeber to change the CRS to WGS 84 / EPSG 4326 : That’ll give you lat/lon values. The 3857 one will give huge numbers in your shapefile.

  8. You can now drag-drop your newly created .geojson file onto https://geojson.io to independently verify that you’ve got the correct data. It’ll also be carrying any metadata / attributes that the original vector tile layer was having.
    https://server.nikhilvj.co.in/dump/img/vector-tiles-guide/vt-7-preview.webp

위치: Shaniwar Peth, Pune, Pune District, Maharashtra, 411002, India
이메일 아이콘 Bluesky 아이콘 Facebook 아이콘 LinkedIn 아이콘 마스토돈 아이콘 텔레그램 아이콘 X 아이콘

토론

2023년 10월 14일 11:05PlaneMad님의 의견

Very useful, wasn’t aware one could copy out features from tiles in QGIS.

One thing to note is that the detail of the features in the tiles can vary by zoom level, so the copying needs to be done at the max zoom level for that tile set to ensure features are not simplified. Not sure if there’s an obvious way to know that in QGIS.

댓글을 남기려면 로그인하세요