Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balaton (Plattensee) drawing error #18

Closed
tds4u opened this issue Feb 3, 2014 · 6 comments
Closed

Balaton (Plattensee) drawing error #18

tds4u opened this issue Feb 3, 2014 · 6 comments

Comments

@tds4u
Copy link

tds4u commented Feb 3, 2014

Hello,
all water areas, like Bodensee or Müritz, are drawn. But the Balaton (german Plattensee) isn't. In JOSM it is drawn, in Mapnik too. But MapServer itself don't. Is there a problem in converting polygons or lines (tested with both - no success)?

Is there a problem in the polygon or not? Please help :-)

Map file section:

LAYER
        TYPE POLYGON
        STATUS ON
        METADATA
                "wms_srs"         "OSM_WMS_SRS"
                "wms_title"       "Water"
                "wms_group_title" "Water"
        END
        PROJECTION
                "init=epsg:OSM_SRID"
        END
        NAME layername(waterarea,_layer_suffix)
        GROUP "water"
        CONNECTIONTYPE POSTGIS
        CONNECTION "OSM_DB_CONNECTION"
        DATA _waterarea_data
        MAXSCALEDENOM _maxscale
        MINSCALEDENOM _minscale
        PROCESSING "CLOSE_CONNECTION=DEFER"
        LABELITEM "name"
        CLASSITEM "type"

        CLASS
                EXPRESSION "riverbank"
                STYLE
                        COLOR _waterarea_clr
                        OUTLINECOLOR _waterarea_ol_clr
                        OUTLINEWIDTH _waterarea_ol_width
                END
        END
        CLASS
                STYLE
                        COLOR _waterarea_clr
                        OUTLINECOLOR _waterarea_ol_clr
                        OUTLINEWIDTH _waterarea_ol_width
                END
                LABEL
                        TYPE TRUETYPE
                        PARTIALS FALSE
                        FONT _waterarea_font
                        MINDISTANCE 200
                        SIZE _waterarea_lbl_size
                        COLOR _waterarea_lbl_clr
                        ENCODING "utf-8"
                        OUTLINECOLOR _waterarea_lbl_ol_clr
                        OUTLINEWIDTH _waterarea_lbl_ol_width
                        WRAP ' '
                        MAXLENGTH 5
                        ALIGN CENTER
                        MINFEATURESIZE AUTO
                        PRIORITY _label_priority_landusage
                END
        END
END

Custom generate_style.py from Mapserver basemaps:

##### water #####
'display_waterarea': {
    0:0,
    6:1
},
'waterarea_data': {
    0: '"geometry from (select geometry,osm_id ,OSM_NAME_COLUMN as name,type from OSM_PREFIX_waterareas_gen0) as foo using unique osm_id using srid=OSM_SRID"',
    9: '"geometry from (select geometry,osm_id ,OSM_NAME_COLUMN as name,type from OSM_PREFIX_waterareas_gen1) as foo using unique osm_id using srid=OSM_SRID"',
    12: '"geometry from (select geometry,osm_id ,OSM_NAME_COLUMN as name,type from OSM_PREFIX_waterareas) as foo using unique osm_id using srid=OSM_SRID"'
},
'display_waterarea_lbl' : {0:0, 10:1},
'waterarea_clr': '"#B3D1FF"',
'waterarea_ol_clr': '"#B3D1FF"',
'waterarea_ol_width': 0,
'waterarea_font': "sc",
'waterarea_lbl_size': 10,
'waterarea_lbl_clr': '"#6B94B0"',
'waterarea_lbl_ol_clr': "255 255 255",
'waterarea_lbl_ol_width': 2,

Kind regards

@olt
Copy link
Member

olt commented Feb 3, 2014

Is the geometry missing in all waterareas tables or only the _genX.
Do you have an OSM ID of the geometry?

@tds4u
Copy link
Author

tds4u commented Feb 3, 2014

Okay, here we are :-)

SELECT "id","osm_id","name","type","area","geometry" FROM "public"."osm_waterareas" WHERE "name" LIKE 'Plattensee'

310438 => 26735206
3995998 => 168361423

SELECT "osm_id","geometry","name","type","area" FROM "public"."osm_waterareas_gen1" WHERE "name" LIKE 'Plattensee'

26735206
168361423

Data in gen0 not found (too small).

@olt
Copy link
Member

olt commented Feb 4, 2014

On 03.02.2014, at 13:05, tds4u wrote:

Okay, here we are :-)

SELECT "id","osm_id","name","type","area","geometry" FROM "public"."osm_waterareas" WHERE "name" LIKE 'Plattensee'

310438 => 26735206
3995998 => 168361423

And these are the geometries that are not rendered?
You can check the IDs on OSM: http://www.openstreetmap.org/way/12345 or http://www.openstreetmap.org/relation/12345

Can you check if the geometries make sense (ST_IsValid, ST_IsSimple, ST_Area)?

@tds4u
Copy link
Author

tds4u commented Feb 4, 2014

Ah, sorry, searched wrong name (Plattensee instead of Balaton). Right
ist http://www.openstreetmap.org/relation/1638031 = reservoir. But still
not displayed.

=> Should be correct

SELECT "id","osm_id","name","type","area","geometry",
ST_AsText(geometry) FROM "public"."osm_waterareas" WHERE "name" = 'Balaton'

=> Polygon from WMS BoundingBox => no visible Balaton as name

SELECT "osm_id","name","type","area","geometry" FROM
"public"."osm_waterareas_gen1"
WHERE ST_Intersects(ST_GeomFromText('POLYGON((
1956787.9268898 5948635.2920548,
1956787.9268898 5909499.5335728,
1995923.6853718 5909499.5335728,
1956787.9268898 5909499.5335728,
1956787.9268898 5948635.2920548
))', '3857'), geometry)
ORDER BY name

Is there a mistake or why no correct results returned? Small basins
inside are there but not the big one.

MfG M. Martin

Am 04.02.2014 10:27, schrieb Oliver Tonnhofer:

On 03.02.2014, at 13:05, tds4u wrote:

Okay, here we are :-)

SELECT "id","osm_id","name","type","area","geometry" FROM
"public"."osm_waterareas" WHERE "name" LIKE 'Plattensee'

310438 => 26735206
3995998 => 168361423

And these are the geometries that are not rendered?
You can check the IDs on OSM: http://www.openstreetmap.org/way/12345
or http://www.openstreetmap.org/relation/12345

Can you check if the geometries make sense (ST_IsValid, ST_IsSimple,
ST_Area)?


Reply to this email directly or view it on GitHub
#18 (comment).

@olt
Copy link
Member

olt commented Feb 4, 2014

Ok, the relation is broken. See:
http://analyser.openstreetmap.fr/cgi-bin/index.py?relation=1638031
The end node 2607089288 of way http://www.openstreetmap.org/way/232147389 is not connected.

Not sure what magic osm2pgsql does do get a geometry out of that.

olt added a commit that referenced this issue Feb 5, 2014
multipolygons that are not closed (topological) can be handled by
using GEOS LineMerge function. It's expected to be slower than the
node ID based merger. Maybe it's feasible to use LineMerge as a
fallback.
@tds4u
Copy link
Author

tds4u commented Mar 11, 2014

Have to say that the same problem is on other geometries, too. Like natural polygons (forrest, etc.). Fix should be important.

@olt olt closed this as completed Oct 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants