Re: [mapserver-users] Trouble with OpenStreetMap data in MapServer

2021-11-19 Thread Carl Godkin
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 999
MAXSCALEDENOM 999

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  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'. 
> msPostGISLayerWhichShapes(): Query error. Error executing query. Check
> server logs 
>
> --
> I don't see anything in the MapServer logs and don't really understand
> what is wrong.
>
> I tried specifying individual layers with "-l " 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 "#bb"
>  OPACITY 50
>   END
>   STYLE
>  OUTLINECOLOR "#33"
>  WIDTH 0
>   END
>END
> END
>
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Trouble with OpenStreetMap data in MapServer

2021-11-19 Thread Rahkonen Jukka (MML)
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  Puolesta 
Jörg Thomsen (WhereGroup)
Lähetetty: perjantai 19. marraskuuta 2021 10.01
Vastaanottaja: mapserver-users@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'. 
> msPostGISLayerWhichShapes(): Query error. Error executing query. Check 
> server logs 
> 
> --
> I don't see anything in the MapServer logs and don't really understand 
> what is wrong.
> 
> I tried specifying individual layers with "-l " 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 "#bb"
>          OPACITY 50
>       END
>       STYLE
>          OUTLINECOLOR "#33"
>          WIDTH 0
>       END
>    END
> END
> 
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org

Re: [mapserver-users] Trouble with OpenStreetMap data in MapServer

2021-11-19 Thread WhereGroup
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
> 
> 
> 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'. 
> msPostGISLayerWhichShapes(): Query error. Error executing query. Check
> server logs 
> 
> --
> I don't see anything in the MapServer logs and don't really understand
> what is wrong.
> 
> I tried specifying individual layers with "-l " 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 "#bb"
>          OPACITY 50
>       END
>       STYLE
>          OUTLINECOLOR "#33"
>          WIDTH 0
>       END
>    END
> END
> 
> ___
> MapServer-users mailing list
> MapServer-users@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.thom...@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@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users