(nb:This project is part of the #Wikipedia #wikimaps project)
- How to create vector topographic maps from raster image ?
- How to convert raster topographic image into closed vector polygons for the relevant levels as seen in the illustration below ?
Using commands (likely gdal) and a GIS topographic raster image, I want to produce topographic .shp maps with an elegant relief. This .shp should be made of closed polygons for each of the n requested level.
2. Possible direction would be:
Create vector isolines (
gdal_contour -a elev -fl -500 0 500 1000 2000 4000 crop.tif contours.shp)
Create a copy of the whole map area into vector polygon,
- Cut this polygon with all isolines of level n (i.e. isolines of level 0).
- Keep those of these polygons with a value (altitude) superior to the isoline value.
- (merge this polygons into one shp layer of level_n.)
- Repeat for each level.
I haven't clues how to do that, but it sound promising! (should work) If you can provide the solution to one of the points 2, 3, 4, It will be really appreciated ! and I will be happy to then open a specific question where I will validate your helpful answer.
3. Current workflow: gdal_contours alone is not suitable. I currently crop my source raster ETOPO using
gdal_translate then get levels with
gdal_contour. Using the libs
gdal, my current worflow is as follow.
# download it: curl -o ETOPO1.zip 'http://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/data/ice_surface/grid_registered/georeferenced_tiff/ETOPO1_Ice_g_geotiff.zip' # unzip it: unzip ETOPO1.zip # crop it: gdal_translate -projwin -005.48 051.30 10.00 041.00 ETOPO1_Ice_g_geotiff.tif crop.tif # lines for levels: gdal_contour -a elev -fl -500 -200 0 100 200 500 1000 2000 4000 crop.tif contours.shp
gdal_contour generates vertor iso lines, which are not suitable. The main trouble is with cropped areas: in the case of a close up on France, the isolines are not closing into a circle as for Islands or continents but open lines, so there are partial parts of the polygons (as the quarter of a circle) whose' relevant fill --a 1/4 pie-- appear as a filled arc (see bug below).