[mapserver-users] Trouble with OpenStreetMap data in MapServer

Carl Godkin cgodkin at gmail.com
Fri Nov 19 11:06:50 PST 2021


Hi Jörg, aimdev, and Jukka,

Thanks for all of the help!

I turned "buildings3" off with LAYER/STATUS OFF and found that rerunning
the shp2img now works fine.

But then trying the very next step, which is using this URL in the browser:

       http://localhost/cgi-bin/mapserv.exe?
         mode=browse&
         template=openlayers&
         layers=all&
         map=C:/ms4w/apps/osm/basemaps/osm-google.map

fails with the same old error because of my old friend "buildings3."

So I changed these

    MINSCALEDENOM 99999999999
    MAXSCALEDENOM 99999999999

and now that works.   (I guess layers=all means ALL LAYERS even if STATUS
is OFF.)

I have now made it all the way through the instructions in Jeff's tutorial
and am ready to strike out on my own.

Thanks very much for your help,

carl


On Thu, Nov 18, 2021 at 2:03 PM Carl Godkin <cgodkin at gmail.com> wrote:

> Hi,
>
> I am following the instructions for using OpenStreetMap data in MapServer
> here:
>
> 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 for the USA (
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20211119/518d9cce/attachment.html>


More information about the MapServer-users mailing list