ncsco / pinemap-dss-help

Issue tracker for PINEMAP DSS
0 stars 0 forks source link

Create custom Roads & Cities layers #72

Closed daviswx closed 8 years ago

daviswx commented 8 years ago

(Branching this issue off from #31)

Create new road and cities layers with custom styling:

This can be done using the GeoServer SLD functionality.

hadinon commented 8 years ago

Suggestions from a training with women landowners in Arkansas (sort of related to this issue):

daviswx commented 8 years ago

Rebecca does have a rivers & lakes layer in the Water Portal, but it's not super detailed. It shows about a dozen of the largest lakes in NC, and they're fairly low-res. And the rivers aren't complete; for instance, it doesn't show the full path of the Cape Fear leaving Wilmington or any part of the Yadkin through the western Piedmont.

image

I will search around for a better layer that we might be able to use instead.

daviswx commented 8 years ago

I found higher-resolution rivers/streams and lakes shapefiles from NWS that I think would be more useful to have in the DSS. Compare this map from ArcGIS with the map above using the Natural Earth layers.

image

With Rebecca's help, I have added these two layers to GeoServer and I'm working on getting them in the DSS, although I need to edit the styles first so that everything looks uniform.

daviswx commented 8 years ago

Those lakes and rivers layers are now in the DSS, available under the Show Layer Options menu.

I'm still trying to figure out how to add labels over the lines/polygons. I've copied some code from the GeoServer SLD link in the first post in this thread, but it doesn't seem to work. Once I get that figured out, I can add labels to the roads, cities, lakes, and rivers.

daviswx commented 8 years ago

I just managed to get the labeling working for the lakes and rivers. As you zoom in on the map, those labels will appear.

Customizing the roads and cities will take some more work, but it should be possible given that the labels are working for other layers.

daviswx commented 8 years ago

The updated roads and cities layer is now shown in the DSS. I followed the suggestions about colors and zoom levels from the beta testers in the first post of this thread, and I made sure the roads (interstates and US highways) have the shields visible once you zoom in to the state/multi-state level.

Note that the cities layer we're using does not include every small town (sorry, JoCo). But between the bigger cities, the roads, and the county lines, it should be easy enough to figure out where places are at.

daviswx commented 8 years ago

Also, note that pretty much any of the styling with these layers -- sizes, colors, outlines for the text, points, and lines, plus which zoom levels different features appear at -- can be tweaked if needed. Now that I've figured out what I'm doing with the GeoServer SLD, I can see how flexible it is for styling these layers.

hadinon commented 8 years ago

I just played around with this functionality and it is really slick! I may have found a bug?! When I zoom in close, the city marker/dot is still on the map but the name label disappears. Would it be possible to either add the name label back on or if that's too cluttered, remove the marker/dot? See screenshots below.

Zoomed out example: image

Zoomed in example: image

daviswx commented 8 years ago

I noticed that as well. It's happening because GeoServer can hide labels based on things like the proximity to other features -- it calls this "conflict resolution".

I just turned that off for close zoom levels, and it seems to be showing the cities more often at the closer zooms, but it's not 100% effective. For instance, the Durham label doesn't always show up as I zoom in. Also, it leads to some overlap in situations like this:

image

I don't know if there is anyway to apply the same conflict resolution metric to the dots as it uses for the labels; I figured it would do that anyway, but apparently it doesn't.

hadinon commented 8 years ago

Ahhh OK gotcha. Hmmm well I guess I prefer to have consistency so maybe keep it with the "conflict resolution" turned on unless you have strong opinions about keeping it off?

daviswx commented 8 years ago

So just to be clear, do you prefer the version where more labels show up but occasionally overlap, as shown above (conflict resolution = off)?

Unfortunately, whether it's turned on or off, some labels still won't appear, like Raleigh and Durham in the map above. I'm not exactly sure why since turning off conflict resolution is supposed to force them to show up no matter what. I tried adding a few other settings but none of them seemed to work any better to force labels to appear.

hadinon commented 8 years ago

I guess I'm fine either way. I'd say go with whichever option you prefer!

daviswx commented 8 years ago

I think I finally have a good solution. I found a GeoServer option that allows it to displace a label so it's not forced to be centered above the point. Instead, it can put the labels off to the side of the point, beneath it, etc. so it fits without overlapping other labels. This means that labels should show up more often especially as you zoom in.

Here's the same example as above with the new labeling:

image