Looking for assistance in cleaning up a Government Data download Item

Hi all,
I’ve been using OSM for a while, including OSMAND and I have especially been using it for hunting purposes.
The crown land database for my province is freely available and I have found a way to import it into OSMAND in a way that it shows up on my map. However, there is a problem with some of the data. I am looking for some help in getting one particular parcel of land to render in OSMAND.
The entire Crown Land database can be viewed and downloaded here: https://data.novascotia.ca/Lands-Forests-and-Wildlife/Crown-Land-Map/sqec-gjbw
The particular blob in question has the tag of 21729
Running the validator in JOSM reports that the 'way contains more that 2000 nodes and should be a multipolygon. From what I can see it has over 12000 nodes in the outer layer and it has what looks like 100 inner polygons. I am overwhelmed in my inexperience. Can anyone lend a hand?


By "the tag of 21729 " I assume you mean DNR_ID?

Edit: I’ve convinced JOSM to open a file containing just the feature with DNR_ID=21729 and I seem to have a multipolygon with the outer ring split into approx. 1500 nodes per section. What is your workflow to get the items into JOSM?

1 Like

I am a beginner at this so I just opened the entire file in JOSM. I had been looking at the file in JOSM, and the area in particular, and I’m thinking I’m just going to have to create my own multipolygon that covers the entire area. Then trace each lake as an inner polygon. I’ve seen discussions on how to handle the islands in the lakes, but they were from 2018 so I don’t know what the best way is yet.

My process to this point to get the file working in OSMAND has been:

  1. Download crown land data as geojson
  2. Load data into josm
  3. Remove tracks and data not required
  4. Select all
  5. Apply a present that will show the data as you want (landuse-farmyard)
  6. Save data as osm
  7. Open OsmAnd Map Creator
  8. Use file - Create OBF from OSM file
  9. Copy resulting OBF file into Android - data - net.osmand.plus - files
  10. Restart OSMAND

I was using landuse-farmyard because it shows up well against the standard map. I wish I could find a nice way to overlay it but I haven’t found one that is obvious and appropriate yet.

You should be able to split the way in JOSM. select two nodes and press ‘p’

I’m more wondering about what is causing the area not to render. I think it might be how the items are overlapping and nesting. I’m going to see about simplifying the data down since I don’t care about the individual property segments. I’m hoping to combine multiple properties into single, simpler maps. Might have to make a new layer and start that way.

Any suggestions on how tag the area in a way that stands out in OSMAND but isn’t crazy weird?

There is a good chance here that the lack of rendering is the result of overlapping and nesting of individual elements. The best thing to do is to do as you said, simplify the data, which will give you much simpler maps, start with a new layer as well.

I can’t see the geojson option on that site (only CSV?). I ended up downloading the whole thing as a shapefile form the first blue link in the description. JOSM opens this whole zip file with the Opendata plugin installed (although my computer struggles a bit).

When opened this way the parcel with DNR_ID=21729 appears as multiple areas: 3 multipolygons and 65 ways (mostly little islands in lakes). From that I don’t think there should be any need to create multipolygons as they are already in the downloaded data. The biggest multipolygon for 21729 appears to have the outer ring pre-divided into stretches of approx 1600 nodes.

As the multipolygons already exists it’s probably best to just re-use them somehow. I think the easiest way would be to search for a key shared by all the bits you want. That specifically DNR_ID would work if that’s all you need, but if you want other areas too then possibly FCode=151 or Symbol=1 (whatever they mean).

Looking at the OsmAnd map key I’d guess something like amenity=prison might be a good nonsense value to add as it renders as a series of bars and I would expect it to leave the underlying symbols fairly visible. Just avoid hunting in any of the actual prisons in the area as you might find yourself staying longer than you intend :-P. Military landuse also gets rendered by OsmAnd as a crosshatched area, but as militaries often do have large tracts of land there may be more chance of confusion.

If OsmAnd still can’t render this data due to it’s size and complexity then there is a Simplify way tool (SHIFT+Y) that you could try applying to the areas. This will remove smaller wiggles while keeping the general shape.

I would suggest you mark any osm files you make this way with the “discourage upload” flag to make it less likely that anything gets uploaded accidentally. If JOSM is in expert mode then this is available on the right click menu for that layer in the Layers panel.

Sorry, there are two websites (maybe more) that include the data. Here is where I can download the GeoJSON

Thanks for the ideas. I will also give the amenity=prison idea a try to see how it renders. I didn’t know about the OSMAND website you linked. It looks like the tag I used to use is part of the “Landuse Allotments Color” but I can’t remember what tag I used to use and I can’t seem to find that information from the old file. Not sure how to read the data from an osm/obf back to get the landuse= tag information.

“Landuse Allotments Color” is probably landuse=allotments. Not sure how common they are outside the UK.

I’m not looking to upload this map so I’m not worried if it is an accurate description, just that it shows up effectively in the OSMAND display. I use this for finding spots for hunting.

If I thought you were going to upload it I wouldn’t be suggesting good ways to mistag for the renderer. :wink:

That is an interesting article.
Related to that, how can I determine how features are currently tagged in an osm/obf file?
Also related to that, is there a tag that I should use/propose for tagging Crown Land? I’m assuming it would be a landuse type tag.
Is it possible to have two tags and then remove the mistag when the renderer catches up?

For an item that’s selectable the easiest way is normally to follow the link to the OSM feature it corresponds to.

Not that I’m aware of. The talk-ca mailing list or Canada specific section of this forum might know of one. If they have specific permissions associated with them then there might be a more general tag to use, but that would be a question for either tagging help or tagging general discussion.

That seems like it would probably be closely tied to an import though an those have their own rules.

Not in the main database. What you do locally is up to you.

I’m not sure how to do this. I’m talking about my local files. What tool would I use to look at this ‘link’?

I was assuming a version of OsmAnd running on a device there. If you have the OSM Editing plugin turned on and select an item you get a link to the original site. I don’t know how else to get this info from an obf file. .

If you have an osm file you can open it in JOSM and see what tags are assigned in the Tags/Memberships panel and look those tags up in the wiki.openstreetmap.org.

Also, there is this tool for .obf files:

.osm files, are just xml, so if you don’t have JOSM, you can open them in a text editor, although obviously the contents will not be displayed spatially.