Page 1 of 2

How to display townlands in WME

Posted: Wed Apr 25, 2018 2:48 pm
by cw1998
Hello,

This thread will outline how to view townland boundaries in WME using a script written by Timbones, which can be found here.
There are a number of options available, each with their benefits and tradeoffs:
  • Generalised boundaries (20m or 50m) - More performant, less accurate boundaries
  • Ungeneralised boundaries - Less performant due to large file size, but provides precise boundaries in WME.
Whichever you choose is up to you; the process for loading these into WME is exactly the same. As well as this, you can also load in all of Ireland in one file (which I do not recommend!) or you can load in a county or counties by loading in separate files. If you have a lower end device (such as a laptop), I recommend going with the generalised option, although it does require a little more work when cross-referencing with the OSI viewer. In the future, I plan to create “half county” ungeneralised files, which should do away with the performance problem on the ungeneralised files.

On my machine, I find that loading files over 10MB causes things to slow down, but of course, this varies between machines.

Downloads
You can find all the files you need at https://waze.cw1998.uk. This is just a directory view, so you need to right-click on a file and click “Save link as…” (or your favourite browser’s equivalent) to download the file.
You will also need to install Tim’s WME Geometries script.

Instructions
  1. Install Tim’s WME Geometries script and download the file(s) you need.
  2. Load up WME, and switch to the ‘Areas’ tab.
  3. At the bottom of the tab, you should see Tim’s script: Click browse, and select the geoJSON file you downloaded.
  4. The file should load in.
https://screenshotscdn.firefoxuserconte ... 3e22ee.png

Tips
If you are experiencing performance problems loading in larger counties, try disabling some layers. If you are only adding in roads, you won’t need the places layers for example. Also, try the generalised files if you are finding the ungeneralised files unusable.
Don’t load in more than one county at a time. There is no need unless you are working along a county border. Click the ‘Clear all’ button to remove the current county if you are changing to a different one (or reload WME).

Screenshots
Some before and after screenshots can be viewed in the spoiler (click the image to view full size).
In these screenshots I use the ungeneralised Co. Clare boundaries. Performance is acceptable, but it is noticeably slow when zooming in and out. Panning around wasn't a huge issue.

Re: [Tutorial] Displaying Townlands in WME

Posted: Wed Apr 25, 2018 5:35 pm
by cw1998
waze.cw1998.uk has now been updated to include all the datasets that you should need to get started. I'll look into making half county sized files, but unless a couple of editors would like it sooner, I'll not get around to doing this for a while.

Re: How to display townlands in WME

Posted: Fri Apr 27, 2018 10:11 am
by cw1998
davidg666 wrote: Even the ungeneralised version works (I was trying Co Clare, for which this is about 41MB), but it's a little slow.
There are some attributes that are not necessary for the geometries script to load the file, so these could be removed for some size savings. I will regenerate these today and replace the files on waze.cw1998.uk.
For this, I need a second opinion. The townlands seem to include the Irish name as well as the English. Is there any case where the Irish name is needed? If not, these can be removed as well. I suppose the county attribute can also be removed for further savings.
davidg666 wrote: The thread for Tim's script does say "Labels will be shown for files with less than 50 features". I guess each townland is a feature, and even the smallest counties will probably have way more than 50 features, and the townland name is in an attribute called "TD_ENGLISH", so we'd need to tweak Tim's script to read that attribute. In other words: the townland names are in there, but it'd take a bit of hacking to show them and it'd also slow things down.
I suspect these aren't showing because the datasets put all of the properties into a single JSON object, rather than just putting them as separate string attributes in the root object (which is what Tim's script seems to be looking for). I'll tweak my Python script to remove this nested object, and put the name as an attribute at the top level. That should make sure labels get displayed.
Being uneducated in the structure of GeoJSON, the datasets are correct. Ignore this!
davidg666 wrote: So we need to look up townland names somewhere else. Do you keep another map (the OSI one?) open in another window to get the townland names?
Yes. I have a cheap secondary monitor that I got from an old computer which I open the OSI map on, but if we could get them showing in WME, that would be far better! I'll keep this thread updated with progress on that. Although, it is useful having the OSI map open to see forest names/lough names etc.

Re: How to display townlands in WME

Posted: Fri Apr 27, 2018 11:49 am
by cw1998
davidg666 wrote: It's probably worth stripping as much unnecessary stuff as possible in the interest of reduced file size and load on WME.
....
Certainly, don't include the Irish name for any counties that don't contain a Gaeltacht area, but for those that do (Donegal, Mayo, Galway, Kerry, Cork, Waterford and Meath), it's probably better to leave it in (although the Gaeltacht areas in the last two counties in that list are tiny).
Thank you! I'll keep them in Gaeltacht areas.
davidg666 wrote: If you can get the names to show up, that'd be great - it'd save having another map elsewhere for reference.
So it turned out that this was a little more complicated than what I said. (I'm not familiar with OpenLayers, and I'm certainly no JavaScript expert, but I've managed this. It'll probably need tweaking, and then an experts touch to fix the code (because it's very hacked together at the moment!)
WME is awfully slow when you're zoomed out with those labels showing, but when zoomed in sufficiently (I'd say level 3 or higher), it's actually not as bad as I thought it would be. Certainly as usable as before.

Re: How to display townlands in WME

Posted: Fri Apr 27, 2018 12:16 pm
by cw1998
If he has his code on GitHub or somewhere like that, we could fork it and maintain a version specifically for townland boundaries. For a script used globally, he may not want to add a bunch of code specific to our use! :) (At least not on the main version)

