16

I have a Shapefile with Polygon features representing the world's land areas (continents, islands).

Is it possible to invert these, and get a geometry that represents the world's oceans and seas?

So the original land Polygons need to become rings in a single global Polygon that covers the planet.

Basically, I'm looking for something like Select > Inverse in Photoshop.

I am using QGIS.

0

3 Answers 3

23

You can do this using the following steps:

1- In QGIS go to Vector > Research Tools > Polygon From Layer Extent. Use the World's Land area as Input File. Choose the Desired name for the output file name of extent layer. This will create a new vector layer covering the Whole Land area.

2- Use Geoprocessing Tools > Difference: Use the extent layer created in step one as input file and world's land area as difference file. Then You will get an opposite shapefile which represents the ocean.

1
  • 2
    I'm accepting this, because generally this seems to be the right technique. Matte is right though: some of the ocean will be missing.
    – kontextify
    Apr 1, 2016 at 20:53
8

When you invert the polygons its probably missing a small amount of ocean in the end as the extend of the landmass will not go up to the northpole and therefore the difference may lack a bit there. Depending on what should be done with the data afterwards it might be better to just get the ocean data.

http://www.naturalearthdata.com/features/

3
  • 2
    I considered Natural Earth, but I need more detailed coastlines.
    – kontextify
    Mar 30, 2016 at 8:41
  • This is interesting because there is no point at which a coastline is 'detailed' enough; there will always be more detail available in the natural world. For the US east coast, I know the coastline available from NOAA ( ngdc.noaa.gov/mgg/shorelines ) wasn't enough for me.
    – Geocurious
    Mar 31, 2016 at 12:54
  • 2
    I ended up going with an excellent OSM-based dataset. It's detailed enough for me. openstreetmapdata.com/data/water-polygons
    – kontextify
    Apr 1, 2016 at 20:57
3

Additional to ahmadhanb answer, you can create a buffer of a few degrees/km/miles to the "Polygon from Layer Extent", in this fashion you will have some space out of the most external vertices of your continental shapes (which is what you obtain).

Then, you may apply "Difference" to this buffered shape to erase you continent polygons and obtain the ocean.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.