File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
tiles/src/main/java/com/protomaps/basemap/layers Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 99import com .protomaps .basemap .feature .FeatureId ;
1010import com .protomaps .basemap .names .OsmNames ;
1111import java .util .List ;
12+ import org .locationtech .jts .geom .Point ;
1213
1314public class Earth implements ForwardingProfile .LayerPostProcesser {
1415 @ Override
@@ -29,6 +30,23 @@ public void processNe(SourceFeature sf, FeatureCollector features) {
2930 } else if (sourceLayer .equals ("ne_10m_land" )) {
3031 features .polygon (this .name ()).setZoomRange (5 , 5 ).setBufferPixels (8 ).setAttr ("kind" , "earth" );
3132 }
33+ // Daylight landcover uses ESA WorldCover which only goes to a latitude of roughly 80 deg S.
34+ // Parts of Antarctica therefore get no landcover = glacier from Daylight.
35+ // To fix this, we add glaciated areas from Natural Earth in Antarctica.
36+ if (sourceLayer .equals ("ne_10m_glaciated_areas" )) {
37+ try {
38+ Point centroid = (Point ) sf .centroid ();
39+ // Web Mercator Y = 0.7 is roughly 60 deg South, i.e., Antarctica.
40+ if (centroid .getY () > 0.7 ) {
41+ features .polygon ("landcover" )
42+ .setAttr ("kind" , "glacier" )
43+ .setZoomRange (0 , 7 )
44+ .setMinPixelSize (0.0 );
45+ }
46+ } catch (GeometryException e ) {
47+ System .out .println ("Error: " + e );
48+ }
49+ }
3250 }
3351
3452 public void processOsm (SourceFeature sf , FeatureCollector features ) {
You can’t perform that action at this time.
0 commit comments