Re: How to display townlands in WME

Posted: Fri May 11, 2018 12:44 pm
by cw1998
I'll ping Tim in the Ireland editors hangout to have a look at this.

Re: How to display townlands in WME

Posted: Thu Jul 26, 2018 1:25 pm
by cw1998
As some of you may know, I'm working on a small website to act as a portal for downloading townland geometry datasets. This can be previewed at https://waze.cw1998.uk
All feedback is welcomed so I can improve it. It's being developed with the goal of being really easy to navigate, but let me know if this isn't the case.

I'm also working with Timbones to get direct links to the geometry files showing in his geometries script, which will hopefully also be of benefit to those using it!

Re: How to display townlands in WME

Posted: Fri Apr 27, 2018 6:12 am
by davidg666
cw1998 wrote:This thread will outline how to view townland boundaries in WME using a script written by Timbones
I just tried it and it was easier than I expected - it just works! Thanks for generating the per-county files. Even the ungeneralised version works (I was trying Co Clare, for which this is about 41MB), but it's a little slow. The 20m version is probably enough for townland boundaries for naming roads, because they typically follow rivers/streams and field boundaries. It's not as though we need to be super accurate for this anyway.

The thread for Tim's script does say "Labels will be shown for files with less than 50 features". I guess each townland is a feature, and even the smallest counties will probably have way more than 50 features, and the townland name is in an attribute called "TD_ENGLISH", so we'd need to tweak Tim's script to read that attribute. In other words: the townland names are in there, but it'd take a bit of hacking to show them and it'd also slow things down.

So we need to look up townland names somewhere else. Do you keep another map (the OSI one?) open in another window to get the townland names?

++David

Re: How to display townlands in WME

Posted: Fri Apr 27, 2018 10:24 am
by davidg666
cw1998 wrote:There are some attributes that are not necessary for the geometries script to load the file, so these could be removed for some size savings. I will regenerate these today and replace the files on waze.cw1998.uk.
It's probably worth stripping as much unnecessary stuff as possible in the interest of reduced file size and load on WME.
cw1998 wrote:For this, I need a second opinion. The townlands seem to include the Irish name as well as the English. Is there any case where the Irish name is needed? If not, these can be removed as well. I suppose the county attribute can also be removed for further savings.
In the Clare generalised file, the TD_GAEILGE attribute seems to be empty for the (small number of) townlands I checked.

That said, in most cases, we just need the English name. You could probably argue that the Irish name (if it's there) is needed in Gaeltacht areas only, since in those areas only the Irish name is shown on road signs, and (as is usual Waze practice) that's what we should be showing on the map (never mind that TTS mangles Irish names, but that's a separate issue :) )

Certainly, don't include the Irish name for any counties that don't contain a Gaeltacht area, but for those that do (Donegal, Mayo, Galway, Kerry, Cork, Waterford and Meath), it's probably better to leave it in (although the Gaeltacht areas in the last two counties in that list are tiny).
cw1998 wrote:
davidg666 wrote:The thread for Tim's script does say "Labels will be shown for files with less than 50 features". I guess each townland is a feature, and even the smallest counties will probably have way more than 50 features, and the townland name is in an attribute called "TD_ENGLISH", so we'd need to tweak Tim's script to read that attribute.
I suspect these aren't showing because the datasets put all of the properties into a single JSON object, rather than just putting them as separate string attributes in the root object (which is what Tim's script seems to be looking for). I'll tweak my Python script to remove this nested object, and put the name as an attribute at the top level. That should make sure labels get displayed.
If you can get the names to show up, that'd be great - it'd save having another map elsewhere for reference.
cw1998 wrote:Although, it is useful having the OSI map open to see forest names/lough names etc.
Good point. I usually use the Eircode map for that kind of thing, but I think they use the OSI map indirectly, so it's the same information.

++David

Re: How to display townlands in WME

Posted: Fri Apr 27, 2018 11:58 am
by davidg666
cw1998 wrote:So it turned out that this was a little more complicated than what I said. (I'm not familiar with OpenLayers, and I'm certainly no JavaScript expert, but I've managed this. It'll probably need tweaking, and then an experts touch to fix the code (because it's very hacked together at the moment!)
WME is awfully slow when you're zoomed out with those labels showing, but when zoomed in sufficiently (I'd say level 3 or higher), it's actually not as bad as I thought it would be. Certainly as usable as before.
Nice; thanks. I wonder how open Tim would be to tweaking his script a little and if it would be easy to automatically decide to show labels based on only being zoomed in below a certain level - and maybe even the boundaries too, because townland boundaries aren't that much use when zoomed out a long way.

++David