hotosm / HDM-CartoCSS

CartoCSS project focused on the Humanitarian Data Model
Other
138 stars 41 forks source link

Avoid overlap of boundaries #134

Closed yohanboniface closed 9 years ago

yohanboniface commented 11 years ago

screenshot from 2013-07-21 22 36 33

To test:

SELECT DISTINCT ON (geom) ST_AsText( ST_MakeLine(sp,ep) ) as geom
FROM
  (SELECT
    ST_PointN(geom, generate_series(1, ST_NPoints(geom)-1)) as sp,
    ST_PointN(geom, generate_series(2, ST_NPoints(geom)  )) as ep
  FROM
    (SELECT (ST_Dump(ST_Boundary(geom))).geom
     FROM mypolygontable
     ) AS linestrings
  ) AS segments;

From http://support.mapbox.com/discussions/tilemill/885-draw-dashed-borders-of-polygons

yohanboniface commented 11 years ago

I've tried this request:

SELECT DISTINCT ON (way) ST_MakeLine(sp,ep) as way, admin_level FROM (SELECT ST_PointN(way, 
generate_series(1, ST_NPoints(way)-1)) as sp, ST_PointN(way, generate_series(2, ST_NPoints(way)  )) as ep, 
admin_level FROM (SELECT (ST_Dump(ST_Boundary(way))).geom as way, admin_level FROM 
planet_osm_polygon where boundary='administrative' AND admin_level IN ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10') AND 
boundary IS NOT NULL ORDER BY admin_level) AS linestrings ORDER BY admin_level) AS segments

but the result is too uneven, sounds like some pieces have not a strict overlap:

screenshot from 2013-07-26 18 23 16

skorasaurus commented 11 years ago

I haven't verified it, but I assume that this also causes the following at low zoom levels ? Look at the difference between Greenland and Canada/USA for example.

selection_001

yohanboniface commented 11 years ago

Yep!

yohanboniface commented 9 years ago

@pnorman any suggestion on this, by chance?

yohanboniface commented 9 years ago

OpenMapSurfer does is well, but I don't know how http://129.206.74.245/?zoom=11&lat=19.67518&lon=-72.30377&layers=B00000FFFF

matkoniecz commented 9 years ago

https://github.com/gravitystorm/openstreetmap-carto/pull/1107 is partially solving this for openstreetmap-carto

yohanboniface commented 9 years ago

Thanks to @math1985, I've been able to move forward on this! (Thanks also @mkoniecz for pointing me to the PR).

Here are some before/after (without terrain, as prod server doesn't have terrain worldwide): screenshot from 2014-11-02 16 42 10 screenshot from 2014-11-02 16 41 06 screenshot from 2014-11-02 16 40 37

And here are some screenshots with terrain: screenshot from 2014-11-02 16 43 51 screenshot from 2014-11-02 16 43 22 screenshot from 2014-11-02 16 43 01