|
I'm attempting to render the shapefile found here using StreamingRenderer: http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-populated-places/
I'm rendering it using a PointSymbolizer for the location and a TextSymbolizer for the label. It is being rendered on top of the countries shapefile from the same site. However, the cities do not show up when the map is panned enough to cause wraparound. I have added the ADVANCED_PROJECTION_HANDLING_KEY and CONTINUOUS_MAP_WRAPPING stuff to the StreamingRenderer hints, and countries wrap around correctly.
Another oddity of this problem is that if you pan the map such that the rendered point is only partially off one side of the screen, the point will correctly appear on the other side as well.
StreamingRenderer uses a ScreenMap to render the cities. Tracing the code, ShapefileFeatureReader puts the city points through the ScreenMap's get(Envelope) method at line 221. ScreenMap's line 154 transforms the point, placing its X in the far negative range when viewing a map wrapped to the right. get(int, int) then returns true because of the negative X.
Because the get(int, int) function returns the same value for both a set pixel and out-of-bounds, ShapefileFeatureReader treats the return value as an indication to skip the geometry.
The country rendering does not use ScreenMap, so it skirts this issue. Disabling use of the ScreenMap by setting the generalization distance to 0 works around the problem for cities, but also causes a large hit in rendering time.
I'm not sure how this problem should be addressed, so unfortunately I don't have a fix.
|