Skip to content

Instantly share code, notes, and snippets.

@almccon
Last active July 8, 2016 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almccon/589d6d1766986652c338e3c7db147a42 to your computer and use it in GitHub Desktop.
Save almccon/589d6d1766986652c338e3c7db147a42 to your computer and use it in GitHub Desktop.
Editing the Rann of Kutch

Editing the Rann of Kutch

Q: What is the Rann of Kutch, and why do we care about it on OpenStreetMap?

A: Some context: What's up with the Rann of Kutch? Sample edits/areas: #1 #2

How did it get this way?

Most of the OSM coastline was originally derived from an image classification algorithm using low-resolution Landsat data. (see: PGS Coastline). This data import has been manually improved in many parts of the world in OSM, but not in the Rann of Kutch. Don't trust this data, and don't assume it's correct. However, it's very difficult to come up with something better, which is why no one has improved this particular patch of coastline in OSM.

The PGS algorithm classified most of the Rann of Kutch as ocean, when in fact it is salt marsh that is only flooded during the monsoon season.

We need to fix the coastline so that the Rann is tagged as land instead of ocean. This is not as easy as it sounds.

About the coastline in OSM

The coastline is one of the hardest things to edit in OSM, because it's very easy to break. coastline on OSM wiki.

The coastline is made up of multiple short line segements that all must link up correctly end-to-end. The direction of the OSM segements matters: land is always on the left, and water always on the right.

Here is an example of an island that is made of two natural=coastline ways, one of which is selected (in red): screen shot 2016-06-30 at 30 jun 7 45 01

If you ever fail to keep the coastline segments connected end-to-end, or if you reverse the direction on any of your coastline segments, then you might cause "flooding", where the OSM render misinterprets the coastline to think that land is water, or vice versa. A small error in India could cause the entire continents of Africa and Eurasia to become inverted!

Unlike other OSM features, the coastline requires a separate preprocessing step before rendering, so that it doesn't update as often as other features. It might take days or weeks before you see the results of your edits on the default OSM map, or any other map that uses the processed OSM coastline shapefiles. QA tool to check the status of the coastline, updated twice a day: http://tools.geofabrik.de/osmi/?view=coastline#

Don't leave the coastline in a broken state!

Every time you upload your changes to OSM, make sure that the coastline is fully connected, and that there are no loose fragments of coastline lying around.

This means that fixing large errors like the Rann of Kutch is very difficult! You either have to re-tag and move all of the coastline all at once (not easy!) or move little bits at a time (also not great, because you might have to leave the coastline in a position that makes even less sense). How you approach the problem depends a lot on the geography of the area you're working on.

Where to map the coastline

The coastline in OSM is meant to represent the average high-tide line. Because we don't always know when the satellite imagery was taken, it's often hard to know whether the imagery shows low tide or high tide water levels. Do the best you can, and use any supporting information you can find to determine the high tide line.

River deltas are especially hard to map, such as the Indus River delta at the west end of the Rann of Kutch. The difference between low tide and high tide could be hundreds of meters apart.

In this comment Christoph Hormann found some Landsat images that show part of the Indus delta at low tide and high tide. Feel free to use these as references, or find additional landsat imagery if necessary.

How to map the coastline

Use JOSM

You'll need to use JOSM as your editing tool. The iD editor built-in to the OSM website doesn't allow you to edit very large areas. Here's an excellent JOSM tutorial from Mapbox

Even JOSM has a limit to how much OSM data you can download at the same time. You may have to pan across the map and do multiple downloads to get a large enough area to work with. However, if you can work successfully on smaller areas, try that first!

josm load data

You can also apply a JOSM filter to only show natural=coastline features. After creating the filter click the "I" button to invert it and only show coastline. However, if you change some natural=coastline into something else by editing the tags, then you will need to tweak your filters.

josm filter data

Try different satellite imagery providers to see what the landscape looks like at different times of year, and in different light. Switching between Mapbox Satellite and Bing aerial imagery often shows very different things.

josm imagery mapbox vs bing

Small areas

To adjust small areas of coastline, it's probably easier to just reshape existing features by adding nodes and moving existing nodes.

josm clean up coastline

Adding islands (large and small)

These are relatively easy (but tedious). Luckily when you're adding a new island, you don't need to mess with any of the existing coastline. Just draw the outline of the island with as many end-to-end ways as you wish (or just a single way), making sure you've made a complete loop with the island on the left and the water on the right.

Lakes

Lakes do not use natural=coastline. (the land polygons dervied from the coastline segments should not have any holes inside them, only islands outside them). Lakes should be tagged with natural=water, water=lake, and optionally seasonal=yes, intermittent=yes, and/or salt=yes if any of these situations apply.

Larger areas

To reshape larger parts of the coastline (like most of the interior of the Rann), you will probably have to delete some coastline and draw some new pieces further west.

If you need to delete any natural=coastline ways, make sure they don't have any other valuable tags on them, and make sure they are not part of a relation. If so, consider just deleting the natural=coastline tag and leave the way in place with the other tags intact.

You can also re-use the coastline ways to repesent part of something else, such as a wetland or a lake. In this case you can remove the natural=coastline tag and add new relevant tags, or use the now untagged way as part of a relation.

Especially for the large interior expanse of the Rann of Kutch, most of the natural=coastline ways should be re-used as outer segments for one or more multipolygon relations with natural=water and seasonal=yes. Former islands would become an inner ring making a hole within the seasonal water feature.

Validation

Make sure you run the JOSM validation tool before you save your changes. There might be validation errors that you didn't cause; feel free to ignore these, but fix them if they're easy to fix.

Beyond coastline tags

Along the river delta

We shouldn't just move the coastline, we should also do a better job of tagging what's actually going on in these areas. Specifically, the areas around the river delta are probably natural=wetland and wetland=saltmarsh, and the parts of the river delta that are below high tide are probably natural=wetland and wetland=tidalflat. (It is totally okay to map these features outside the coastline if they are below high tide.)

Further inland in the Rann

The inland areas that are definitely above high tide and are only flooded during monsoon season should probably be natural=water, seasonal=yes, or alternatively natural=wetland, seasonal=yes. There doesn't seem to be consensus (yet) about whether water or wetland is more appropriate for this area.

Other tips

Watch what others are doing

Use the OSM data layer to inspect existing features and to see what tags they have, who edited them, and when they were edited last. This is a good way to learn mapping techniques and to find other people who are mapping in the same area. You can also tell if features haven't been edited in a very long time, maybe they're not up to date anymore.

Ask for help, listen for comments

Use the messaging functions within OSM to privately contact other users and ask them questions about things they've edited. Use changeset discussions to publicly comment on specific edits. Make sure you check your OSM messages often to see if any other OSM contributors are sending messages to you or commenting on your changesets!

Be transparent

When you're mapping for a company, this can also be controversial. There are no rules within OSM above declaring whether you are doing paid mapping or not, but it's probably the wise and considerate thing to do to report your affiliation on your user page. Also, check out the Mapbox Data Team Guidelines to see how Mapbox does it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment