I am trying to use QGIS to generate a set of tiles in Shapefile format from a vector coastline map.

My script is correctly generating the 5x5 degree tiles I want, however a few tiles clearly have some data missing. Investigating these tiles we noticed that they have lone points on the boundary of the tile (e.g. from a peak in the neighbouring tile which just clips into the tile by one point). This is considered a failure and the entire feature (which connects to that point) is removed from the tile.

Output from the command

"gdalogr:clipvectorsbyextent', layer, extent, "-nlt " + ltype + " -skipfailures -overwrite", file"

shows we are getting this type of error:

Attempt to write non-linestring (GEOMETRYCOLLECTION) geometry to ARC type shapefile

This is due to the presence of Linestrings and a stray Point.

I've attached some images which demonstrate this. The lighter green line is the entire map we are cropping from, and the dark green shows the lines that have been kept when generating that tile. If you zoom in on the line just touching the left side of the tile you can see there is one point of that feature overlapping into our tile.

What would be the best way to get the map tiles in shapefile format and not have any missing data? I also need to have only one shapefile per tile.

NeighbourTiles StrayPoint

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.