Jump to content

 
Photo

Clean earth coastline data

- - - - -

  • Please log in to reply
5 replies to this topic

#1
preet

preet

    Newbie

  • New Member
  • Pip
  • 3 posts
  • Canada

Hey all,

I need Earth coastline data for an application where 'problematic' geometry isn't allowed. So ... self-intersecting points/edges and other impossible geometry need to be fixed before I can use them. I've found a bunch of great coastline data on naturalearthdata.com, but it has a ton of these errors. Opening the data up in QGIS and checking for such issues showed hundreds of problems. The general level of detail available with the natural earth data from a distance of 10m(illion) km is what I'm looking for (to meet complexity constraints). I tried looking at OSM coastline data to check for errors (I think they clean their coastline data but I wasn't sure), but its way too detailed -- my computer froze up just trying to load the data.

So, I'm basically looking for clean coastline data (including lakes/large bodies of water) at a reasonable level of detail, with a good reference for 'detail' being this: http://www.naturalea...ysical-vectors/. I see two ways of obtaining this (please chime in if you have alternative suggestions):

1 - get the natural earth data and somehow clean it
2 - get the osm data and simplify it

I'm not too sure how to do 1 at all, and I have some ideas on how to do 2 but haven't gotten very far with it. I'd appreciate any suggestions/feedback you might have (note that I'm not a professional GIS guy, and I don't have any access to commercial software)


Preet

#2
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,320 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

I thought the Natural Earth data should have been cleaned... You could try to simplify and check for topology errors in QGis. Another way would be to rasterize it, and then transform it back to vector.
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#3
Michael Schmeling

Michael Schmeling

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 206 posts
  • Gender:Male
  • Location:Kassel, Germany
  • Germany

I am suprised that you should find so many errors in Natural Earth Data. E.g. I have never seen any self- intersecting edges. Are you sure it is not some computational problem in QGis?

As an alternative you could try

SRTM Water Body DATA
Michael Schmeling
Kassel, Germany
Arid Ocean Map Illustrations
http://maps.aridocean.com
Indie Cartographer
http://www.indiecartographer.com

#4
nathaniel_kelso

nathaniel_kelso

    Newbie

  • Validated Member
  • Pip
  • 7 posts
  • Gender:Male
  • Location:Washington, DC
  • United States

The 1.4 release reflected data repaired so all topology errors were fixed as reported by ArcGIS.

However, QGIS and PostGIS are much, much, much more obsessively obtuse, narrow sighted about topology than ArcGIS. Their poor support for even importing real world data, not perfect academic data, is a strong mark against them. That said, I've been working to address some of the underlying problems (mostly self-intersections only visible at 1:1000 scale) in the linework for the 1.5 release. The 1:10,000,000 land, ocean, coastline, and admin-0 variants are fixed so far. The admin-1 variants will need to wait for a 1.6 release, as well as the 1:50m and 1:110 data. Remember, these are cartographic representations, not data used for topology modeling at detailed scales.

In the meantime, PostGIS 2.0 released a couple weeks ago has a new fix/clean/repair geometry function (not on by default, you'll need to import and then apply that function) that'll work nicely on the existing 1.4 data. Please give it a whirl.

_Nathaniel
Chief cartographer, NaturalEarthData.com

#5
preet

preet

    Newbie

  • New Member
  • Pip
  • 3 posts
  • Canada

Thanks to all for the detailed replies :)

Are you sure it is not some computational problem in QGis?


By adding the dataset as a vector layer in QGis and then zooming in, you can identify intersecting edges visually. The errors aren't prevalent, but there do seem to be a few. If you use the Vector tools to check geometry validity (using the 10m_land dataset), QGis will list ~350 errors (which isn't that bad considering its a dataset of the entire world I guess)

In the meantime, PostGIS 2.0 released a couple weeks ago has a new fix/clean/repair geometry function (not on by default, you'll need to import and then apply that function) that'll work nicely on the existing 1.4 data. Please give it a whirl.


This seems like a great starting point, thanks.

#6
preet

preet

    Newbie

  • New Member
  • Pip
  • 3 posts
  • Canada

Just in case anyone runs into this issue in the future there's a way you can 'clean' broken polygons quickly using this simple tool: https://github.com/t...ft-gist/prepair. The tool seems designed exclusively for repairing GIS poly data. You can check out the corresponding paper here http://www.gdmc.nl/l...fs/_12agile.pdf to see how it handles various polygon errors. Note that this doesn't magically fix nonsensical geometry, but instead seems to break down self intersecting / invalid polygons into sets of valid polygons using triangulation as a basis.

The tool itself expects WKT data. So for the coast line data, I first used ogr2ogr to convert it into a CSV file with the WKT data using something like:

ogr2ogr -f CSV output.csv 10m_land.shp -lco GEOMETRY=AS_WKT -lco CREATE_CSVT=YES -nlt POLYGON -select ""

Then I read the data in with the tool (I modified the source slightly to read in the file since it original expects a single WKT string) and wrote the corrected data, again as a CSV with each line corresponding to a WKT poly. Finally I used the Add Delimited Text Layer option in QGIS to add the data, and saved it as a shape file. QGIS now finds 0 errors after a validity check which is pretty nice. You can still see some of the same intersections, but I'm guessing the single invalid poly has been decomposed into multiple valid ones.


Regards,

Preet




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->