omniscale / imposm3

Imposm imports OpenStreetMap data into PostGIS
http://imposm.org/docs/imposm3/latest/
Apache License 2.0
726 stars 159 forks source link

Balaton (Plattensee) drawing error #18

Closed tds4u closed 10 years ago

tds4u commented 10 years ago

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 commented 10 years ago

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

tds4u commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 https://github.com/omniscale/imposm3/issues/18#issuecomment-34042727.

olt commented 10 years ago

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.

tds4u commented 10 years ago

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