From lars.fricke at skendata.de Fri Apr 1 04:53:58 2022 From: lars.fricke at skendata.de (Lars Fricke) Date: Fri, 1 Apr 2022 13:53:58 +0200 Subject: [mapserver-users] mapserver OGR does not forward BBOX at all In-Reply-To: <5cbd238f0a5f42d1a7df31b65ade8423@maanmittauslaitos.fi> References: <5cbd238f0a5f42d1a7df31b65ade8423@maanmittauslaitos.fi> Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_0x667E0B7B73E250FB.asc Type: application/pgp-keys Size: 2460 bytes Desc: OpenPGP public key URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature Type: application/pgp-signature Size: 665 bytes Desc: OpenPGP digital signature URL: From lars.fricke at skendata.de Fri Apr 1 04:54:07 2022 From: lars.fricke at skendata.de (Lars Fricke) Date: Fri, 1 Apr 2022 13:54:07 +0200 Subject: [mapserver-users] mapserver OGR does not forward BBOX at all In-Reply-To: <5cbd238f0a5f42d1a7df31b65ade8423@maanmittauslaitos.fi> References: <5cbd238f0a5f42d1a7df31b65ade8423@maanmittauslaitos.fi> Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_0x667E0B7B73E250FB.asc Type: application/pgp-keys Size: 2460 bytes Desc: OpenPGP public key URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature Type: application/pgp-signature Size: 665 bytes Desc: OpenPGP digital signature URL: From lucadeluge at gmail.com Fri Apr 1 05:22:07 2022 From: lucadeluge at gmail.com (Luca Delucchi) Date: Fri, 1 Apr 2022 14:22:07 +0200 Subject: [mapserver-users] Floating point exception Message-ID: Hi all, I'm getting "Floating point exception" error running shp2img, also running with the debug option I don't get any other information. The mapfile read data from PostGIS database, and If I use the same mapfile with different database with the same tables I don't get this error, so I think the problem is in the data but I don't know where/what investigate thanks in advance -- ciao Luca www.lucadelu.org From jukka.rahkonen at maanmittauslaitos.fi Fri Apr 1 05:32:47 2022 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Fri, 1 Apr 2022 12:32:47 +0000 Subject: [mapserver-users] mapserver OGR does not forward BBOX at all Message-ID: Hi, (Clipped out most of the thread because the max size of message body was exceeded). That server does answer to GetCapabilities and DescribeFeatureType with WFS 1.0.0 but not to GetFeature. It gives an error about wrong outputformat even that it not mandatory to the standard, and it does not accept GML2 even GetCapabilities is listing it as a supported format. So yes, the service is broken with WFS 1.0.0. I suggested to try WFS connection and WFS 1.0.0 version as a comparison to OGR connection and WFS 1.1.0 but it is best to forget that test now. I don?t know what to suggest next. Myself I guess I would install Geoserver into localhost with the standard demo data and make a Mapserver layer from the topp:states feature type and see how it behaves. I do know that I have used Geoserver WFS as input for Mapserver WMS and it worked well but that was a long time ago and I believe I used the WFS connectiontype. -Jukka Rahkonen- L?hett?j?: Lars Fricke > L?hetetty: perjantai 1. huhtikuuta 2022 14.54 Vastaanottaja: Rahkonen Jukka (MML) >; mapserver-users at lists.osgeo.org Aihe: Re: [mapserver-users] mapserver OGR does not forward BBOX at all Hi, I just checked on using that server with WFS 1.0.0 but it is broken. Not even QGIS can open it, neither here nor in the browser any geometry is provided. So it looks as mapserver can not work with these? Thanks again -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmckenna at gatewaygeomatics.com Fri Apr 1 05:38:55 2022 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Fri, 1 Apr 2022 09:38:55 -0300 Subject: [mapserver-users] Floating point exception In-Reply-To: References: Message-ID: <844d9201-7d21-057b-806d-3b0a15f2ba68@gatewaygeomatics.com> Ciao Luca, I had earlier documented by usual PostGIS debugging steps at https://mapserver.org/optimization/vector.html#debugging-speed-issues-with-postgis Also, instead of the "-map_debug 3" option with shp2img, try "-all_debug 5" (use "3" if you just want to show the draw speed times) The goal would be to output the exact query that MapServer is trying to execute against your database, and then try running that query at the psql commandline. And, if all else fails, be sure to retry all of this with a build of today's MapServer "main" branch, and try with map2img. -jeff -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ On 2022-04-01 9:22 a.m., Luca Delucchi wrote: > Hi all, > > I'm getting "Floating point exception" error running shp2img, also > running with the debug option I don't get any other information. > The mapfile read data from PostGIS database, and If I use the same > mapfile with different database with the same tables I don't get this > error, so I think the problem is in the data but I don't know > where/what investigate > > thanks in advance > From sethg at geographika.co.uk Fri Apr 1 07:02:31 2022 From: sethg at geographika.co.uk (Seth G) Date: Fri, 01 Apr 2022 16:02:31 +0200 Subject: [mapserver-users] Securing MapServer Deployments Message-ID: <5f392dbf-541b-4df3-bfd8-1bbbefc21969@www.fastmail.com> Hi all, I've written a blog post on Securing MapServer Deployments at https://geographika.net/posts/securing_mapserver.html which also includes details on the new CONFIG file available in MapServer 8.0 If anyone has any other tips or best practices around security, please send them on to the list, Seth -- web:https://geographika.net twitter: @geographika From lucadeluge at gmail.com Sun Apr 3 08:05:48 2022 From: lucadeluge at gmail.com (Luca Delucchi) Date: Sun, 3 Apr 2022 17:05:48 +0200 Subject: [mapserver-users] Floating point exception In-Reply-To: <844d9201-7d21-057b-806d-3b0a15f2ba68@gatewaygeomatics.com> References: <844d9201-7d21-057b-806d-3b0a15f2ba68@gatewaygeomatics.com> Message-ID: On Fri, 1 Apr 2022 at 14:39, Jeff McKenna wrote: > > Ciao Luca, > Ciao Jeff, > I had earlier documented by usual PostGIS debugging steps at > https://mapserver.org/optimization/vector.html#debugging-speed-issues-with-postgis > > Also, instead of the "-map_debug 3" option with shp2img, try "-all_debug > 5" (use "3" if you just want to show the draw speed times) > I tried also with -all_debug but no debug messages appears only the error > The goal would be to output the exact query that MapServer is trying to > execute against your database, and then try running that query at the > psql commandline. > > And, if all else fails, be sure to retry all of this with a build of > today's MapServer "main" branch, and try with map2img. > Ok, I will try in the next days > -jeff > -- ciao Luca www.lucadelu.org From bob.basques at ci.stpaul.mn.us Tue Apr 5 09:35:57 2022 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Tue, 5 Apr 2022 16:35:57 +0000 Subject: [mapserver-users] [REMINDER] OSGeo Twin Cities Local Chapter (aka TCMUG) Meeting. - April 13th Message-ID: <6CB1A33F-1B90-449A-B42B-2BA8B06F0F11@ci.stpaul.mn.us> All, Back to virtual meetings this month. Seth Girvin will be presenting a talk entitled: An Introduction to Mappyfile Presentation description: An Introduction to Mappyfile - a Python library for working with MapServer Mapfiles The presentation will aim to cover the library, the online editor, and how mappyfile can be used to help migrate to MapServer 8. Bio: Seth is a geospatial developer with a focus on Python and web development. MapServer PSC member and OSGeo Charter Member. Based in France, but has been designing and building systems for various government departments in Ireland for over 20 years. https://twitter.com/geographika https://github.com/geographika/ https://geographika.net/ -- web:https://geographika.net twitter: @geographika When: April 13th, 4:30 ? 6:00 pm CDT Location (Virtual): https://meet.jit.si/osgeo_tcmug As always the presentations will be posted to the local OSGeo chapter page: https://staging.www.osgeo.org/local-chapters/twin-cities-mn-usa-chapter/ and https://www.osgeo.org/local-chapters/twin-cities-mn-usa-chapter/ Get me in Teams PW19-S295-C024 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdlime at gmail.com Wed Apr 6 12:58:26 2022 From: sdlime at gmail.com (Steve Lime) Date: Wed, 6 Apr 2022 14:58:26 -0500 Subject: [mapserver-users] Securing MapServer Deployments In-Reply-To: <5f392dbf-541b-4df3-bfd8-1bbbefc21969@www.fastmail.com> References: <5f392dbf-541b-4df3-bfd8-1bbbefc21969@www.fastmail.com> Message-ID: Nice job Seth, this is a really useful post! --Steve On Fri, Apr 1, 2022 at 9:03 AM Seth G wrote: > Hi all, > > I've written a blog post on Securing MapServer Deployments at > https://geographika.net/posts/securing_mapserver.html which also includes > details on the new CONFIG file available in MapServer 8.0 > If anyone has any other tips or best practices around security, please > send them on to the list, > > Seth > > -- > web:https://geographika.net > twitter: @geographika > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucadeluge at gmail.com Fri Apr 8 01:38:41 2022 From: lucadeluge at gmail.com (Luca Delucchi) Date: Fri, 8 Apr 2022 10:38:41 +0200 Subject: [mapserver-users] Floating point exception In-Reply-To: References: <844d9201-7d21-057b-806d-3b0a15f2ba68@gatewaygeomatics.com> Message-ID: Hi, I compiled the github master version and used map2img, the output is not helping so much... map2img -m eurodeer_new.map -o eurodeer.png -all_debug 5 Cannot open configuration file /usr/local/etc/mapserver.conf. msLoadConfig(): Unable to access file. See mapserver.org/config_file.html for more information. msDrawMap(): Image handling error. Failed to draw layer named 'Research groups'.
msPostGISLayerWhichShapes(): Query error. Failed to build query SQL.
msPostGISBuildSQL(): General error message. Failed to build SQL 'where'.
msSearchDiskTree(): Search returned no results. Unable to open spatial index for /home/lucadelu/github/euromammals/print_maps/././data/ne_10m_admin_0_sovereignty.qix. In most cases you can safely ignore this message, otherwise check file names and permissions.
msLoadConfig(): Unable to access file. See mapserver.org/config_file.html for more information.
the 'Research groups' layer is defined like this DATA "geom from (select research_groups_id, short_name, geom from main.research_groups where ST_Contains(!BOX!, geom)) as subquery using unique research_groups_id using srid=4326" -- ciao Luca www.lucadelu.org From jukka.rahkonen at maanmittauslaitos.fi Fri Apr 8 02:03:10 2022 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Fri, 8 Apr 2022 09:03:10 +0000 Subject: [mapserver-users] Floating point exception Message-ID: <7e51e67cf3c5463b880f111b523b14b3@maanmittauslaitos.fi> Hi, Mapserver 8 has increased security and requires a special config file. The best link for the documentation at the moment is probably https://mapserver.org/development/rfc/ms-rfc-135.html (The message "See mapserver.org/config_file.html for more information" points to non-existing location). Why did you select "Floating point exception" as the title of your message? -Jukka Rahkonen- -----Alkuper?inen viesti----- L?hett?j?: MapServer-users Puolesta Luca Delucchi L?hetetty: perjantai 8. huhtikuuta 2022 11.39 Vastaanottaja: Jeff McKenna Kopio: MapServer Aihe: Re: [mapserver-users] Floating point exception Hi, I compiled the github master version and used map2img, the output is not helping so much... map2img -m eurodeer_new.map -o eurodeer.png -all_debug 5 Cannot open configuration file /usr/local/etc/mapserver.conf. msLoadConfig(): Unable to access file. See mapserver.org/config_file.html for more information. msDrawMap(): Image handling error. Failed to draw layer named 'Research groups'.
msPostGISLayerWhichShapes(): Query error. Failed to build query SQL.
msPostGISBuildSQL(): General error message. Failed to build SQL 'where'.
msSearchDiskTree(): Search returned no results. Unable to open spatial index for /home/lucadelu/github/euromammals/print_maps/././data/ne_10m_admin_0_sovereignty.qix. In most cases you can safely ignore this message, otherwise check file names and permissions.
msLoadConfig(): Unable to access file. See mapserver.org/config_file.html for more information.
the 'Research groups' layer is defined like this DATA "geom from (select research_groups_id, short_name, geom from main.research_groups where ST_Contains(!BOX!, geom)) as subquery using unique research_groups_id using srid=4326" -- ciao Luca www.lucadelu.org _______________________________________________ MapServer-users mailing list MapServer-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users From lars.schylberg at blixtmail.se Fri Apr 8 03:38:41 2022 From: lars.schylberg at blixtmail.se (lars.schylberg at blixtmail.se) Date: Fri, 08 Apr 2022 10:38:41 +0000 Subject: [mapserver-users] Floating point exception In-Reply-To: <7e51e67cf3c5463b880f111b523b14b3@maanmittauslaitos.fi> References: <7e51e67cf3c5463b880f111b523b14b3@maanmittauslaitos.fi> Message-ID: Seth G. has written a good summany about this in a blog entry that hopefully will land in the 8.0 documentation. https://geographika.net/posts/securing_mapserver.html#web-server-level-security Have fun / Lars S. 8 april 2022 kl. 11:03, "Rahkonen Jukka (MML)" skrev: > Hi, > > Mapserver 8 has increased security and requires a special config file. The best link for the > documentation at the moment is probably https://mapserver.org/development/rfc/ms-rfc-135.html (The > message "See mapserver.org/config_file.html for more information" points to non-existing location). > > Why did you select "Floating point exception" as the title of your message? > > -Jukka Rahkonen- > > -----Alkuper?inen viesti----- > L?hett?j?: MapServer-users Puolesta Luca Delucchi > L?hetetty: perjantai 8. huhtikuuta 2022 11.39 > Vastaanottaja: Jeff McKenna > Kopio: MapServer > Aihe: Re: [mapserver-users] Floating point exception > > Hi, > > I compiled the github master version and used map2img, the output is not helping so much... > > map2img -m eurodeer_new.map -o eurodeer.png -all_debug 5 Cannot open configuration file > /usr/local/etc/mapserver.conf. > msLoadConfig(): Unable to access file. See mapserver.org/config_file.html for more information. > msDrawMap(): Image handling error. Failed to draw layer named 'Research groups'.
> msPostGISLayerWhichShapes(): Query error. Failed to build query SQL.
> msPostGISBuildSQL(): General error message. Failed to build SQL 'where'.
> msSearchDiskTree(): Search returned no results. Unable to open spatial index for > /home/lucadelu/github/euromammals/print_maps/././data/ne_10m_admin_0_sovereignty.qix. > In most cases you can safely ignore this message, otherwise check file names and permissions.
> msLoadConfig(): Unable to access file. See mapserver.org/config_file.html for more information. >
> > the 'Research groups' layer is defined like this > > DATA "geom from (select research_groups_id, short_name, geom from main.research_groups where > ST_Contains(!BOX!, geom)) as subquery using unique research_groups_id using srid=4326" > > -- > ciao > Luca > > www.lucadelu.org > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users From jmckenna at gatewaygeomatics.com Fri Apr 8 04:43:02 2022 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Fri, 8 Apr 2022 08:43:02 -0300 Subject: [mapserver-users] Floating point exception In-Reply-To: References: Message-ID: <80db507e-f35e-5994-80f2-24b7a44f9671@gatewaygeomatics.com> Ciao Luca, I am wondering also if you tried to access the PostGIS data through ogrinfo yet (to confirm there is no data issue). Note that I'd recommend GDAL 3.4.2, PROJ 8.2.1 with MapServer-main. ogrinfo -ro PG:"user=xxxx password=xxxx host=127.0.0.1 port=5432 dbname=xxxx" table -summary Then, follow along the debugging document ( https://www.mapserver.org/optimization/debugging.html ) and add the following inside your MAP object in mapfile: CONFIG "CPL_DEBUG" "ON" CONFIG "CPL_TIMESTAMP" "ON" CONFIG "PROJ_DEBUG" "ON" Then re-retry map2img with -all_debug 5, and look for the full SELECT query made to your database, and run that same query inside psql commandline. -jeff -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ On 2022-04-01 9:22 a.m., Luca Delucchi wrote: > Hi all, > > I'm getting "Floating point exception" error running shp2img, also > running with the debug option I don't get any other information. > The mapfile read data from PostGIS database, and If I use the same > mapfile with different database with the same tables I don't get this > error, so I think the problem is in the data but I don't know > where/what investigate > > thanks in advance > From lucadeluge at gmail.com Fri Apr 8 05:13:07 2022 From: lucadeluge at gmail.com (Luca Delucchi) Date: Fri, 8 Apr 2022 14:13:07 +0200 Subject: [mapserver-users] Floating point exception In-Reply-To: <7e51e67cf3c5463b880f111b523b14b3@maanmittauslaitos.fi> References: <7e51e67cf3c5463b880f111b523b14b3@maanmittauslaitos.fi> Message-ID: On Fri, 8 Apr 2022 at 11:03, Rahkonen Jukka (MML) wrote: > > Hi, > Hi, > Mapserver 8 has increased security and requires a special config file. The best link for the documentation at the moment is probably https://mapserver.org/development/rfc/ms-rfc-135.html (The message "See mapserver.org/config_file.html for more information" points to non-existing location). > thanks I was think this is needed only for web request not to test a mapfile > Why did you select "Floating point exception" as the title of your message? because my starting problem (using mapserver 7) is this one... > > -Jukka Rahkonen- > -- ciao Luca www.lucadelu.org From even.rouault at spatialys.com Fri Apr 8 05:20:06 2022 From: even.rouault at spatialys.com (Even Rouault) Date: Fri, 8 Apr 2022 14:20:06 +0200 Subject: [mapserver-users] Floating point exception In-Reply-To: References: <844d9201-7d21-057b-806d-3b0a15f2ba68@gatewaygeomatics.com> Message-ID: <5fd94b69-d9ce-0162-c9b5-d3277b117d92@spatialys.com> Build with cmake -DCMAKE_BUILD_TYPE=Debug and run under gdb: gdb --args map2img -m eurodeer_new.map -o eurodeer.png -all_debug 5 -conf /path/to/conffile run and when it crashes bt Le 08/04/2022 ? 10:38, Luca Delucchi a ?crit?: > Hi, > > I compiled the github master version and used map2img, the output is > not helping so much... > > map2img -m eurodeer_new.map -o eurodeer.png -all_debug 5 > Cannot open configuration file /usr/local/etc/mapserver.conf. > msLoadConfig(): Unable to access file. See > mapserver.org/config_file.html for more information. > msDrawMap(): Image handling error. Failed to draw layer named > 'Research groups'.
> msPostGISLayerWhichShapes(): Query error. Failed to build query SQL.
> msPostGISBuildSQL(): General error message. Failed to build SQL 'where'.
> msSearchDiskTree(): Search returned no results. Unable to open spatial > index for /home/lucadelu/github/euromammals/print_maps/././data/ne_10m_admin_0_sovereignty.qix. > In most cases you can safely ignore this message, otherwise check file > names and permissions.
> msLoadConfig(): Unable to access file. See > mapserver.org/config_file.html for more information.
> > the 'Research groups' layer is defined like this > > DATA "geom from (select research_groups_id, short_name, geom from > main.research_groups where ST_Contains(!BOX!, geom)) as subquery using > unique research_groups_id using srid=4326" > -- http://www.spatialys.com My software is free, but my time generally not. From lucadeluge at gmail.com Fri Apr 8 05:49:26 2022 From: lucadeluge at gmail.com (Luca Delucchi) Date: Fri, 8 Apr 2022 14:49:26 +0200 Subject: [mapserver-users] Floating point exception In-Reply-To: <80db507e-f35e-5994-80f2-24b7a44f9671@gatewaygeomatics.com> References: <80db507e-f35e-5994-80f2-24b7a44f9671@gatewaygeomatics.com> Message-ID: On Fri, 8 Apr 2022 at 13:43, Jeff McKenna wrote: > > Ciao Luca, > Ciao, > I am wondering also if you tried to access the PostGIS data through > ogrinfo yet (to confirm there is no data issue). Note that I'd > recommend GDAL 3.4.2, PROJ 8.2.1 with MapServer-main. > > ogrinfo -ro PG:"user=xxxx password=xxxx host=127.0.0.1 port=5432 > dbname=xxxx" table -summary > yes this works > Then, follow along the debugging document ( > https://www.mapserver.org/optimization/debugging.html ) and add the > following inside your MAP object in mapfile: > > CONFIG "CPL_DEBUG" "ON" > CONFIG "CPL_TIMESTAMP" "ON" > CONFIG "PROJ_DEBUG" "ON" > > Then re-retry map2img with -all_debug 5, and look for the full SELECT > query made to your database, and run that same query inside psql > commandline. > using map2img as suggested by Even I got this Reading symbols from map2img... (gdb) run Starting program: /home/lucadelu/installati/bin/map2img -m eurodeer_new.map -o eurodeer.png -all_debug 5 -conf mapserver.conf [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffebf54700 (LWP 801419)] [New Thread 0x7fffeb753700 (LWP 801420)] msDrawMap(): Image handling error. Failed to draw layer named 'Reserch groups'.
msPostGISLayerWhichShapes(): Query error. Failed to build query SQL.
msPostGISBuildSQL(): General error message. Failed to build SQL 'where'.
msSearchDiskTree(): Search returned no results. Unable to open spatial index for /home/lucadelu/github/euromammals/print_maps/././data/ne_10m_admin_0_sovereignty.qix. In most cases you can safely ignore this message, otherwise check file names and permissions.
[Fri Apr 8 14:38:55 2022].491539: GDAL: In GDALDestroy - unloading GDAL shared library. [Thread 0x7fffebf54700 (LWP 801419) exited] [Thread 0x7fffec613bc0 (LWP 801411) exited] [Inferior 1 (process 801411) exited with code 01] However using shp2img with a running map file I was able to get the full postgis query and run it on a database returning the error "Floating point exception" without any problem. select "short_name"::text,ST_AsBinary(("geom"),'NDR') as geom,"research_groups_id"::text from (select research_groups_id, short_name, geom from main.research_groups where ST_Contains(ST_GeomFromText('POLYGON((-15.2587587587588 35,-15.2587587587588 70,37.2587587587588 70,37.2587587587588 35,-15.2587587587588 35))',4326), geom)) as subquery > > -jeff > -- ciao Luca www.lucadelu.org From jmckenna at gatewaygeomatics.com Fri Apr 8 06:34:35 2022 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Fri, 8 Apr 2022 10:34:35 -0300 Subject: [mapserver-users] Floating point exception In-Reply-To: References: <80db507e-f35e-5994-80f2-24b7a44f9671@gatewaygeomatics.com> Message-ID: <84dcdb08-90bb-9dd2-9f5a-47f023854415@gatewaygeomatics.com> Ciao Luca, What happens when you pass the full query through ogrinfo with the "-sql" switch: ogrinfo -ro PG:"user=xxxx password=xxxx host=127.0.0.1 port=5432 dbname=xxxx" -sql "select "short_name"::text,ST_AsBinary(("geom"),'NDR') as geom,"research_groups_id"::text from (select research_groups_id, short_name, geom from main.research_groups where ST_Contains(ST_GeomFromText('POLYGON((-15.2587587587588 35,-15.2587587587588 70,37.2587587587588 70,37.2587587587588 35,-15.2587587587588 35))',4326), geom)) as subquery" -jeff On 2022-04-08 9:49 a.m., Luca Delucchi wrote: > On Fri, 8 Apr 2022 at 13:43, Jeff McKenna wrote: >> >> Ciao Luca, >> > > Ciao, > >> I am wondering also if you tried to access the PostGIS data through >> ogrinfo yet (to confirm there is no data issue). Note that I'd >> recommend GDAL 3.4.2, PROJ 8.2.1 with MapServer-main. >> >> ogrinfo -ro PG:"user=xxxx password=xxxx host=127.0.0.1 port=5432 >> dbname=xxxx" table -summary >> > > yes this works > >> Then, follow along the debugging document ( >> https://www.mapserver.org/optimization/debugging.html ) and add the >> following inside your MAP object in mapfile: >> >> CONFIG "CPL_DEBUG" "ON" >> CONFIG "CPL_TIMESTAMP" "ON" >> CONFIG "PROJ_DEBUG" "ON" >> >> Then re-retry map2img with -all_debug 5, and look for the full SELECT >> query made to your database, and run that same query inside psql >> commandline. >> > > using map2img as suggested by Even I got this > > Reading symbols from map2img... > (gdb) run > Starting program: /home/lucadelu/installati/bin/map2img -m > eurodeer_new.map -o eurodeer.png -all_debug 5 -conf mapserver.conf > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". > [New Thread 0x7fffebf54700 (LWP 801419)] > [New Thread 0x7fffeb753700 (LWP 801420)] > msDrawMap(): Image handling error. Failed to draw layer named 'Reserch > groups'.
> msPostGISLayerWhichShapes(): Query error. Failed to build query SQL.
> msPostGISBuildSQL(): General error message. Failed to build SQL 'where'.
> msSearchDiskTree(): Search returned no results. Unable to open spatial > index for /home/lucadelu/github/euromammals/print_maps/././data/ne_10m_admin_0_sovereignty.qix. > In most cases you can safely ignore this message, otherwise check file > names and permissions.
> [Fri Apr 8 14:38:55 2022].491539: GDAL: In GDALDestroy - unloading > GDAL shared library. > [Thread 0x7fffebf54700 (LWP 801419) exited] > [Thread 0x7fffec613bc0 (LWP 801411) exited] > [Inferior 1 (process 801411) exited with code 01] > > > However using shp2img with a running map file I was able to get the > full postgis query and run it on a database returning the error > "Floating point exception" without any problem. > > select "short_name"::text,ST_AsBinary(("geom"),'NDR') as > geom,"research_groups_id"::text from (select research_groups_id, > short_name, geom from main.research_groups where > ST_Contains(ST_GeomFromText('POLYGON((-15.2587587587588 > 35,-15.2587587587588 70,37.2587587587588 70,37.2587587587588 > 35,-15.2587587587588 35))',4326), geom)) as subquery > > >> >> -jeff >> > -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ From lucadeluge at gmail.com Sat Apr 9 22:45:29 2022 From: lucadeluge at gmail.com (Luca Delucchi) Date: Sun, 10 Apr 2022 07:45:29 +0200 Subject: [mapserver-users] Floating point exception In-Reply-To: <84dcdb08-90bb-9dd2-9f5a-47f023854415@gatewaygeomatics.com> References: <80db507e-f35e-5994-80f2-24b7a44f9671@gatewaygeomatics.com> <84dcdb08-90bb-9dd2-9f5a-47f023854415@gatewaygeomatics.com> Message-ID: On Fri, 8 Apr 2022 at 15:35, Jeff McKenna wrote: > > Ciao Luca, > Jeff, > What happens when you pass the full query through ogrinfo with the > "-sql" switch: > > ogrinfo -ro PG:"user=xxxx password=xxxx host=127.0.0.1 port=5432 > dbname=xxxx" -sql "select "short_name"::text,ST_AsBinary(("geom"),'NDR') > as geom,"research_groups_id"::text from (select research_groups_id, > short_name, geom from main.research_groups where > ST_Contains(ST_GeomFromText('POLYGON((-15.2587587587588 > 35,-15.2587587587588 70,37.2587587587588 70,37.2587587587588 > 35,-15.2587587587588 35))',4326), geom)) as subquery" > it works properly Layer name: sql_statement Geometry: None Feature Count: 54 Layer SRS WKT: (unknown) short_name: String (0.0) geom: Binary (0.0) research_groups_id: String (0.0) OGRFeature(sql_statement):0 short_name (String) = CROC geom (Binary) = 0101000000037AE1CE85E11940F279C5538F784840 research_groups_id (String) = 1 .......... OGRFeature(sql_statement):53 short_name (String) = JdE geom (Binary) = 010100000035B22B2D236519C0828FC18A53754340 research_groups_id (String) = 55 At this point I tried to compile the 7.6 version and use the compiled shp2img and I didn't get anymore the "Floating point exception" problem. I don't know where it was coming from :-/ > > -jeff > -- ciao Luca www.lucadelu.org From bob.basques at ci.stpaul.mn.us Mon Apr 11 11:45:05 2022 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Mon, 11 Apr 2022 18:45:05 +0000 Subject: [mapserver-users] [REMINDER] OSGeo Twin Cities Local Chapter (aka TCMUG) Meeting. - April 13th Message-ID: All, Back to virtual meetings this month. Seth Girvin will be presenting a talk entitled: An Introduction to Mappyfile Presentation description: An Introduction to Mappyfile - a Python library for working with MapServer Mapfiles The presentation will aim to cover the library, the online editor, and how mappyfile can be used to help migrate to MapServer 8. Bio: Seth is a geospatial developer with a focus on Python and web development. MapServer PSC member and OSGeo Charter Member. Based in France, but has been designing and building systems for various government departments in Ireland for over 20 years. https://twitter.com/geographika https://github.com/geographika/ https://geographika.net/ -- web:https://geographika.net twitter: @geographika When: April 13th, 4:30 ? 6:00 pm CDT Location (Virtual): https://meet.jit.si/osgeo_tcmug As always the presentations will be posted to the local OSGeo chapter page: https://staging.www.osgeo.org/local-chapters/twin-cities-mn-usa-chapter/ and https://www.osgeo.org/local-chapters/twin-cities-mn-usa-chapter/ Get me in Teams PW19-S295-C024 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmckenna at gatewaygeomatics.com Mon Apr 11 13:14:14 2022 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Mon, 11 Apr 2022 17:14:14 -0300 Subject: [mapserver-users] Happy birthday to MapServer In-Reply-To: <0ccfd12c-80e0-233e-9895-138f675f1ade@gatewaygeomatics.com> References: <0ccfd12c-80e0-233e-9895-138f675f1ade@gatewaygeomatics.com> Message-ID: <03f1e227-73c7-4051-6854-4df335b61371@gatewaygeomatics.com> Happy birthday wishes to the whole MapServer project, as the first available commit in the repository was made back on 2000-04-11 (see the commit here https://github.com/MapServer/MapServer/commit/abe3c7aca45618c67750c3b421824f8e853cdfc0 ) for the 3.3 release. The project history of course goes back to 1994. Thank-you to all of the contributors and users and promoters, over all of these decades. happy mapserv-ing! -jeff -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ From romanvillarrealh at live.com.mx Mon Apr 11 14:34:50 2022 From: romanvillarrealh at live.com.mx (roman villarreal) Date: Mon, 11 Apr 2022 21:34:50 +0000 Subject: [mapserver-users] Happy birthday to MapServer In-Reply-To: <03f1e227-73c7-4051-6854-4df335b61371@gatewaygeomatics.com> References: <0ccfd12c-80e0-233e-9895-138f675f1ade@gatewaygeomatics.com> <03f1e227-73c7-4051-6854-4df335b61371@gatewaygeomatics.com> Message-ID: Happy birthday and much more !!! ________________________________ De: MapServer-users en nombre de Jeff McKenna Enviado: lunes, 11 de abril de 2022 03:14 p. m. Para: MapServer-users Asunto: [mapserver-users] Happy birthday to MapServer Happy birthday wishes to the whole MapServer project, as the first available commit in the repository was made back on 2000-04-11 (see the commit here https://github.com/MapServer/MapServer/commit/abe3c7aca45618c67750c3b421824f8e853cdfc0 ) for the 3.3 release. The project history of course goes back to 1994. Thank-you to all of the contributors and users and promoters, over all of these decades. happy mapserv-ing! -jeff -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ _______________________________________________ MapServer-users mailing list MapServer-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From genuchten at yahoo.com Tue Apr 12 02:56:00 2022 From: genuchten at yahoo.com (Paul) Date: Tue, 12 Apr 2022 09:56:00 +0000 (UTC) Subject: [mapserver-users] dynamic ows_serviceurl References: <763059224.71636.1649757360303.ref@mail.yahoo.com> Message-ID: <763059224.71636.1649757360303@mail.yahoo.com> hi list, this has probably been discussed before, but maybe there are updates (on v8?) we would like to extract the ows_onlineresource from the environment, instead of having an administrator to configure it on the mapfile currently we implement a hack where the webserver layer sends an additional query parameter `ows_url` to mapserver which contains the current url in the mapfile this is implemented as? ```WEB VALIDATION "ows_url" "(\b(https?|ftp|file)://)?[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]" END METADATA "ows_onlineresource" "%ows_url%" END END``` I wonder if others run into similar challenges, or if there are much more simple best practices for this case. I can imagine allowing a environment parameter 'proxy-url' like geoserver would make sense, but it should allow some kind of template, eg: ```PROXY-URL https://example.com/cgi-bin/mapserv?map={map}.map``` which in our case would be? ```PROXY-URL https://example.com/cgi-bin/{map}``` Thank you, Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdlime at gmail.com Tue Apr 12 18:04:43 2022 From: sdlime at gmail.com (Steve Lime) Date: Tue, 12 Apr 2022 20:04:43 -0500 Subject: [mapserver-users] dynamic ows_serviceurl In-Reply-To: <763059224.71636.1649757360303@mail.yahoo.com> References: <763059224.71636.1649757360303.ref@mail.yahoo.com> <763059224.71636.1649757360303@mail.yahoo.com> Message-ID: Hi Paul: The idea of referencing environment variables has come up before. Another example would be to leverage settings injected into cloud deployments as environment variables (I think there's an old ticket that was recently re-opened on the topic). I'm not sure what the best way to handle this would be. One possibility would be using a mechanism similar to runtime subs where you'd reference the variables within the mapfile using ${variable} or whatever. Another idea would be to use a pre-processor of some sort to "compile" a mapfile from the environment. The latter would result in better performance since you'd generate the resulting file once and could also do things like inlining included snippets. This functionality would be helpful for the cloud deployments, simplifying deployments in multiple (dev, test, prod) environments and for keeping secrets out of repos altogether. We're putzing around with the pre-processing idea a bit but haven't gotten anything fully baked. Others? -Steve On Tue, Apr 12, 2022 at 4:56 AM Paul via MapServer-users < mapserver-users at lists.osgeo.org> wrote: > hi list, this has probably been discussed before, but maybe there are > updates (on v8?) > > we would like to extract the ows_onlineresource from the environment, > instead of having an administrator to configure it on the mapfile > > currently we implement a hack where the webserver layer sends an > additional query parameter `ows_url` to mapserver which contains the > current url > > in the mapfile this is implemented as > > ``` > > WEB VALIDATION "ows_url" "(\b(https?|ftp|file)://)?[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]" END METADATA "ows_onlineresource" "%ows_url%" ENDEND > > ``` > > I wonder if others run into similar challenges, or if there are much more > simple best practices for this case. > > I can imagine allowing a environment parameter 'proxy-url' like geoserver > would make sense, but it should allow some kind of template, eg: > > ``` > PROXY-URL https://example.com/cgi-bin/mapserv?map={map}.map > ``` > > which in our case would be > > ``` > PROXY-URL https://example.com/cgi-bin/{map} > ``` > > Thank you, Paul. > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdlime at gmail.com Tue Apr 12 18:52:25 2022 From: sdlime at gmail.com (Steve Lime) Date: Tue, 12 Apr 2022 20:52:25 -0500 Subject: [mapserver-users] dynamic ows_serviceurl In-Reply-To: References: <763059224.71636.1649757360303.ref@mail.yahoo.com> <763059224.71636.1649757360303@mail.yahoo.com> Message-ID: One other thing. One challenge with environment variables is knowing what's consistently available within a runtime environment - CGI is different from FastCGI and there are differences across web servers. That's one of the reasons pre-processing is kind of attractive IMHO. I suppose the v.8 config file could play a role but I'm unsure what that would be beyond a place to set values consistently. On Tue, Apr 12, 2022 at 8:04 PM Steve Lime wrote: > Hi Paul: The idea of referencing environment variables has come up before. > Another example would be to leverage settings injected into cloud > deployments as environment variables (I think there's an old ticket that > was recently re-opened on the topic). I'm not sure what the best way to > handle this would be. One possibility would be using a mechanism similar to > runtime subs where you'd reference the variables within the mapfile using > ${variable} or whatever. Another idea would be to use a pre-processor of > some sort to "compile" a mapfile from the environment. The latter would > result in better performance since you'd generate the resulting file once > and could also do things like inlining included snippets. This > functionality would be helpful for the cloud deployments, simplifying > deployments in multiple (dev, test, prod) environments and for keeping > secrets out of repos altogether. > > We're putzing around with the pre-processing idea a bit but haven't gotten > anything fully baked. Others? > > -Steve > > On Tue, Apr 12, 2022 at 4:56 AM Paul via MapServer-users < > mapserver-users at lists.osgeo.org> wrote: > >> hi list, this has probably been discussed before, but maybe there are >> updates (on v8?) >> >> we would like to extract the ows_onlineresource from the environment, >> instead of having an administrator to configure it on the mapfile >> >> currently we implement a hack where the webserver layer sends an >> additional query parameter `ows_url` to mapserver which contains the >> current url >> >> in the mapfile this is implemented as >> >> ``` >> >> WEB VALIDATION "ows_url" "(\b(https?|ftp|file)://)?[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]" END METADATA "ows_onlineresource" "%ows_url%" ENDEND >> >> ``` >> >> I wonder if others run into similar challenges, or if there are much more >> simple best practices for this case. >> >> I can imagine allowing a environment parameter 'proxy-url' like geoserver >> would make sense, but it should allow some kind of template, eg: >> >> ``` >> PROXY-URL https://example.com/cgi-bin/mapserv?map={map}.map >> ``` >> >> which in our case would be >> >> ``` >> PROXY-URL https://example.com/cgi-bin/{map} >> ``` >> >> Thank you, Paul. >> _______________________________________________ >> MapServer-users mailing list >> MapServer-users at lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/mapserver-users >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sethg at geographika.co.uk Wed Apr 13 01:00:29 2022 From: sethg at geographika.co.uk (Seth G) Date: Wed, 13 Apr 2022 10:00:29 +0200 Subject: [mapserver-users] dynamic ows_serviceurl In-Reply-To: References: <763059224.71636.1649757360303.ref@mail.yahoo.com> <763059224.71636.1649757360303@mail.yahoo.com> Message-ID: Hi Paul, The runtime substitution and setting a querystring on the server is a good approach - have you found any drawbacks to this? Most web servers can set/add querystrings without any need for further software. As Steve mentioned the alternative would be to generate Mapfiles for specific environments from a template. I use mappyfile for this, with a Python script that can be run as part of continuous deployment: import mappyfile mapfile = mappyfile.open("original.map") # update the web metadata settings mapfile["web"]["metadata"]["ows_onlineresource"] = "https://example.com/cgi-bin/mapserv?map={}.map".format("test") mappyfile.save(mapfile, "new.map") Typical other settings I'd change are connection strings, DEBUG level, and EXTENTs for different Mapfiles. Seth -- web:https://geographika.net twitter: @geographika On Wed, Apr 13, 2022, at 3:52 AM, Steve Lime wrote: > One other thing. One challenge with environment variables is knowing what's consistently available within a runtime environment - CGI is different from FastCGI and there are differences across web servers. That's one of the reasons pre-processing is kind of attractive IMHO. I suppose the v.8 config file could play a role but I'm unsure what that would be beyond a place to set values consistently. > > On Tue, Apr 12, 2022 at 8:04 PM Steve Lime wrote: >> Hi Paul: The idea of referencing environment variables has come up before. Another example would be to leverage settings injected into cloud deployments as environment variables (I think there's an old ticket that was recently re-opened on the topic). I'm not sure what the best way to handle this would be. One possibility would be using a mechanism similar to runtime subs where you'd reference the variables within the mapfile using ${variable} or whatever. Another idea would be to use a pre-processor of some sort to "compile" a mapfile from the environment. The latter would result in better performance since you'd generate the resulting file once and could also do things like inlining included snippets. This functionality would be helpful for the cloud deployments, simplifying deployments in multiple (dev, test, prod) environments and for keeping secrets out of repos altogether. >> >> We're putzing around with the pre-processing idea a bit but haven't gotten anything fully baked. Others? >> >> -Steve >> >> On Tue, Apr 12, 2022 at 4:56 AM Paul via MapServer-users wrote: >>> hi list, this has probably been discussed before, but maybe there are updates (on v8?) >>> >>> we would like to extract the `ows_onlineresource from the environment, instead of having an administrator to configure it on the mapfile` >>> >>> currently we implement a hack where the webserver layer sends an additional query parameter `ows_url` to mapserver which contains the current url >>> >>> in the mapfile this is implemented as >>> >>> ``` >>> WEB >>> VALIDATION >>> "ows_url" "(\b(https?|ftp|file)://)?[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]" >>> END >>> >>> METADATA >>> "ows_onlineresource" "%ows_url%" >>> END >>> END >>> ``` >>> >>> I wonder if others run into similar challenges, or if there are much more simple best practices for this case. >>> >>> I can imagine allowing a environment parameter 'proxy-url' like geoserver would make sense, but it should allow some kind of template, eg: >>> >>> ``` >>> PROXY-URL https://example.com/cgi-bin/mapserv?map={map}.map >>> ``` >>> >>> which in our case would be >>> >>> ``` >>> PROXY-URL https://example.com/cgi-bin/{map} >>> ``` >>> >>> Thank you, Paul. >>> _______________________________________________ >>> MapServer-users mailing list >>> MapServer-users at lists.osgeo.org >>> https://lists.osgeo.org/mailman/listinfo/mapserver-users > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kaido.irdt at gmail.com Wed Apr 13 09:30:48 2022 From: kaido.irdt at gmail.com (Kaido Irdt) Date: Wed, 13 Apr 2022 19:30:48 +0300 Subject: [mapserver-users] dynamic ows_serviceurl In-Reply-To: References: <763059224.71636.1649757360303.ref@mail.yahoo.com> <763059224.71636.1649757360303@mail.yahoo.com> Message-ID: Hi Paul, We are using basically the same process as Seth and Steve mentioned. We are building map files per environment and per node using Chef. Basically we parameterized the .map file and fill in parameters for every node when we deploy. And because we have multiple map files for different topics we are actually building multiple map files per node per environment. (buildig map file from templates - header_template + layers + styles + end_template) But instead of using Chef it could be done using scripts and replacing specific keywords with environment parameters. This way web server won't have to do extra steps per request to change values Example parts of our "template" header file: NAME "sim_<%= @mapname %>_<%=node.chef_environment%>" STATUS ON EXTENT <%= node['mapserver']['extent'] %> FONTSET "<%= node['mapserver']['deploy_to'] %>/fonts/current/fonts.list" IMAGETYPE "png" CONFIG "MS_ERRORFILE" "<%=node['mapserver']['log_dir']%>/<%= @mapname %>.log" ..... WEB METADATA "wfs_title" "SiM <%= @mapname %> <%=node.chef_environment%>" "wfs_enable_request" "*" "wfs_encoding" "UTF-8" "wms_title" "SiM <%= @mapname %> <%=node.chef_environment%>" "wms_encoding" "UTF-8" "wms_onlineresource" "https://<%=node['mapserver']['proxy_url']%>/mapserv?map=/gis/<%= @mapname %>.map&" "wfs_onlineresource" "https://<%=node['mapserver']['proxy_url']%>/mapserv?map=/gis/<%= @mapname %>.map&" .... Kaido Kontakt Seth G () kirjutas kuup?eval K, 13. aprill 2022 kell 11:21: > Hi Paul, > > The runtime substitution and setting a querystring on the server is a good > approach - have you found any drawbacks to this? Most web servers can > set/add querystrings without any need for further software. > > As Steve mentioned the alternative would be to generate Mapfiles for > specific environments from a template. > I use mappyfile for this, with a Python script that can be run as part of > continuous deployment: > > import mappyfile > mapfile = mappyfile.open("original.map") > # update the web metadata settings > mapfile["web"]["metadata"]["ows_onlineresource"] = " > https://example.com/cgi-bin/mapserv?map={}.map".format("test") > mappyfile.save(mapfile, "new.map") > > Typical other settings I'd change are connection strings, DEBUG level, and > EXTENTs for different Mapfiles. > > Seth > > -- > web:https://geographika.net > twitter: @geographika > > > On Wed, Apr 13, 2022, at 3:52 AM, Steve Lime wrote: > > One other thing. One challenge with environment variables is knowing > what's consistently available within a runtime environment - CGI is > different from FastCGI and there are differences across web servers. That's > one of the reasons pre-processing is kind of attractive IMHO. I suppose the > v.8 config file could play a role but I'm unsure what that would be beyond > a place to set values consistently. > > On Tue, Apr 12, 2022 at 8:04 PM Steve Lime wrote: > > Hi Paul: The idea of referencing environment variables has come up before. > Another example would be to leverage settings injected into cloud > deployments as environment variables (I think there's an old ticket that > was recently re-opened on the topic). I'm not sure what the best way to > handle this would be. One possibility would be using a mechanism similar to > runtime subs where you'd reference the variables within the mapfile using > ${variable} or whatever. Another idea would be to use a pre-processor of > some sort to "compile" a mapfile from the environment. The latter would > result in better performance since you'd generate the resulting file once > and could also do things like inlining included snippets. This > functionality would be helpful for the cloud deployments, simplifying > deployments in multiple (dev, test, prod) environments and for keeping > secrets out of repos altogether. > > We're putzing around with the pre-processing idea a bit but haven't gotten > anything fully baked. Others? > > -Steve > > On Tue, Apr 12, 2022 at 4:56 AM Paul via MapServer-users < > mapserver-users at lists.osgeo.org> wrote: > > hi list, this has probably been discussed before, but maybe there are > updates (on v8?) > > we would like to extract the ows_onlineresource from the environment, > instead of having an administrator to configure it on the mapfile > > currently we implement a hack where the webserver layer sends an > additional query parameter `ows_url` to mapserver which contains the > current url > > in the mapfile this is implemented as > > ``` > > WEB VALIDATION "ows_url" "(\b(https?|ftp|file)://)?[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]" END METADATA "ows_onlineresource" "%ows_url%" ENDEND > > ``` > > I wonder if others run into similar challenges, or if there are much more > simple best practices for this case. > > I can imagine allowing a environment parameter 'proxy-url' like geoserver > would make sense, but it should allow some kind of template, eg: > > ``` > PROXY-URL https://example.com/cgi-bin/mapserv?map={map}.map > ``` > > which in our case would be > > ``` > PROXY-URL https://example.com/cgi-bin/{map} > ``` > > Thank you, Paul. > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From genuchten at yahoo.com Wed Apr 13 13:37:25 2022 From: genuchten at yahoo.com (Paul) Date: Wed, 13 Apr 2022 20:37:25 +0000 (UTC) Subject: [mapserver-users] dynamic ows_serviceurl References: <2111407192.716545.1649882245757.ref@mail.yahoo.com> Message-ID: <2111407192.716545.1649882245757@mail.yahoo.com> Thanx for the suggestions Kaido, Seth, Steve. Updating the mapfile at deployment indeed is a better option then the querystring approach, let me verify what scripting options (sed?) i have on our docker image.? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmckenna at gatewaygeomatics.com Wed Apr 13 16:07:35 2022 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Wed, 13 Apr 2022 20:07:35 -0300 Subject: [mapserver-users] dynamic ows_serviceurl In-Reply-To: <2111407192.716545.1649882245757@mail.yahoo.com> References: <2111407192.716545.1649882245757.ref@mail.yahoo.com> <2111407192.716545.1649882245757@mail.yahoo.com> Message-ID: This is exactly why PHP MapScript has been so popular for so long ("wrappers" of OGC services) and why so many examples of this exists in the MapServer documentation. Honestly though, someday I also hope for a more direct way to handle these dynamic changes, but until then, #mapscriptrocks :) -jeff -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ On 2022-04-13 5:37 p.m., Paul via MapServer-users wrote: > Thanx for the suggestions Kaido, Seth, Steve. Updating the mapfile at > deployment indeed is a better option then the querystring approach, let > me verify what scripting options (sed?) i have on our docker image. > From marcoberi at gmail.com Thu Apr 14 01:39:53 2022 From: marcoberi at gmail.com (Marco Beri) Date: Thu, 14 Apr 2022 10:39:53 +0200 Subject: [mapserver-users] Mapscript Python module version 7.6.0 not working with Python 3 > 3.6 In-Reply-To: References: Message-ID: Dear Mapserver Users, I was not able to find a way to open an issue with this project https://pypi.org/project/mapscript/7.6.0/ If you try to import the current mapserver module with Python 3 version major than 3.6 (which already reached his end of life) you encounter this error: ImportError: cannot import name '_mapscript' from partially initialized module 'mapscript' (most likely due to a circular import) Would you help me find a way to open a ticket or to do a pull request or whatever is the best way to help the developers to fix this problem? Thanks a lot. Ciao. Marco. P.S. You can easily reproduce it with these 3 simple steps (and a Python version 3.8 or greater): pip install mapscript python >>> import mapscript Traceback (most recent call last): File "", line 1, in File "/home/marcob/.virtualenvs/mapscript/lib/python3.9/site-packages/mapscript/__init__.py", line 2, in from .mapscript import * File "/home/marcob/.virtualenvs/mapscript/lib/python3.9/site-packages/mapscript/mapscript.py", line 13, in from . import _mapscript ImportError: cannot import name '_mapscript' from partially initialized module 'mapscript' (most likely due to a circular import) (/home/marcob/.virtualenvs/mapscript/lib/python3.9/site-packages/mapscript/__init__.py) >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucadeluge at gmail.com Thu Apr 14 07:25:14 2022 From: lucadeluge at gmail.com (Luca Delucchi) Date: Thu, 14 Apr 2022 16:25:14 +0200 Subject: [mapserver-users] Mapscript Python module version 7.6.0 not working with Python 3 > 3.6 In-Reply-To: References: Message-ID: Il gio 14 apr 2022, 13:13 Marco Beri ha scritto: > Dear Mapserver Users, > Dear Marco, I was not able to find a way to open an issue with this project > https://pypi.org/project/mapscript/7.6.0/ > > If you try to import the current mapserver module with Python 3 version > major than 3.6 (which already reached his end of life) you encounter this > error: > > ImportError: cannot import name '_mapscript' from partially initialized > module 'mapscript' (most likely due to a circular import) > > > Would you help me find a way to open a ticket or to do a pull request or > whatever is the best way to help the developers to fix this problem? > I have the same problem but it seems related to virtualenv, no idea why. The installed version from Debian package works properly > Thanks a lot. > > Ciao. > Marco. > Thanks Luca > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcoberi at gmail.com Thu Apr 14 07:50:46 2022 From: marcoberi at gmail.com (Marco Beri) Date: Thu, 14 Apr 2022 16:50:46 +0200 Subject: [mapserver-users] Mapscript Python module version 7.6.0 not working with Python 3 > 3.6 In-Reply-To: References: Message-ID: On Thu, 14 Apr 2022, 16:25 Luca Delucchi, wrote: > > I have the same problem but it seems related to virtualenv, no idea why. > The installed version from Debian package works properly > Luca, yes, I know but that's because the Debian package is an old version 7.4.0 instead of 7.6.0. This should really be fixed by the mantainers. Ciao. Marco. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sethg at geographika.co.uk Thu Apr 14 08:43:35 2022 From: sethg at geographika.co.uk (Seth G) Date: Thu, 14 Apr 2022 17:43:35 +0200 Subject: [mapserver-users] Mapscript Python module version 7.6.0 not working with Python 3 > 3.6 In-Reply-To: References: Message-ID: <4648fe71-3852-42af-8cd7-87f37e9c85eb@www.fastmail.com> Hi, The wheels at https://pypi.org/project/mapscript/ are only available for Windows [1]. There is also a source distribution, but it would also require the MapServer soource and dependencies to build. Universal Wheels for Linux would only be possible by using manylinux [2], but I've not been able to compile MapServer with this. For other options (including creating your own Linux Wheels for your MapServer builds that can be installed in a virtual environment) see the sections "Installation on Unix" and "Building the Mapscript Module" at https://pypi.org/project/mapscript/ Seth [1] https://pypi.org/project/mapscript/#files [2] https://github.com/pypa/manylinux -- web:https://geographika.net twitter: @geographika On Thu, Apr 14, 2022, at 10:39 AM, Marco Beri wrote: > Dear Mapserver Users, > I was not able to find a way to open an issue with this project https://pypi.org/project/mapscript/7.6.0/ > > If you try to import the current mapserver module with Python 3 version major than 3.6 (which already reached his end of life) you encounter this error: > >> ImportError: cannot import name '_mapscript' from partially initialized module 'mapscript' (most likely due to a circular import) > > Would you help me find a way to open a ticket or to do a pull request or whatever is the best way to help the developers to fix this problem? > > Thanks a lot. > > Ciao. > Marco. > P.S. You can easily reproduce it with these 3 simple steps (and a Python version 3.8 or greater): > >> pip install mapscript >> python >> >>> import mapscript >> Traceback (most recent call last): >> File "", line 1, in >> File "/home/marcob/.virtualenvs/mapscript/lib/python3.9/site-packages/mapscript/__init__.py", line 2, in >> from .mapscript import * >> File "/home/marcob/.virtualenvs/mapscript/lib/python3.9/site-packages/mapscript/mapscript.py", line 13, in >> from . import _mapscript >> ImportError: cannot import name '_mapscript' from partially initialized module 'mapscript' (most likely due to a circular import) (/home/marcob/.virtualenvs/mapscript/lib/python3.9/site-packages/mapscript/__init__.py) >> >>> > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn.ove at grotan.com Fri Apr 15 02:52:20 2022 From: bjorn.ove at grotan.com (=?utf-8?B?QmrDuHJuIE92ZSBHcsO4dGFu?=) Date: Fri, 15 Apr 2022 11:52:20 +0200 Subject: [mapserver-users] dynamic ows_serviceurl In-Reply-To: <2111407192.716545.1649882245757@mail.yahoo.com> References: <2111407192.716545.1649882245757.ref@mail.yahoo.com> <2111407192.716545.1649882245757@mail.yahoo.com> Message-ID: Paul via MapServer-users: > Thanx for the suggestions Kaido, Seth, Steve. Updating the mapfile at > deployment indeed is a better option then the querystring approach, let me > verify what scripting options (sed?) i have on our docker image.? If you omit setting the ows_onlineresource (just try to commend it out) in the .map-file, mapserver will dynamically use the path (e.g. domain) it was reached by. Thus you can have the same mapfile on dev, test, qa or production and they will have individual domains. If you reach the server-instance, it will use the server-name (and port) rather than the proxied domain, but then it will be easier to problem shoot individual server instances using plain gis-tools that utilize metadata such as ows_onlineresource. We tested this some years ago, and have the following expereience using a reverse proxy in front of a mapserver cluster: http -> http ows_onlineresource will use http://whatever.domain.reached.by.frontend.com/path/to/mapservice https -> https will use https://whatever.domain.reached.by.frontend.com/path/to/mapservice https -> http (ssl-offloading) will unfortunately use http://blablabla, even if we set forward proto and forwarded port on the proxy-end. It would be nice if mapserver could use an ssl-offloading proxy, be it haproxy, nginx or something else. So, the ows_onlineresource-problem was solved for us by having a fail-over frontend holding the domains, and different mapserver-clusters for load balancing and fail-over - we just had to live with configuring certificates also for the backend servers for the different environments (domains). -- Kind regards Bj?rn Ove Gr?tan From trygve at aspenes.priv.no Wed Apr 20 23:38:11 2022 From: trygve at aspenes.priv.no (Trygve Aspenes) Date: Thu, 21 Apr 2022 08:38:11 +0200 Subject: [mapserver-users] Mapserver: get map config file from remote url? Message-ID: Hi Is it possible for mapserver to get the map configuration file from a remote url? like http://mapserver/map=http://map-file-host/map-file.map I have tried to look at the documentation, but could not find any hints that this is possible. I know I can use like vsicurl in the map file itself to get rasters from a remote url. Trygve Aspenes From joerg.thomsen at wheregroup.com Wed Apr 20 23:47:23 2022 From: joerg.thomsen at wheregroup.com (=?UTF-8?Q?J=c3=b6rg_Thomsen_=28WhereGroup=29?=) Date: Thu, 21 Apr 2022 08:47:23 +0200 Subject: [mapserver-users] Mapserver: get map config file from remote url? In-Reply-To: References: Message-ID: <5b825b0d-24d1-81b9-e5b1-f8d95f2b600f@wheregroup.com> Hi, as far as i know the mapfile has to be accessible via the file system. A remote url would be a high security problem. J?rg Am 21.04.22 um 08:38 schrieb Trygve Aspenes: > Hi > > Is it possible for mapserver to get the map configuration file from a > remote url? > > like http://mapserver/map=http://map-file-host/map-file.map > > I have tried to look at the documentation, but could not find any hints > that this is possible. I know I can use like vsicurl in the map file > itself to get rasters from a remote url. > > Trygve Aspenes > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users -- Viele Gr??e, J?rg Thomsen --------------------------------------------- Aufwind durch Wissen! Jetzt neu: Web-Seminare und Online-Schulungen bei der www.foss-academy.com --------------------------------------------- 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 From cgodkin at gmail.com Mon Apr 25 08:25:41 2022 From: cgodkin at gmail.com (Carl Godkin) Date: Mon, 25 Apr 2022 08:25:41 -0700 Subject: [mapserver-users] Using MBTiles with MapServer Message-ID: Hi, I have a working MapServer WMS server where the size of the input imagery data is becoming a concern. I used gdal_translate to convert our input satellite imagery files to .mbtiles format and it's now about 20% of the size of the GeoTIFF files I had been using before. (The GeoTIFF files are compressed and have overviews.) This seems promising. I have added a new LAYER to my .map file for the converted data but I cannot get MapServer to display the imagery as I expected. It's all black (or more likely, transparent). As a test, I converted one of the .mbtiles files back to GeoTIFF and it still looks fine to me so I don't think my conversion (a pretty simple gdal_translate command line) messed it up. I have the debug logging in MapServer set to 5 and can see the queries coming through and no obvious errors. For instance: # shp2img -m mapserver.map -l "NAIP_mbtiles" -o /test.png -all_debug 5 msLoadMap(): 0.010s msDrawMap(): rendering using outputformat named GEOTIFF (GDAL/GTiff). msDrawMap(): WMS/WFS set-up and query, 0.000s msDrawRasterLayerLow(NAIP_mbtiles): entering. freeLayer(): freeing layer at 0x55d543267ac0. msDrawMap(): Layer 2 (NAIP_mbtiles), 0.005s msDrawMap(): Drawing Label Cache, 0.000s msDrawMap() total time: 0.006s msSaveImage(/test.png) total time: 0.011s msFreeMap(): freeing map at 0x55d542ee5680. freeLayer(): freeing layer at 0x55d543223250. freeLayer(): freeing layer at 0x55d5432262e0. freeLayer(): freeing layer at 0x55d54323e350. shp2img total time: 0.026s I using the "camptocamp" docker image for MapServer and it has this version: # mapserv -v MapServer version 7.6.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS SUPPORTS=POINT_Z_M SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE As far as I can tell, its version of GDAL supports MBTiles. (It's listed among the "gdalinfo --formats" output among other evidence.) Does anyone have any suggestions? I can't find discussion of the .mbtiles format in the docs except around Mapcache and Google hasn't found me anything useful so far. Thanks a lot, carl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmckenna at gatewaygeomatics.com Mon Apr 25 12:32:12 2022 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Mon, 25 Apr 2022 16:32:12 -0300 Subject: [mapserver-users] FlatGeoBuf access (and WFS output) steps in MapServer Message-ID: Hi all, I've spent some effort to document how to enable the optimized FlatGeobuf (FGB) format for vectors in MapServer, for both reading/access as well as steps to output FGB through WFS (you could also use these same steps for WMS GetFeatureInfo output of FGB as well): https://mapserver.org/input/vector/flatgeobuf.html The user community might be interested also in some performance testing that I've done with FlatGeobuf with MapServer (hardcore developers might question my exact methods, but for general users these results should be interesting). I've added the results as a note in the Vector Optimization document ( https://mapserver.org/optimization/vector.html ) I used shp2img/map2img to test the map drawing speed for a few popular vector formats (note that these are averaged times, and are not done on a cold connection), with the latest MapServer 8.0-dev code on Windows through MS4W: Shapefile 0.011s FlatGeobuf 0.014s GeoPackage 0.042s SpatiaLite 0.045s PostGIS 0.053s GeoJSON 0.089s The point is not to cause controversy or start analyzing my simple testing methods, but instead to generally show how optimized FlatGeobuf is for rendering (and filtering) in MapServer, and that we should all be considering this format for sharing vectors through our MapServer services. Thanks, -jeff -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ From lars.schylberg at blixtmail.se Mon Apr 25 13:34:02 2022 From: lars.schylberg at blixtmail.se (Lars Schylberg) Date: Mon, 25 Apr 2022 22:34:02 +0200 Subject: [mapserver-users] FlatGeoBuf access (and WFS output) steps in MapServer In-Reply-To: References: Message-ID: <1c8978e0-4004-50de-81f3-895923d9bbb4@blixtmail.se> Thanks Jeff, This is very useful information.? I have been experimenting with FlatGeobuf for the last couple of weeks, but I missed the part about setting verify buffer to No. I must continue now to optimize my mapfiles tomorrow. Generally, I am very pleased with the FlatGeobuf files in Mapserver so far. /Lars Schylberg Den 2022-04-25 kl. 21:32, skrev Jeff McKenna: > Hi all, > > I've spent some effort to document how to enable the optimized > FlatGeobuf (FGB) format for vectors in MapServer, for both > reading/access as well as steps to output FGB through WFS (you could > also use these same steps for WMS GetFeatureInfo output of FGB as > well): https://mapserver.org/input/vector/flatgeobuf.html > > The user community might be interested also in some performance > testing that I've done with FlatGeobuf with MapServer (hardcore > developers might question my exact methods, but for general users > these results should be interesting).? I've added the results as a > note in the Vector Optimization document ( > https://mapserver.org/optimization/vector.html ) > > I used shp2img/map2img to test the map drawing speed for a few popular > vector formats (note that these are averaged times, and are not done > on a cold connection), with the latest MapServer 8.0-dev code on > Windows through MS4W: > > ? Shapefile? 0.011s > ? FlatGeobuf 0.014s > ? GeoPackage 0.042s > ? SpatiaLite 0.045s > ? PostGIS??? 0.053s > ? GeoJSON??? 0.089s > > The point is not to cause controversy or start analyzing my simple > testing methods, but instead to generally show how optimized > FlatGeobuf is for rendering (and filtering) in MapServer, and that we > should all be considering this format for sharing vectors through our > MapServer services. > > Thanks, > > -jeff > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maelscuttle at gmail.com Thu Apr 28 02:42:41 2022 From: maelscuttle at gmail.com (=?UTF-8?Q?ma=C3=ABlle_lapriel?=) Date: Thu, 28 Apr 2022 11:42:41 +0200 Subject: [mapserver-users] MapScript import errors (Module not found) in Python venv with global install Message-ID: I'm trying to write a PyQGIS standalone script which utilizes MapScript for certain tasks. In a first attempt, I basically did this: - I installed MapScript globally with pip and using the Python 3.9.5 interpreter which ships with QGIS 3.22.6 (also includes wheel) - Created a venv with --system-site-packages - Downloaded the appropriate Windows binary build of MapServer from GISInternals (release-1928-x64-gdal-3-4-mapserver-7-6) and extracted into C:\MapServer\ - Set the MAPSERVER_DLL_PATH to C:\MapServer\bin However, whenever I try to load MapScript, it yields the following: Traceback (most recent call last): File "", line 1, in File "C:\QGIS\apps\Python39\lib\site-packages\mapscript\__init__.py", line 2, in from .mapscript import * File "C:\QGIS\apps\Python39\lib\site-packages\mapscript\mapscript.py", line 13, in from . import _mapscript ImportError: DLL load failed while importing _mapscript: The specified module could not be found. As to where the README over at github indicates that this means MapServer.dll can't be found. In order to rule out possible issues, I also tried the following: - Not creating a venv, but using it with the QGIS python version directly - Installing MapScript into normal installations of python 3.7, 3.8, 3.9, 3.10 - Using it together with the latest builds of MapServer (1930) - Not installing MapScript with pip but copying over mapscript.py and _mapscript.pyd from the respective MapServer builds - Adding C:\MapServer\bin to PATH instead of the new env variable All with the same result. The only ever combination I got it working is when installing the MapScript globally using python3.6/pip and the old MapServer release-1911 (7.6.1), where I sadly can't import PyQGIS in the version I need. What could be the issue here? Kind regards, Ma?lle -------------- next part -------------- An HTML attachment was scrubbed... URL: From sethg at geographika.co.uk Thu Apr 28 09:25:25 2022 From: sethg at geographika.co.uk (Seth G) Date: Thu, 28 Apr 2022 18:25:25 +0200 Subject: [mapserver-users] MapScript import errors (Module not found) in Python venv with global install In-Reply-To: References: Message-ID: Hi Ma?lle, MapScript (and MapServer) use many of the same dependent DLLs as QGIS - GDAL, Proj, GEOS etc. which would then get loaded into memory by Python. For everything to work correctly, all these dependencies would have to be the same version, and (I think this is still the case), compiled with the same version of Microsoft Visual C (the 1928, 1931 etc. use when naming the GISInternals zips). It probably would be possible to get everything build and working, but you'd likely have to compile everything yourself. Is it possible to modify your workflow so a PyQGIS environment dumps out data to disk and then a MapScript environment works on this data? I'd imagine PyQGIS can probably do everything MapScript can, except for manipulate Mapfiles - you could take a look at mappyfile for this, which is Python only has has no dependent DLLs. Seth -- web:https://geographika.net twitter: @geographika On Thu, Apr 28, 2022, at 11:42 AM, ma?lle lapriel wrote: > I'm trying to write a PyQGIS standalone script which utilizes MapScript for certain tasks. In a first attempt, I basically did this: > > - I installed MapScript globally with pip and using the Python 3.9.5 interpreter which ships with QGIS 3.22.6 (also includes wheel) > - Created a venv with --system-site-packages > - Downloaded the appropriate Windows binary build of MapServer from GISInternals (release-1928-x64-gdal-3-4-mapserver-7-6) and extracted into C:\MapServer\ > - Set the MAPSERVER_DLL_PATH to C:\MapServer\bin > > However, whenever I try to load MapScript, it yields the following: > > Traceback (most recent call last): > File "", line 1, in > File "C:\QGIS\apps\Python39\lib\site-packages\mapscript\__init__.py", line 2, in > from .mapscript import * > File "C:\QGIS\apps\Python39\lib\site-packages\mapscript\mapscript.py", line 13, in > from . import _mapscript > ImportError: DLL load failed while importing _mapscript: The specified module could not be found. > > As to where the README over at github indicates that this means MapServer.dll can't be found. > > In order to rule out possible issues, I also tried the following: > > - Not creating a venv, but using it with the QGIS python version directly > - Installing MapScript into normal installations of python 3.7, 3.8, 3.9, 3.10 > - Using it together with the latest builds of MapServer (1930) > - Not installing MapScript with pip but copying over mapscript.py and _mapscript.pyd from the respective MapServer builds > - Adding C:\MapServer\bin to PATH instead of the new env variable > > All with the same result. The only ever combination I got it working is when installing the MapScript globally using python3.6/pip and the old MapServer release-1911 (7.6.1), where I sadly can't import PyQGIS in the version I need. > > What could be the issue here? > > Kind regards, Ma?lle > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jukka.rahkonen at maanmittauslaitos.fi Thu Apr 28 23:23:50 2022 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Fri, 29 Apr 2022 06:23:50 +0000 Subject: [mapserver-users] Any trick to buffer labelpoly? Message-ID: <2dfabdd9d1fd47d2b05b28c342ba2876@maanmittauslaitos.fi> Hi, There is a wish to buffer the labelpoly in https://gis.stackexchange.com/questions/429779/mapserver-background-buffer-around-labels-geomtransform-labelpoly but it does not seem to be supported directly. Can anybody suggest a trick or workaround? -Jukka Rahkonen- -------------- next part -------------- An HTML attachment was scrubbed... URL: From maelscuttle at gmail.com Fri Apr 29 01:02:02 2022 From: maelscuttle at gmail.com (=?UTF-8?Q?ma=C3=ABlle_lapriel?=) Date: Fri, 29 Apr 2022 10:02:02 +0200 Subject: [mapserver-users] MapScript import errors (Module not found) in Python venv with global install In-Reply-To: References: Message-ID: Maybe to add (and also because I forgot to add the mailing list to the recipients) - sadly using Mappyfile isn't really an option, as I'm intending to use the SLD-specific features of MapScript. On Fri, 29 Apr 2022 at 09:08, ma?lle lapriel wrote: > Hi Seth, > > I've considered this to be the problem, however I can rule out any > dependency conflicts already since I also tried to simply just get > MapScript running in a Python env without any other imports. > Am I assuming right that for just using MapScript alone, I can just run > the SDKShell.bat to have all the variables set, then take a Python version > that matches the GISInternals build and I'm good to go? Because that > already yields mentioned import errors, with every possible build or Python > version except 3.6 and MapServer 7.6.1, which also stops working as soon as > I set up a venv. > > Thank you very much for your help. > > Cheers > > On Thu, Apr 28, 2022, 18:25 Seth G wrote: > >> Hi Ma?lle, >> >> MapScript (and MapServer) use many of the same dependent DLLs as QGIS - >> GDAL, Proj, GEOS etc. which would then get loaded into memory by Python. >> For everything to work correctly, all these dependencies would have to be >> the same version, and (I think this is still the case), compiled with the >> same version of Microsoft Visual C (the 1928, 1931 etc. use when naming the >> GISInternals zips). >> It probably would be possible to get everything build and working, but >> you'd likely have to compile everything yourself. >> Is it possible to modify your workflow so a PyQGIS environment dumps out >> data to disk and then a MapScript environment works on this data? >> I'd imagine PyQGIS can probably do everything MapScript can, except for >> manipulate Mapfiles - you could take a look at mappyfile for this, which is >> Python only has has no dependent DLLs. >> >> Seth >> >> -- >> web:https://geographika.net >> twitter: @geographika >> >> >> On Thu, Apr 28, 2022, at 11:42 AM, ma?lle lapriel wrote: >> >> I'm trying to write a PyQGIS standalone script which utilizes MapScript >> for certain tasks. In a first attempt, I basically did this: >> >> - I installed MapScript globally with pip and using the Python 3.9.5 >> interpreter which ships with QGIS 3.22.6 (also includes wheel) >> - Created a venv with --system-site-packages >> - Downloaded the appropriate Windows binary build of MapServer from >> GISInternals (release-1928-x64-gdal-3-4-mapserver-7-6) and extracted into >> C:\MapServer\ >> - Set the MAPSERVER_DLL_PATH to C:\MapServer\bin >> >> However, whenever I try to load MapScript, it yields the following: >> >> Traceback (most recent call last): >> File "", line 1, in >> File "C:\QGIS\apps\Python39\lib\site-packages\mapscript\__init__.py", >> line 2, in >> from .mapscript import * >> File "C:\QGIS\apps\Python39\lib\site-packages\mapscript\mapscript.py", >> line 13, in >> from . import _mapscript >> ImportError: DLL load failed while importing _mapscript: The specified >> module could not be found. >> >> As to where the README over at github indicates that this means >> MapServer.dll can't be found. >> >> In order to rule out possible issues, I also tried the following: >> >> - Not creating a venv, but using it with the QGIS python version directly >> - Installing MapScript into normal installations of python 3.7, 3.8, 3.9, >> 3.10 >> - Using it together with the latest builds of MapServer (1930) >> - Not installing MapScript with pip but copying over mapscript.py and >> _mapscript.pyd from the respective MapServer builds >> - Adding C:\MapServer\bin to PATH instead of the new env variable >> >> All with the same result. The only ever combination I got it working is >> when installing the MapScript globally using python3.6/pip and the old >> MapServer release-1911 (7.6.1), where I sadly can't import PyQGIS in the >> version I need. >> >> What could be the issue here? >> >> Kind regards, Ma?lle >> _______________________________________________ >> MapServer-users mailing list >> MapServer-users at lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/mapserver-users >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From sethg at geographika.co.uk Fri Apr 29 01:14:53 2022 From: sethg at geographika.co.uk (Seth G) Date: Fri, 29 Apr 2022 10:14:53 +0200 Subject: [mapserver-users] MapScript import errors (Module not found) in Python venv with global install In-Reply-To: References: Message-ID: <74a303ee-270f-4cfe-87e5-1214fcdb9743@www.fastmail.com> Hi, As you wrote, the version of Python needs to match the version of Python used by GISInternals (which is different dependent on the package) e.g. https://www.gisinternals.com/packageinfo.php?file=release-1928-x64-gdal-3-4-2-mapserver-7-6-4.zip - "python - Python37-AMD64" Is everything working fine until you setup a virtual environment? This could be because activating a Python virtual environment on Windows seems to wipe out any previously set environment variables in the session. Try activating the virtual environment, and then running SDKShell.bat (or simply setting the environment variables you need from that file). SET PATH=C:\MapServer\bin;%PATH% SET PROJ_LIB=C:\MapServer\proj7\SHARE SET MAPSERVER_DLL_PATH=C:\MapServer\bin I have some experimental MapScript Wheels [1] built for various versions of Python with a recent MapServer development build, which could work with a release-1930-x64 development build [2]. Seth [1] https://github.com/geographika/python-mapscript/tree/main/wheels [2] https://www.gisinternals.com/query.html?content=filelist&file=release-1930-x64-gdal-mapserver.zip -- web:https://geographika.net twitter: @geographika On Fri, Apr 29, 2022, at 9:08 AM, ma?lle lapriel wrote: > Hi Seth, > > I've considered this to be the problem, however I can rule out any dependency conflicts already since I also tried to simply just get MapScript running in a Python env without any other imports. > Am I assuming right that for just using MapScript alone, I can just run the SDKShell.bat to have all the variables set, then take a Python version that matches the GISInternals build and I'm good to go? Because that already yields mentioned import errors, with every possible build or Python version except 3.6 and MapServer 7.6.1, which also stops working as soon as I set up a venv. > > Thank you very much for your help. > > Cheers > > On Thu, Apr 28, 2022, 18:25 Seth G wrote: >> __ >> Hi Ma?lle, >> >> MapScript (and MapServer) use many of the same dependent DLLs as QGIS - GDAL, Proj, GEOS etc. which would then get loaded into memory by Python. >> For everything to work correctly, all these dependencies would have to be the same version, and (I think this is still the case), compiled with the same version of Microsoft Visual C (the 1928, 1931 etc. use when naming the GISInternals zips). >> It probably would be possible to get everything build and working, but you'd likely have to compile everything yourself. >> Is it possible to modify your workflow so a PyQGIS environment dumps out data to disk and then a MapScript environment works on this data? >> I'd imagine PyQGIS can probably do everything MapScript can, except for manipulate Mapfiles - you could take a look at mappyfile for this, which is Python only has has no dependent DLLs. >> >> Seth >> >> -- >> web:https://geographika.net >> twitter: @geographika >> >> >> On Thu, Apr 28, 2022, at 11:42 AM, ma?lle lapriel wrote: >>> I'm trying to write a PyQGIS standalone script which utilizes MapScript for certain tasks. In a first attempt, I basically did this: >>> >>> - I installed MapScript globally with pip and using the Python 3.9.5 interpreter which ships with QGIS 3.22.6 (also includes wheel) >>> - Created a venv with --system-site-packages >>> - Downloaded the appropriate Windows binary build of MapServer from GISInternals (release-1928-x64-gdal-3-4-mapserver-7-6) and extracted into C:\MapServer\ >>> - Set the MAPSERVER_DLL_PATH to C:\MapServer\bin >>> >>> However, whenever I try to load MapScript, it yields the following: >>> >>> Traceback (most recent call last): >>> File "", line 1, in >>> File "C:\QGIS\apps\Python39\lib\site-packages\mapscript\__init__.py", line 2, in >>> from .mapscript import * >>> File "C:\QGIS\apps\Python39\lib\site-packages\mapscript\mapscript.py", line 13, in >>> from . import _mapscript >>> ImportError: DLL load failed while importing _mapscript: The specified module could not be found. >>> >>> As to where the README over at github indicates that this means MapServer.dll can't be found. >>> >>> In order to rule out possible issues, I also tried the following: >>> >>> - Not creating a venv, but using it with the QGIS python version directly >>> - Installing MapScript into normal installations of python 3.7, 3.8, 3.9, 3.10 >>> - Using it together with the latest builds of MapServer (1930) >>> - Not installing MapScript with pip but copying over mapscript.py and _mapscript.pyd from the respective MapServer builds >>> - Adding C:\MapServer\bin to PATH instead of the new env variable >>> >>> All with the same result. The only ever combination I got it working is when installing the MapScript globally using python3.6/pip and the old MapServer release-1911 (7.6.1), where I sadly can't import PyQGIS in the version I need. >>> >>> What could be the issue here? >>> >>> Kind regards, Ma?lle >>> _______________________________________________ >>> MapServer-users mailing list >>> MapServer-users at lists.osgeo.org >>> https://lists.osgeo.org/mailman/listinfo/mapserver-users >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdlime at gmail.com Fri Apr 29 07:06:52 2022 From: sdlime at gmail.com (Steve Lime) Date: Fri, 29 Apr 2022 09:06:52 -0500 Subject: [mapserver-users] Any trick to buffer labelpoly? In-Reply-To: <2dfabdd9d1fd47d2b05b28c342ba2876@maanmittauslaitos.fi> References: <2dfabdd9d1fd47d2b05b28c342ba2876@maanmittauslaitos.fi> Message-ID: Looks like there were some new responses on the post referenced. Will those work for you? Otherwise we?d have to re-think the label poly geomtranform to either allow an argument or be embedded in a more complex expression. On Fri, Apr 29, 2022 at 1:24 AM Rahkonen Jukka (MML) < jukka.rahkonen at maanmittauslaitos.fi> wrote: > Hi, > > > > There is a wish to buffer the labelpoly in > https://gis.stackexchange.com/questions/429779/mapserver-background-buffer-around-labels-geomtransform-labelpoly > but it does not seem to be supported directly. Can anybody suggest a trick > or workaround? > > > > -Jukka Rahkonen- > > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: