[mapserver-users] Trouble with OpenStreetMap data in MapServer

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Fri Nov 19 00:18:14 PST 2021


Hi,

I agree with Jörg. The polygon that is used in the query is about 19000 km wide. Run shp2img with for smaller bbox with -e switch https://mapserver.org/utilities/shp2img.html. However, there may be something to improve in the mapfile and layer maxscaledenom because it does not make sense to render buildings at that scale.

-Jukka Rahkonen-


-----Alkuperäinen viesti-----
Lähettäjä: MapServer-users <mapserver-users-bounces at lists.osgeo.org> Puolesta Jörg Thomsen (WhereGroup)
Lähetetty: perjantai 19. marraskuuta 2021 10.01
Vastaanottaja: mapserver-users at lists.osgeo.org
Aihe: Re: [mapserver-users] Trouble with OpenStreetMap data in MapServer

Hello Carl,

what about the error-message
> out of memory for query result ?

I guess the buildings of the whole USA need a lot of space (talking about your database and memory not the real world ;) ) I tink theres nothing wrong with your MapServer-Configuration, loks more like a message from PostGIS. Have you looked into the pg-log? you might check the memory-usage in taskmannager during the request.
Have you tried the sql-query directly in pg (psql, pg-admin)? You also coud try to test a smaller bbox.

Jörg

Am 18.11.21 um 23:03 schrieb Carl Godkin:
> Hi,
> 
> I am following the instructions for using OpenStreetMap data in 
> MapServer here:
> 
> https://github.com/mapserver/mapserver/wiki/RenderingOsmDataWindows
> <https://github.com/mapserver/mapserver/wiki/RenderingOsmDataWindows>
> 
> I've been almost all the way through the steps getting everything to 
> work until I reached the step "Testing with shp2img" which says to run this:
> 
>           shp2img -m osm-google.map -o output.png -map_debug 3
> 
> It fails, like this:
> 
> msDrawMap(): rendering using outputformat named png (AGG/PNG).
> msDrawMap(): WMS/WFS set-up and query, 0.000s
> msPostGISLayerWhichShapes(): Error (out of memory for query result
> ) executing query: SELECT "name"::text,ST_AsBinary(("geometry"),'NDR')
> as geom,"osm_id"::text FROM (select geometry,osm_id, name as name from
> osm_new_buildings) as foo WHERE "geometry" &&
> ST_GeomFromText('POLYGON((-20037508.3427892
> -3113412.49464005,-20037508.3427892 15861721.9613068,-1062373.88684241
> 15861721.9613068,-1062373.88684241 -3113412.49464005,-20037508.3427892
> -3113412.49464005))',3857)
> msPostGISLayerWhichShapes(): Query error. Error executing query. Check 
> server logs
> msDrawMap(): Image handling error. Failed to draw layer named 'buildings3'.
> msDrawMap(): Image handling error. Failed to draw layer named 
> 'buildings3'. <br>
> msPostGISLayerWhichShapes(): Query error. Error executing query. Check 
> server logs <br>
> 
> --
> I don't see anything in the MapServer logs and don't really understand 
> what is wrong.
> 
> I tried specifying individual layers with "-l <layer_name>" to the 
> shp2img command and most of them work, which I find encouraging.
> Specifying layer "buildings3" which failed above still fails when 
> specified individually.
> 
> I'm using Postgres 14, MS4W 4.0.5, MapServer 7.6.4 on Windows 10.
> 
> Inspecting the "osm-google.map" file doesn't show me anything very 
> strange but I'm no expert.  I pasted the LAYER section for "buildings3"
> at the bottom in case someone spots anything.
> (The process used to generate this file is ... well ... amazing!)
> 
> I am using data from geofabric.de <http://geofabric.de> for the USA 
> (http://download.geofabrik.de/north-america/us-latest.osm.pbf
> <http://download.geofabrik.de/north-america/us-latest.osm.pbf>)
> downloaded two days ago.
> 
> Does anyone have any suggestions on getting to the bottom of this?  I 
> feel like I'm tantalizingly close!
> 
> Thanks a lot,
> 
> carl
> 
> ---
> LAYER
>     STATUS ON
>     PROJECTION
>         "init=epsg:3857"
>     END
>     GROUP "default"
>     NAME "buildings3"
>     TYPE POLYGON
>     CONNECTIONTYPE postgis
>     CONNECTION "host=localhost dbname=osm user=postgres 
> password=postgres port=5432"
>     DATA "geometry from (select geometry,osm_id, name as name from
> osm_new_buildings) as foo using unique osm_id using srid=3857"
>     LABELITEM "name"
>     PROCESSING "LABEL_NO_CLIP=ON"
>     PROCESSING "CLOSE_CONNECTION=DEFER"
>     MAXSCALEDENOM 83202051
>     MINSCALEDENOM 41601025
>     CLASS
>       STYLE
>          COLOR "#bbbbbb"
>          OPACITY 50
>       END
>       STYLE
>          OUTLINECOLOR "#333333"
>          WIDTH 0
>       END
>    END
> END
> 
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 


--
Viele Grüße,
Jörg Thomsen

---------------------------------------------
Schon gewusst?

In unserem Blog geben wir Tipps & Tricks zu  Open-Source-GIS-Software und berichten aus unserem Experten-Alltag:
https://wheregroup.com/blog/
---------------------------------------------

Jörg Thomsen
WhereGroup GmbH
Bundesallee 23
10717 Berlin
Germany

Tel: +49 (0)30 / 5130 278 74
Fax: +49 (0)30 / 5130 278 11	

joerg.thomsen at wheregroup.com
www.wheregroup.com

Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885

-------------------------------
Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com _______________________________________________
MapServer-users mailing list
MapServer-users at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the MapServer-users mailing list