NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Shapefile download

# cd ~/src/openstreetmap-carto/
# scripts/get-external-data.py

INFO:root:Checking table water_polygons

why cannot download the shapefiel?

asked 23 Jul '20, 02:42

%E5%BC%A0%E6%B2%BB%E9%9F%B3's gravatar image

张治音
90236
accept rate: 100%

edited 23 Jul '20, 06:44

scai's gravatar image

scai ♦
33.3k21309459


I have solved the problem that can not download the shapefile . As network is not good and the shapefile is too big, we can not download the shapefile zip . So we open the shell file 'openstreetmap-carto/external-data.yml', and get the info,as following,

settings:
  temp_schema: loading
  schema: public
  data_dir: data
  database: gis
  metadata_table: external_data
sources:
  simplified_water_polygons:
    # The type of file this source is
    type: shp
    # Where to get it
    url: https://osmdata.openstreetmap.de/download/simplified-water-polygons-split-3857.zip
    # The location within the archive
    file: simplified-water-polygons-split-3857/simplified_water_polygons.shp
    archive:
      format: zip
      # Files to extract from the archive
      files:

  water_polygons:
    type: shp
    url: https://osmdata.openstreetmap.de/download/water-polygons-split-3857.zip
    file: water-polygons-split-3857/water_polygons.shp
    archive:
      format: zip
      files:
        icesheet_polygons:
    type: shp
    url: https://osmdata.openstreetmap.de/download/antarctica-icesheet-polygons-3857.zip
    file: antarctica-icesheet-polygons-3857/icesheet_polygons.shp
    archive:
      format: zip
      files:
        icesheet_outlines:
    type: shp
    url: https://osmdata.openstreetmap.de/download/antarctica-icesheet-outlines-3857.zip
    file: antarctica-icesheet-outlines-3857/icesheet_outlines.shp
    ogropts:
      - "-explodecollections"
    archive:
      format: zip
      files:

  ne_110m_admin_0_boundary_lines_land:
    type: shp
    url: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_boundary_lines_land.zip
    file: ne_110m_admin_0_boundary_lines_land.shp
    ogropts: &ne_opts
      - "--config"
      - "SHAPE_ENCODING"
      - "WINDOWS-1252"
      - "-explodecollections"
      # needs reprojecting
      - '-t_srs'
      - 'EPSG:3857'
    archive:
      format: zip
      files:

Then we download all the 5 *zip files manually , and put them to your web server, for me , The url is http://127.0.0.1/osm/

  antarctica-icesheet-outlines-3857.zip 2020-07-24 09:37    51M  
  antarctica-icesheet-polygons-3857.zip 2020-07-24 09:37    51M  
  ne_110m_admin_0_boundary_lines_land.zip   2020-07-24 09:41    45K  
  simplified-water-polygons-split-3857.zip  2020-07-24 09:36    23M  
  water-polygons-split-3857.zip 2020-07-24 09:37    610M

At last, we modify the shell file 'openstreetmap-carto/external-data.yml' ,instead of the url download to ours. As following,

settings:
  temp_schema: loading
  schema: public
  data_dir: data
  database: gis
  metadata_table: external_data
sources:
  simplified_water_polygons:
    # The type of file this source is
    type: shp
    # Where to get it
    #url: https://osmdata.openstreetmap.de/download/simplified-water-polygons-split-3857.zip
    url: http://127.0.0.1/osm/simplified-water-polygons-split-3857.zip
    # The location within the archive
    file: simplified-water-polygons-split-3857/simplified_water_polygons.shp
    ...

It's OK.

permanent link

answered 24 Jul '20, 03:21

%E5%BC%A0%E6%B2%BB%E9%9F%B3's gravatar image

张治音
90236
accept rate: 100%

edited 24 Jul '20, 06:47

scai's gravatar image

scai ♦
33.3k21309459

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×275
×252
×123
×87
×57

question asked: 23 Jul '20, 02:42

question was seen: 3,585 times

last updated: 24 Jul '20, 06:47

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum