From MarkVolz at co.lyon.mn.us Thu Dec 1 06:34:57 2022
From: MarkVolz at co.lyon.mn.us (Mark Volz)
Date: Thu, 1 Dec 2022 14:34:57 +0000
Subject: [MapServer-users] Possible issue between MapCache WMTS,
the new ArcGIS Online Viewer, and the Web App Builder
Message-ID: <5ca4c64eabda4002b9dbb0b56c5d24b0@co.lyon.mn.us>
Hello,
I noticed that MapCache WMTS basemaps do not display in ESRI's Web Application Builder when I create the map in the "New Map Viewer." However, if I create the map with "Map Viewer Classic" then the tiles appear appropriately in the Web Application Builder. ESRI thinks that this is a possible bug on their end, but it also could be a misconfiguration on my end as well.
Questions and thoughts:
1. If other people are having this issue then please try using the Map Viewer Classic and has anyone had success with the new map viewer?
2. Please let me know if my configuration below looks appropriate.
3. ESRI asked if I would like to continue debugging this issue. Would any of the developers want to be included in this discussion?
Thanks!
GoogleBingArcGISCompatible
urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible
-20037508.3427892480 -20037508.3427892480 20037508.3427892480 20037508.3427892480
EPSG:3857
EPSG:900913
m
256 256
156543.0339280410 78271.51696402048 39135.75848201023 19567.87924100512 9783.939620502561 4891.969810251280 2445.984905125640 1222.992452562820 611.4962262814100 305.7481131407048 152.8740565703525 76.43702828517624 38.21851414258813 19.10925707129406 9.554628535647032 4.777314267823516 2.388657133911758 1.194328566955879 0.5971642834779395 0.29858214173896975 0.149291070869484875 0.074645535434742 0.037322767717371
Sincerely,
Mark Volz, GISP
Lyon County GIS Coordinator
Ph: (507) 532-8218
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From ijturton at gmail.com Thu Dec 1 07:50:10 2022
From: ijturton at gmail.com (Ian Turton)
Date: Thu, 1 Dec 2022 15:50:10 +0000
Subject: [MapServer-users] converting an expression to an OGC filter
Message-ID:
I currently have an expression in my mapfile EXPRESSION ('[postcode]' ~*
'0..$') and I'm in the process of moving to using SLD for styling - I
thought I could convert that expression to
postcode
.*0..
Which I think should match from the start of the string (.*) to a 0
and then two characters (..) to the end of the string. But it doesn't
work - neither does any variant on this work either.
Is there some issue with conversions between SLD Filters and internal
expressions that I'm missing or is there something else I should know
about LIKE filters?
Thanks
Ian
--
Ian Turton
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From ijturton at gmail.com Fri Dec 2 01:47:58 2022
From: ijturton at gmail.com (Ian Turton)
Date: Fri, 2 Dec 2022 09:47:58 +0000
Subject: [MapServer-users] converting an expression to an OGC filter
In-Reply-To:
References:
Message-ID:
On Thu, 1 Dec 2022 at 22:13, Lime, Steve D (MNIT)
wrote:
> Hi Ian: What?s the backend (e.g. shapefile, PostGIS, etc?)? MapServer
> expressions don?t support a wildcard operator (outside of a regex) so I?m
> not sure off the top of my head and things may vary by driver.
>
It's a postgis database on the backend, the original expression works fine
but not when it's input as an OGC expression.
Ian
>
>
> --Steve
>
>
>
> *From:* MapServer-users *On
> Behalf Of *Ian Turton
> *Sent:* Thursday, December 1, 2022 9:50 AM
> *To:* mapserver-users at lists.osgeo.org
> *Subject:* [MapServer-users] converting an expression to an OGC filter
>
>
>
> I currently have an expression in my mapfile EXPRESSION ('[postcode]' ~*
> '0..$') and I'm in the process of moving to using SLD for styling - I
> thought I could convert that expression to
>
>
>
>
>
> postcode
>
> .*0..
>
>
>
> Which I think should match from the start of the string (.*) to a 0 and then two characters (..) to the end of the string. But it doesn't work - neither does any variant on this work either.
>
> Is there some issue with conversions between SLD Filters and internal expressions that I'm missing or is there something else I should know about LIKE filters?
>
> Thanks
>
>
>
> Ian
>
> --
>
> Ian Turton
>
--
Ian Turton
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From Andreas.Eichner at sid.sachsen.de Fri Dec 2 06:45:00 2022
From: Andreas.Eichner at sid.sachsen.de (Eichner, Andreas - SID)
Date: Fri, 2 Dec 2022 14:45:00 +0000
Subject: [MapServer-users] converting an expression to an OGC filter
In-Reply-To:
References:
Message-ID: <1223469d185c428b82dce418eed11f8f@sid.sachsen.de>
Your pattern seems to be wrong. You originally used a case insensitive regex 0..$ meaning a value shall end with a '0' and to other arbitrary characters. Your PropertyIsLike filter is translated into an SQL "like": (for Postgres)
postcode::text ilike '_%0__'
meaning a string as a whole shall consist of an arbitrary character followed by zero or more arbitrary characters followed by a '0' and two additional arbitrary characters. The corresponding regex would look like ^..*0..$
So I guess you would like want to use *0.. as pattern:
postcode
*0..
Regards, Andreas
-----Urspr?ngliche Nachricht-----
Von: MapServer-users Im Auftrag von Ian Turton
Gesendet: Freitag, 2. Dezember 2022 10:48
An: steve.lime at state.mn.us; mapserver-users at lists.osgeo.org
Betreff: Re: [MapServer-users] converting an expression to an OGC filter
On Thu, 1 Dec 2022 at 22:13, Lime, Steve D (MNIT) > wrote:
Hi Ian: What?s the backend (e.g. shapefile, PostGIS, etc?)? MapServer expressions don?t support a wildcard operator (outside of a regex) so I?m not sure off the top of my head and things may vary by driver.
It's a postgis database on the backend, the original expression works fine but not when it's input as an OGC expression.
Ian
--Steve
From: MapServer-users > On Behalf Of Ian Turton
Sent: Thursday, December 1, 2022 9:50 AM
To: mapserver-users at lists.osgeo.org
Subject: [MapServer-users] converting an expression to an OGC filter
I currently have an expression in my mapfile EXPRESSION ('[postcode]' ~* '0..$') and I'm in the process of moving to using SLD for styling - I thought I could convert that expression to
postcode
.*0..
Which I think should match from the start of the string (.*) to a 0 and then two characters (..) to the end of the string. But it doesn't work - neither does any variant on this work either.
Is there some issue with conversions between SLD Filters and internal expressions that I'm missing or is there something else I should know about LIKE filters?
Thanks
Ian
--
Ian Turton
--
Ian Turton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2500 bytes
Desc: not available
URL:
From mniemyjski at cloudferro.com Fri Dec 2 06:46:13 2022
From: mniemyjski at cloudferro.com (Marcin Niemyjski)
Date: Fri, 2 Dec 2022 14:46:13 +0000
Subject: [MapServer-users] Mapserver on k8s weird behaviour
Message-ID:
Hello,
I am using Mapserver on Kubernetes (LoadBalancer). Everything works great - GetMap, GetCapabilities, layers load correctly in QGIS and Leaflet.
However, what caught my attention is that when passing the mapfile's url using LoadBalancer/Kubernetes IP, only the first time the message is
msLoadMap(): Regular expression error. MS_DEFAULT_MAPFILE_PATTERN validation failed
and every time thereafter
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
By refreshing a few times, you may get the expected message again, but this is random. As I mentioned - layers and requests load correctly everywhere (also after repeated refreshing). Should I be concerned? I would love to understand why is this happening ^^
Sample mapfile (but problem occured on all those tested):
https://pastecode.io/s/pfaudfef
As always - thank you,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From steve.lime at state.mn.us Fri Dec 2 07:23:42 2022
From: steve.lime at state.mn.us (Lime, Steve D (MNIT))
Date: Fri, 2 Dec 2022 15:23:42 +0000
Subject: [MapServer-users] Mapserver on k8s weird behaviour
In-Reply-To:
References:
Message-ID:
Hi Marcin: Are you using FastCGI? Which version of MapServer? We ran into something similar w/FastCGI and version 8 during development where you'd see the first instance of an error message but then the server error subsequently. It was consistent on some setups but never happened on others. You could try applying the fix (see https://github.com/MapServer/MapServer/pull/6577) locally and see if that fixes things. It will be backported to the 7.6 branch in the near future.
--Steve
From: MapServer-users On Behalf Of Marcin Niemyjski via MapServer-users
Sent: Friday, December 2, 2022 8:46 AM
To: Marcin Niemyjski via MapServer-users
Subject: [MapServer-users] Mapserver on k8s weird behaviour
Hello,
I am using Mapserver on Kubernetes (LoadBalancer). Everything works great - GetMap, GetCapabilities, layers load correctly in QGIS and Leaflet.
However, what caught my attention is that when passing the mapfile's url using LoadBalancer/Kubernetes IP, only the first time the message is
msLoadMap(): Regular expression error. MS_DEFAULT_MAPFILE_PATTERN validation failed
and every time thereafter
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
By refreshing a few times, you may get the expected message again, but this is random. As I mentioned - layers and requests load correctly everywhere (also after repeated refreshing). Should I be concerned? I would love to understand why is this happening ^^
Sample mapfile (but problem occured on all those tested):
https://pastecode.io/s/pfaudfef
As always - thank you,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From mniemyjski at cloudferro.com Fri Dec 2 07:32:51 2022
From: mniemyjski at cloudferro.com (Marcin Niemyjski)
Date: Fri, 2 Dec 2022 15:32:51 +0000
Subject: [MapServer-users] Mapserver on k8s weird behaviour
In-Reply-To:
References:
Message-ID:
Steve,
I'm using Mapserver 8 from camptocamp/mapserver https://hub.docker.com/r/camptocamp/mapserver
Best,
Marcin
________________________________
From: Lime, Steve D (MNIT)
Sent: Friday, December 2, 2022 4:23 PM
To: Marcin Niemyjski ; Marcin Niemyjski via MapServer-users
Subject: RE: Mapserver on k8s weird behaviour
Hi Marcin: Are you using FastCGI? Which version of MapServer? We ran into something similar w/FastCGI and version 8 during development where you?d see the first instance of an error message but then the server error subsequently. It was consistent on some setups but never happened on others. You could try applying the fix (see https://github.com/MapServer/MapServer/pull/6577) locally and see if that fixes things. It will be backported to the 7.6 branch in the near future.
--Steve
From: MapServer-users On Behalf Of Marcin Niemyjski via MapServer-users
Sent: Friday, December 2, 2022 8:46 AM
To: Marcin Niemyjski via MapServer-users
Subject: [MapServer-users] Mapserver on k8s weird behaviour
Hello,
I am using Mapserver on Kubernetes (LoadBalancer). Everything works great - GetMap, GetCapabilities, layers load correctly in QGIS and Leaflet.
However, what caught my attention is that when passing the mapfile's url using LoadBalancer/Kubernetes IP, only the first time the message is
msLoadMap(): Regular expression error. MS_DEFAULT_MAPFILE_PATTERN validation failed
and every time thereafter
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
By refreshing a few times, you may get the expected message again, but this is random. As I mentioned - layers and requests load correctly everywhere (also after repeated refreshing). Should I be concerned? I would love to understand why is this happening ^^
Sample mapfile (but problem occured on all those tested):
https://pastecode.io/s/pfaudfef
As always - thank you,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From steve.lime at state.mn.us Fri Dec 2 08:16:45 2022
From: steve.lime at state.mn.us (Lime, Steve D (MNIT))
Date: Fri, 2 Dec 2022 16:16:45 +0000
Subject: [MapServer-users] Mapserver on k8s weird behaviour
In-Reply-To:
References:
Message-ID:
Based on that error message you're not running MapServer 8.0 though. That was an area that changed between v.7 and v.8 and the error message was updated. V.8 outputs something like:
msLoadMap(): Regular expression error. Filename validation failed.
--Steve
From: Marcin Niemyjski
Sent: Friday, December 2, 2022 9:33 AM
To: Lime, Steve D (MNIT) ; Marcin Niemyjski via MapServer-users
Subject: Re: Mapserver on k8s weird behaviour
Steve,
I'm using Mapserver 8 from camptocamp/mapserver https://hub.docker.com/r/camptocamp/mapserver
Best,
Marcin
________________________________
From: Lime, Steve D (MNIT) >
Sent: Friday, December 2, 2022 4:23 PM
To: Marcin Niemyjski >; Marcin Niemyjski via MapServer-users >
Subject: RE: Mapserver on k8s weird behaviour
Hi Marcin: Are you using FastCGI? Which version of MapServer? We ran into something similar w/FastCGI and version 8 during development where you'd see the first instance of an error message but then the server error subsequently. It was consistent on some setups but never happened on others. You could try applying the fix (see https://github.com/MapServer/MapServer/pull/6577) locally and see if that fixes things. It will be backported to the 7.6 branch in the near future.
--Steve
From: MapServer-users > On Behalf Of Marcin Niemyjski via MapServer-users
Sent: Friday, December 2, 2022 8:46 AM
To: Marcin Niemyjski via MapServer-users >
Subject: [MapServer-users] Mapserver on k8s weird behaviour
Hello,
I am using Mapserver on Kubernetes (LoadBalancer). Everything works great - GetMap, GetCapabilities, layers load correctly in QGIS and Leaflet.
However, what caught my attention is that when passing the mapfile's url using LoadBalancer/Kubernetes IP, only the first time the message is
msLoadMap(): Regular expression error. MS_DEFAULT_MAPFILE_PATTERN validation failed
and every time thereafter
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
By refreshing a few times, you may get the expected message again, but this is random. As I mentioned - layers and requests load correctly everywhere (also after repeated refreshing). Should I be concerned? I would love to understand why is this happening ^^
Sample mapfile (but problem occured on all those tested):
https://pastecode.io/s/pfaudfef
As always - thank you,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From bahbouba.909 at gmail.com Sun Dec 4 17:42:21 2022
From: bahbouba.909 at gmail.com (Boubacar Bah)
Date: Mon, 5 Dec 2022 02:42:21 +0100
Subject: [MapServer-users] asking help
Message-ID:
hi everyone i would like to make a cgi proxy for openlayer ProxyHost from
ms4w here is the code link of my source code: https://pastebin.com/y32K2qdK
I don't know what is missing in this code.
when I file error I see the following message:* [cgi:error] [pid 6660:tid
224] [client 127.0.0.1:58543 ] Premature end of
script headers: proxy.cgi*
I do not know what to do anymore; I really need your help
thank you in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From bfraser at geoanalytic.com Mon Dec 5 06:10:58 2022
From: bfraser at geoanalytic.com (Brent Fraser)
Date: Mon, 5 Dec 2022 07:10:58 -0700
Subject: [MapServer-users] asking help
In-Reply-To:
References:
Message-ID:
Try adding two newlines to the end of your "Content-Type" headers like
print ("Content-Type: text/plain\n\n")
----------------------------------------
From: "Boubacar Bah"
Sent: 12/4/22 6:57 PM
To: mapserver-users at lists.osgeo.org
Subject: [MapServer-users] asking help
hi everyone i would like to make a cgi proxy for openlayer ProxyHost from ms4w here is the code link of my source code: https://pastebin.com/y32K2qdK
I don't know what is missing in this code.
when I file error I see the following message: [cgi:error] [pid 6660:tid 224] [client 127.0.0.1:58543] Premature end of script headers: proxy.cgi
I do not know what to do anymore; I really need your help
thank you in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From mniemyjski at cloudferro.com Tue Dec 6 09:18:27 2022
From: mniemyjski at cloudferro.com (Marcin Niemyjski)
Date: Tue, 6 Dec 2022 17:18:27 +0000
Subject: [MapServer-users] Problems with vrt created from GCP raster
Message-ID:
Hello,
up to now, I have been working with VRT as a carrier for the rasters I wanted to use in the mapfile. Now in order to use the rasters that were provided to me (they are GCP georeferenced rasters) I have to convert them to VRT (via gdal warp), hence my question - how can I mosaic the rasters within one layer in Mapserver (one layer = one day of photos from Sentinel-2 for example). I can't create vrt to existing vrt, and creating a tileindex for each layer generates too many files. I wanted to create one vrt gathering together all of raster but gdal_warp uses only the first one as data source.
What can I do?
Best regards,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From public at postholer.com Tue Dec 6 09:39:00 2022
From: public at postholer.com (Scott)
Date: Tue, 6 Dec 2022 09:39:00 -0800
Subject: [MapServer-users] Problems with vrt created from GCP raster
In-Reply-To:
References:
Message-ID:
My "first is worst" suggestion would be to create a .vrt for each day:
gdalbuildvrt Day1.vrt [date]*.tif
gdalbuildvrt Day2.vrt [date]*.tif
...
Next, in your .map file use runtime substitution:
DATA "/file/path/Day%day%.vrt"
If you really want to make this fast, convert all your source .tif's to
format COG. All you tif's will be tiled:
gdalwarp -f COG -co COMPRESS=DEFLATE -co BIGTIFF=YES sent.tif sent_cog.tif
On 12/6/22 09:18, Marcin Niemyjski via MapServer-users wrote:
> Hello,
>
> up to now, I have been working with VRT as a carrier for the rasters I
> wanted to use in the mapfile. Now in order to use the rasters that were
> provided to me (they are GCP georeferenced rasters) I have to convert
> them to VRT(via gdal warp), hence my question - how can I mosaic the
> rasters within one layer in Mapserver (one layer = one day of photos
> from Sentinel-2 for example). I can't create vrt to existing vrt, and
> creating a tileindex for each layer generates too many files. I wanted
> to create one vrt gathering together all of raster but gdal_warp uses
> only the first one as data source.
>
> What can I do?
>
> Best regards,
> Marcin
>
>
>
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
From mniemyjski at cloudferro.com Tue Dec 6 10:07:53 2022
From: mniemyjski at cloudferro.com (Marcin Niemyjski)
Date: Tue, 6 Dec 2022 18:07:53 +0000
Subject: [MapServer-users] Problems with vrt created from GCP raster
In-Reply-To:
References:
Message-ID:
Scott,
1. gdalbuildvrt doesnt work with raster georeferenced by ground control points. Thats why I am using gdal warp -> https://gis.stackexchange.com/questions/283595/transform-rectify-unprojected-raster-using-target-extent-co-ordinates
2. Source files are already in cloud optimized format
Do you have any other ideas?
Best,
Marcin
Wysy?ane z aplikacji Outlook dla systemu iOS
________________________________
Od: MapServer-users w imieniu u?ytkownika Scott
Wys?ane: Tuesday, December 6, 2022 6:39:00 PM
Do: mapserver-users at lists.osgeo.org
Temat: Re: [MapServer-users] Problems with vrt created from GCP raster
My "first is worst" suggestion would be to create a .vrt for each day:
gdalbuildvrt Day1.vrt [date]*.tif
gdalbuildvrt Day2.vrt [date]*.tif
...
Next, in your .map file use runtime substitution:
DATA "/file/path/Day%day%.vrt"
If you really want to make this fast, convert all your source .tif's to
format COG. All you tif's will be tiled:
gdalwarp -f COG -co COMPRESS=DEFLATE -co BIGTIFF=YES sent.tif sent_cog.tif
On 12/6/22 09:18, Marcin Niemyjski via MapServer-users wrote:
> Hello,
>
> up to now, I have been working with VRT as a carrier for the rasters I
> wanted to use in the mapfile. Now in order to use the rasters that were
> provided to me (they are GCP georeferenced rasters) I have to convert
> them to VRT(via gdal warp), hence my question - how can I mosaic the
> rasters within one layer in Mapserver (one layer = one day of photos
> from Sentinel-2 for example). I can't create vrt to existing vrt, and
> creating a tileindex for each layer generates too many files. I wanted
> to create one vrt gathering together all of raster but gdal_warp uses
> only the first one as data source.
>
> What can I do?
>
> Best regards,
> Marcin
>
>
>
> _______________________________________________
> 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 public at postholer.com Tue Dec 6 10:19:19 2022
From: public at postholer.com (Scott)
Date: Tue, 6 Dec 2022 10:19:19 -0800
Subject: [MapServer-users] Problems with vrt created from GCP raster
In-Reply-To:
References:
Message-ID:
The only thing I can think of is create an entirely new .tif from your
gcp .tif, then it shouldn't be a problem.
However, this could result a very large set of new sentinel tifs. Bad.
On 12/6/22 10:07, Marcin Niemyjski wrote:
> Scott,
>
> 1. gdalbuildvrt doesnt work with raster georeferenced by ground control
> points. Thats why I am using gdal warp ->
> https://gis.stackexchange.com/questions/283595/transform-rectify-unprojected-raster-using-target-extent-co-ordinates
> 2. Source files are already in cloud optimized format
>
> Do you have any other ideas?
>
> Best,
> Marcin
>
> Wysy?ane z aplikacji Outlook dla systemu iOS
> ------------------------------------------------------------------------
> *Od:* MapServer-users w
> imieniu u?ytkownika Scott
> *Wys?ane:* Tuesday, December 6, 2022 6:39:00 PM
> *Do:* mapserver-users at lists.osgeo.org
> *Temat:* Re: [MapServer-users] Problems with vrt created from GCP raster
> My "first is worst" suggestion would be to create a .vrt for each day:
>
> gdalbuildvrt Day1.vrt [date]*.tif
> gdalbuildvrt Day2.vrt [date]*.tif
> ...
>
> Next, in your .map file use runtime substitution:
>
> DATA "/file/path/Day%day%.vrt"
>
> If you really want to make this fast, convert all your source .tif's to
> format COG. All you tif's will be tiled:
>
> gdalwarp -f COG -co COMPRESS=DEFLATE -co BIGTIFF=YES sent.tif sent_cog.tif
>
>
>
> On 12/6/22 09:18, Marcin Niemyjski via MapServer-users wrote:
>> Hello,
>>
>> up to now, I have been working with VRT as a carrier for the rasters I
>> wanted to use in the mapfile. Now in order to use the rasters that were
>> provided to me (they are GCP georeferenced rasters) I have to convert
>> them to VRT(via gdal warp), hence my question - how can I mosaic the
>> rasters within one layer in Mapserver (one layer = one day of photos
>> from Sentinel-2 for example). I can't create vrt to existing vrt, and
>> creating a tileindex for each layer generates too many files. I wanted
>> to create one vrt gathering together all of raster but gdal_warp uses
>> only the first one as data source.
>>
>> What can I do?
>>
>> Best regards,
>> Marcin
>>
>>
>>
>> _______________________________________________
>> 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 pschmitt at gmail.com Tue Dec 6 10:39:26 2022
From: pschmitt at gmail.com (Peter Schmitt)
Date: Tue, 6 Dec 2022 11:39:26 -0700
Subject: [MapServer-users] How do I use an SQL query in a Postgis tileindex
of vector files?
Message-ID:
Hi,
How do I get a tileindex of vector files working from data in a Postgis
database and accessed via an SQL query of my choosing?
I would like to make a vector tile index as described at
https://mapserver.org/optimization/vector.html#index-your-data using data
stored in a Postgis database and a SQL query of my choosing. Here is one
approach that works:
1. create a test table in postgres database:
> create table testtable (id int, location text, geom
geometry(Polygon,4326));
2. insert data into the table:
insert into testtable (id, location, geom) values (1,
'/test_data/test.geojson,0', 'POLYGON((122.01377475333321
29.96355712017804,122.01424752183958 29.915620560607106,122.06927507957919
29.91602043815968,122.0688286928125 29.963957768165944,122.01377475333321
29.96355712017804))'::geometry);
3. Define a layer using the OGR connection:
LAYER
NAME "vector"
TYPE POLYGON
CONNECTIONTYPE OGR
CONNECTION "PG:\"host=localhost user=postgres dbname=mydatabase
password=mypwd tables=testtable(geom)\""
STATUS OFF
CLASS
STYLE
WIDTH 1
OUTLINECOLOR 255 105 180
END
END
END
4. Issue a request:
mapserv
QUERY_STRING='SERVICE=WMS&map=/tmpp/mapfile.map&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&layers=vector&width=256&height=256&crs=EPSG:3857&bbox=13580108.193257555,3487974.474709164,13585000.163067807,3492866.4445194146'
and I get an image of my vectors back.
How do I use a more complex query than `testtable(geom)`? I tried
specifying a query via a DATA block:
LAYER
NAME "vector"
TYPE POLYGON
CONNECTIONTYPE OGR
CONNECTION "PG:\"host=localhost user=postgres dbname=mydatabase
password=mypwd\""
DATA "geom FROM (SELECT
id,
geom,
location
FROM testtable
) AS subquery USING unique id USING SRID=4326"
PROJECTION
"init=epsg:4326"
END
STATUS OFF
CLASS
STYLE
WIDTH 1
OUTLINECOLOR 255 105 180
END
END
END
However, the same query generates an error:
mapserv
QUERY_STRING='SERVICE=WMS&map=/tmpp/mapfile.map&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&layers=vector&width=256&height=256&crs=EPSG:3857&bbox=13580108.193257555,3487974.474709164,13585000.163067807,3492866.4445194146'
"msOGRFileOpen(): OGR error. Open failed for OGR connection in layer
`vector'. File not found or unsupported format. Check server logs.
msDrawMap(): Image handling error. Failed to draw layer named 'vector'"
I tried using a postgis connectiontype, but could not get that working
either https://mapserver.org/mapfile/layer.html#mapfile-layer-connectiontype
How do I get a tileindex of vector files working from data in a Postgis
database and accessed via an SQL query of my choosing?
Thanks!
Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From public at postholer.com Tue Dec 6 10:45:03 2022
From: public at postholer.com (Scott)
Date: Tue, 6 Dec 2022 10:45:03 -0800
Subject: [MapServer-users] How do I use an SQL query in a Postgis
tileindex of vector files?
In-Reply-To:
References:
Message-ID: <700a71b9-1df2-5cb0-1db1-0e45fe36d32c@postholer.com>
Your connectiontype is ogr, you need postgis for a query
CONNECTIONTYPE POSTGIS
On 12/6/22 10:39, Peter Schmitt wrote:
> Hi,
>
> How do I get a tileindex of vector files working from data in a Postgis
> database and accessed via an SQL query of my choosing?
>
> I would like to make a vector tile index as described at
> https://mapserver.org/optimization/vector.html#index-your-data
> using
> data stored in a Postgis database and a SQL query of my choosing.? Here
> is one approach that works:
>
> 1.? create a test table in postgres database:
> ? ? ?> create table testtable (id int, location text, geom
> geometry(Polygon,4326));
>
> 2.? insert data into the table:
>
> ? ? ?insert into testtable (id, location, geom) values (1,
> '/test_data/test.geojson,0', 'POLYGON((122.01377475333321
> 29.96355712017804,122.01424752183958
> 29.915620560607106,122.06927507957919
> 29.91602043815968,122.0688286928125
> 29.963957768165944,122.01377475333321 29.96355712017804))'::geometry);
>
> 3. Define a layer using the OGR connection:
>
> LAYER
> ? NAME "vector"
> ? TYPE POLYGON
> ? CONNECTIONTYPE OGR
> ? CONNECTION "PG:\"host=localhost user=postgres dbname=mydatabase
> password=mypwd tables=testtable(geom)\""
> ? STATUS OFF
> ? CLASS
> ? ? STYLE
> ? ? ? WIDTH 1
> ? ? ? OUTLINECOLOR 255 105 180
> ? ? END
> ? END
> END
>
> 4. Issue a request:
>
> ? ? mapserv
> QUERY_STRING='SERVICE=WMS&map=/tmpp/mapfile.map&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&layers=vector&width=256&height=256&crs=EPSG:3857&bbox=13580108.193257555,3487974.474709164,13585000.163067807,3492866.4445194146'
>
> and I get an image of my vectors back.
>
> How do I use a more complex query than `testtable(geom)`?? I tried
> specifying a query via a DATA block:
>
> LAYER
> ? ? NAME "vector"
> ? ? TYPE POLYGON
> ? ? CONNECTIONTYPE OGR
> ? ? CONNECTION "PG:\"host=localhost user=postgres dbname=mydatabase
> password=mypwd\""
> ? ? DATA "geom FROM (SELECT
> ? ? ? ? id,
> ? ? ? ? geom,
> ? ? ? ? location
> ? ? ? FROM testtable
> ? ? ) AS subquery USING unique id USING SRID=4326"
> ? ? PROJECTION
> ? ? ? "init=epsg:4326"
> ? ? END
> ? ? STATUS OFF
> ? ? CLASS
> ? ? ? STYLE
> ? ? ? ? WIDTH 1
> ? ? ? ? OUTLINECOLOR 255 105 180
> ? ? ? END
> ? ? END
> ? END
>
> However, the same query generates an error:
>
> mapserv
> QUERY_STRING='SERVICE=WMS&map=/tmpp/mapfile.map&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&layers=vector&width=256&height=256&crs=EPSG:3857&bbox=13580108.193257555,3487974.474709164,13585000.163067807,3492866.4445194146'
>
> "msOGRFileOpen(): OGR error. Open failed for OGR connection in layer
> `vector'.? File not found or unsupported format. Check server logs.
> msDrawMap(): Image handling error. Failed to draw layer named 'vector'"
>
> I tried using a postgis connectiontype, but could not get that working
> either
> https://mapserver.org/mapfile/layer.html#mapfile-layer-connectiontype
>
>
> How do I get a tileindex of vector files working from data in a Postgis
> database and accessed via an SQL query of my choosing?
>
> Thanks!
> Pete
>
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
From pe_lord at protonmail.com Tue Dec 6 11:46:27 2022
From: pe_lord at protonmail.com (PE Lord)
Date: Tue, 06 Dec 2022 19:46:27 +0000
Subject: [MapServer-users] WFS output geojson - missing column with null
values
Message-ID:
I runmapserver7.6.4 compiled with gdal 3.2.1.
When I output various formats (CSV/KML/GPKG) from my layer (gpkg based), the requested features are properly returned.
In the case of an ogroutput in geojson format, some of mycolumns are not returned.The missing column are those with null values.
Here myOUTPUTFORMAT definition
#==============================================
END
OUTPUTFORMAT
NAME "geojson"
DRIVER "OGR/GEOJSON"
FORMATOPTION "LCO:COORDINATE_PRECISION=15"
FORMATOPTION "LCO:WRITE_BBOX=YES"
FORMATOPTION "STORAGE=memory"
FORMATOPTION "FORM=simple"
FORMATOPTION "USE_FEATUREID=true"
FORMATOPTION "FILENAME=%outfile%.geojson"
MIMETYPE "application/geo+json"
#===============================================
I've tested with these 2 additionnal properties without any success....FORMATOPTION "LCO:WRITE_NON_FINITE_VALUES=YES"
FORMATOPTION "LCO:RFC7946=YES"
i've also tried with
gml_types auto
or
gml_val_cam_annee_1 Character (or Real) without success.
Here 2 links with the current issue.
- wfs output (geojson) with missing column --> https://ws.mapserver.transports.gouv.qc.ca/swtq?outfile=requestedColumnIsMissing&service=wfs&version=2.0.0&request=getfeature&typename=ms:circulation_routier&outputformat=geojson&srsname=EPSG:4326&count=1&propertyName=val_cam_annee_1
- wfs output (kml) with requested column --> https://ws.mapserver.transports.gouv.qc.ca/swtq?outfile=requestedcolumIsPresent&service=wfs&version=2.0.0&request=getfeature&typename=ms:circulation_routier&outputformat=kml&srsname=EPSG:4326&count=1&propertyName=val_cam_annee_1
I've found a workaround, I declare a sql syntax with a coalesce(field,'') ... but I look for a proper fix.
I will probably push this fix on december 7. Here the getfeature responses:
-
circulation_routier
.....
- {
"type": "FeatureCollection",
"name": "circulation_routier",
"bbox": [ -72.5617697276407, 45.6593622104288, -72.4990762933546, 45.7595067353991 ],
"features": [
{ "type": "Feature", "id": 1, "properties": { }, "bbox": [ ... ], "geometry": { "type": "LineString", "coordinates": [ ... ] } }
]}
PE
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From pschmitt at gmail.com Tue Dec 6 15:56:05 2022
From: pschmitt at gmail.com (Peter Schmitt)
Date: Tue, 6 Dec 2022 16:56:05 -0700
Subject: [MapServer-users] Vector tileindex with connectiontype OGR
Message-ID:
Hi,
How do I get a vector tileindex working with another Mapserver layer as the
tileindex?
I have the following tindex.geojson:
{
"type":"FeatureCollection","features":[{"type":"Feature","properties":{"location":"/app/mapfiles/test.geojson"},"geometry":{"type":"Polygon","coordinates":[[[122.013774753,29.96355712],[122.014247522,29.915620561],[122.06927508,29.916020438],[122.068828693,29.963957768],[122.013774753,29.96355712]]]}}]}
Which points to a single file /app/mapfiles/test.geojson:
{"type":"Feature","properties":{},"geometry":{"coordinates":[[[122.04067791363536,29.944772490597998],[122.03620089848994,29.94141730774004],[122.03819740524398,29.937852301951125],[122.0446709271447,29.938166866424368],[122.04648593328471,29.940211511256464],[122.04067791363536,29.944772490597998]]],"type":"Polygon"}}
I would like to define the TILEINDEX as one MapServer Layer and have
another MapServer layer reference that tile index. I tried this layer:
LAYER
NAME "vector_via_ogr"
TYPE POLYGON
TILEINDEX tindex_ogr
CONNECTIONTYPE OGR
STATUS OFF
END
but when I run `mapserv -nh
QUERY_STRING='service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test2.map&typename=vector_via_ogr&OUTPUTFORMAT=geojson'`,
I get the following error:
"msOGRFileOpen(): OGR error. Open failed for OGR connection in layer
`vector_via_ogr'. File not found or unsupported format. Check server
logs."
If I run without CONNECTIONTYPE OGR, I get the following error:
"msTiledSHPOpenFile(): Shapefile error. Tileindex layer must be a
shapefile."
I can get a similar thing working for a TILEINDEX of rasters. However I
cannot get it working on a TILEINDEX of vectors. The example below is the
simplest reproduce case I could create. Ultimately I plan on having a
TILEINDEX point to a layer of defined via CONNECTIONTYPE postgis.
How do I get a vector tileindex working with another Mapserver layer as the
tileindex?
Thanks!
Pete
Full mapfile below with example commands reproducing my errors.
MAP
OUTPUTFORMAT
NAME "geojson"
DRIVER "OGR/GEOJSON"
MIMETYPE "application/json; subtype=geojson"
FORMATOPTION "STORAGE=memory"
FORMATOPTION "FORM=SIMPLE"
FORMATOPTION "LCO:RFC7946=NO"
FORMATOPTION "FILENAME=result.json"
END
WEB
METADATA
"ows_enable_request" "*"
"wfs_getfeature_formatlist" "ogrgml,geojson"
END
END
CONFIG "MS_ERRORFILE" "stderr"
PROJECTION
"init=epsg:4326"
END
DEBUG 5
# mapserv -nh
QUERY_STRING='service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test2.map&typename=vector_directly&OUTPUTFORMAT=geojson'
# returns the contents of 'test.geojson'!
LAYER
NAME "vector_directly"
TYPE POLYGON
TILEINDEX "/app/mapfiles/tindex.geojson"
CONNECTIONTYPE OGR
STATUS OFF
END
# mapserv -nh
QUERY_STRING='service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test2.map&typename=tindex_ogr&OUTPUTFORMAT=geojson'
# returns contents of tindex.geojson!
LAYER
NAME "tindex_ogr"
TYPE POLYGON
CONNECTIONTYPE OGR
CONNECTION "/app/mapfiles/tindex.geojson"
STATUS OFF
END
# mapserv -nh
QUERY_STRING='service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test2.map&typename=vector_tindex&OUTPUTFORMAT=geojson'
# returns 'msTiledSHPOpenFile(): Shapefile error. Tileindex layer must be
a shapefile.'
LAYER
NAME "vector_via_tindex"
TYPE POLYGON
TILEINDEX tindex_ogr
STATUS OFF
END
# mapserv -nh
QUERY_STRING='service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test2.map&typename=vector_via_ogr&OUTPUTFORMAT=geojson'
# returns 'msOGRFileOpen(): OGR error. Open failed for OGR connection in
layer `vector_via_ogr'. File not found or unsupported format. Check
server logs.'
LAYER
NAME "vector_via_ogr"
TYPE POLYGON
TILEINDEX tindex_ogr
CONNECTIONTYPE OGR
STATUS OFF
END
END # mapfile
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From lars.schylberg at saabgroup.com Wed Dec 7 00:16:46 2022
From: lars.schylberg at saabgroup.com (Schylberg Lars)
Date: Wed, 7 Dec 2022 08:16:46 +0000
Subject: [MapServer-users] [EXTERNAL] Vector tileindex with
connectiontype OGR
In-Reply-To:
References:
Message-ID: <0c6ff3ba957a4736b3376dc7052a9ce2@saabgroup.com>
Hi,
I remember that I did tileindexes for vector layers a couple of years ago.
I can?t find my example right now, but I think I was following this example for raster.
The important thing is to have a one layer for the actual tile index, that has status off and one layer that is using the tile index layer. In my case I did it with sqlite if remember correctly. I believe I was following this example for raster, but did it with vector data.
https://github.com/mapserver/mapserver/wiki/MapServer-TILEINDEXes-with-Database-RASTERS
https://lists.osgeo.org/pipermail/mapserver-users/2014-August/076877.html
Have fun / Lars Schyberg
From: MapServer-users On Behalf Of Peter Schmitt
Sent: den 7 december 2022 00:56
To: Mapserver-Users (mapserver-users at lists.osgeo.org)
Subject: [EXTERNAL] [MapServer-users] Vector tileindex with connectiontype OGR
Hi,
How do I get a vector tileindex working with another Mapserver layer as the tileindex?
I have the following tindex.geojson:
{ "type":"FeatureCollection","features":[{"type":"Feature","properties":{"location":"/app/mapfiles/test.geojson"},"geometry":{"type":"Polygon","coordinates":[[[122.013774753,29.96355712],[122.014247522,29.915620561],[122.06927508,29.916020438],[122.068828693,29.963957768],[122.013774753,29.96355712]]]}}]}
Which points to a single file /app/mapfiles/test.geojson:
{"type":"Feature","properties":{},"geometry":{"coordinates":[[[122.04067791363536,29.944772490597998],[122.03620089848994,29.94141730774004],[122.03819740524398,29.937852301951125],[122.0446709271447,29.938166866424368],[122.04648593328471,29.940211511256464],[122.04067791363536,29.944772490597998]]],"type":"Polygon"}}
I would like to define the TILEINDEX as one MapServer Layer and have another MapServer layer reference that tile index. I tried this layer:
LAYER
NAME "vector_via_ogr"
TYPE POLYGON
TILEINDEX tindex_ogr
CONNECTIONTYPE OGR
STATUS OFF
END
but when I run `mapserv -nh QUERY_STRING='service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test2.map&typename=vector_via_ogr&OUTPUTFORMAT=geojson'`, I get the following error:
"msOGRFileOpen(): OGR error. Open failed for OGR connection in layer `vector_via_ogr'. File not found or unsupported format. Check server logs."
If I run without CONNECTIONTYPE OGR, I get the following error:
"msTiledSHPOpenFile(): Shapefile error. Tileindex layer must be a shapefile."
I can get a similar thing working for a TILEINDEX of rasters. However I cannot get it working on a TILEINDEX of vectors. The example below is the simplest reproduce case I could create. Ultimately I plan on having a TILEINDEX point to a layer of defined via CONNECTIONTYPE postgis.
How do I get a vector tileindex working with another Mapserver layer as the tileindex?
Thanks!
Pete
Full mapfile below with example commands reproducing my errors.
MAP
OUTPUTFORMAT
NAME "geojson"
DRIVER "OGR/GEOJSON"
MIMETYPE "application/json; subtype=geojson"
FORMATOPTION "STORAGE=memory"
FORMATOPTION "FORM=SIMPLE"
FORMATOPTION "LCO:RFC7946=NO"
FORMATOPTION "FILENAME=result.json"
END
WEB
METADATA
"ows_enable_request" "*"
"wfs_getfeature_formatlist" "ogrgml,geojson"
END
END
CONFIG "MS_ERRORFILE" "stderr"
PROJECTION
"init=epsg:4326"
END
DEBUG 5
# mapserv -nh QUERY_STRING='service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test2.map&typename=vector_directly&OUTPUTFORMAT=geojson'
# returns the contents of 'test.geojson'!
LAYER
NAME "vector_directly"
TYPE POLYGON
TILEINDEX "/app/mapfiles/tindex.geojson"
CONNECTIONTYPE OGR
STATUS OFF
END
# mapserv -nh QUERY_STRING='service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test2.map&typename=tindex_ogr&OUTPUTFORMAT=geojson'
# returns contents of tindex.geojson!
LAYER
NAME "tindex_ogr"
TYPE POLYGON
CONNECTIONTYPE OGR
CONNECTION "/app/mapfiles/tindex.geojson"
STATUS OFF
END
# mapserv -nh QUERY_STRING='service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test2.map&typename=vector_tindex&OUTPUTFORMAT=geojson'
# returns 'msTiledSHPOpenFile(): Shapefile error. Tileindex layer must be a shapefile.'
LAYER
NAME "vector_via_tindex"
TYPE POLYGON
TILEINDEX tindex_ogr
STATUS OFF
END
# mapserv -nh QUERY_STRING='service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test2.map&typename=vector_via_ogr&OUTPUTFORMAT=geojson'
# returns 'msOGRFileOpen(): OGR error. Open failed for OGR connection in layer `vector_via_ogr'. File not found or unsupported format. Check server logs.'
LAYER
NAME "vector_via_ogr"
TYPE POLYGON
TILEINDEX tindex_ogr
CONNECTIONTYPE OGR
STATUS OFF
END
END # mapfile
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From mniemyjski at cloudferro.com Wed Dec 7 02:44:38 2022
From: mniemyjski at cloudferro.com (Marcin Niemyjski)
Date: Wed, 7 Dec 2022 10:44:38 +0000
Subject: [MapServer-users] GetFeatureInfo html template
Message-ID:
Hello,
I'm looking for tutorial of enabling GetFeatureInfo requests of WMS. I would be grateful for any example of code of .tmpl file. What I want to do is simple table with name and value of attribute for selected feature.
As always thank you,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From joerg.thomsen at wheregroup.com Wed Dec 7 04:26:07 2022
From: joerg.thomsen at wheregroup.com (=?UTF-8?Q?J=c3=b6rg_Thomsen_=28WhereGroup=29?=)
Date: Wed, 7 Dec 2022 13:26:07 +0100
Subject: [MapServer-users] fix tutorial? (Re: GetFeatureInfo html template)
In-Reply-To:
References:
Message-ID:
Hi,
Am 07.12.22 um 11:44 schrieb Marcin Niemyjski via MapServer-users:
> Hello,
>
> I'm looking for tutorial of enabling GetFeatureInfo requests of WMS. I
> would be grateful for any example of code of .tmpl file. What I want to
> do is simple table with name and value of attribute for selected feature.
there should be one in the tuitorial
https://www.mapserver.org/tutorial/index.html
https://demo.mapserver.org/tutorial/section3.html
but ist seems to be broken, who could fix it?
--
Viele Gr??e,
J?rg Thomsen
---------------------------------------------
Where2B Konferenz 2022
15. Dezember 2022 in Bonn und Online
where2b-conference.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 mniemyjski at cloudferro.com Wed Dec 7 04:44:37 2022
From: mniemyjski at cloudferro.com (Marcin Niemyjski)
Date: Wed, 7 Dec 2022 12:44:37 +0000
Subject: [MapServer-users] Filled SVG symbol after switching to Mapserver 8
Message-ID:
Hello,
after switching to Mapserver 8 my svg symbols started to be rendered as filled:
how it looks now:
https://pasteboard.co/4K4CIEW6oFIm.png
how it was looking (the good way):
https://pasteboard.co/wDQGW0xzFGRg.png
My mapfile:
https://pastebin.com/KRYDEAR2
What can I do to render svg the good way?
Best,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From jmckenna at gatewaygeomatics.com Wed Dec 7 06:19:44 2022
From: jmckenna at gatewaygeomatics.com (Jeff McKenna)
Date: Wed, 7 Dec 2022 10:19:44 -0400
Subject: [MapServer-users] fix tutorial? (Re: GetFeatureInfo html
template)
In-Reply-To:
References:
Message-ID: <5989f371-9ad1-07eb-e163-c06f3be4bb5f@gatewaygeomatics.com>
On 2022-12-07 8:26 a.m., J?rg Thomsen (WhereGroup) wrote:
> Hi,
>
> Am 07.12.22 um 11:44 schrieb Marcin Niemyjski via MapServer-users:
>> Hello,
>>
>> I'm looking for tutorial of enabling GetFeatureInfo requests of WMS. I
>> would be grateful for any example of code of .tmpl file. What I want
>> to do is simple table with name and value of attribute for selected
>> feature.
> there should be one in the tuitorial
> https://www.mapserver.org/tutorial/index.html
> https://demo.mapserver.org/tutorial/section3.html
>
> but ist seems to be broken, who could fix it?
>
>
I had started some fixes last week, will continue now (follow along at
https://github.com/MapServer/MapServer-documentation/issues/779 ). If
you ever notice issues with the demo server or any of the many services
relying on it, either email me directly or report the issue in the
'MapServer-documentation' repository. thanks,
-jeff
--
Jeff McKenna
GatewayGeo: Developers of MS4W, MapServer Consulting and Training
co-founder of FOSS4G
http://gatewaygeo.com/
From steve.lime at state.mn.us Wed Dec 7 07:33:35 2022
From: steve.lime at state.mn.us (Lime, Steve D (MNIT))
Date: Wed, 7 Dec 2022 15:33:35 +0000
Subject: [MapServer-users] Filled SVG symbol after switching to
Mapserver 8
In-Reply-To:
References:
Message-ID:
Hmmm... I'm not aware of any obvious changes between v.7 and v.8 that would account for the change and nothing jumps out looking at your mapfile. Would you be able to share one of your SVG graphics? --Steve
From: MapServer-users On Behalf Of Marcin Niemyjski via MapServer-users
Sent: Wednesday, December 7, 2022 6:45 AM
To: Marcin Niemyjski via MapServer-users
Subject: [MapServer-users] Filled SVG symbol after switching to Mapserver 8
Hello,
after switching to Mapserver 8 my svg symbols started to be rendered as filled:
how it looks now:
https://pasteboard.co/4K4CIEW6oFIm.png
how it was looking (the good way):
https://pasteboard.co/wDQGW0xzFGRg.png
My mapfile:
https://pastebin.com/KRYDEAR2
What can I do to render svg the good way?
Best,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From mniemyjski at cloudferro.com Wed Dec 7 07:37:55 2022
From: mniemyjski at cloudferro.com (Marcin Niemyjski)
Date: Wed, 7 Dec 2022 15:37:55 +0000
Subject: [MapServer-users] Filled SVG symbol after switching to
Mapserver 8
In-Reply-To:
References:
Message-ID:
Steve,
link to my svgs:
https://cloudferro-my.sharepoint.com/:f:/p/mniemyjski/EobJZb14qXRHj34634dWZdgBnZa3r7Qztx4-Z2HVFvZO9A?e=L2hCXj
Thanks,
Marcin
________________________________
From: Lime, Steve D (MNIT)
Sent: Wednesday, December 7, 2022 4:33 PM
To: Marcin Niemyjski ; Marcin Niemyjski via MapServer-users
Subject: RE: Filled SVG symbol after switching to Mapserver 8
Hmmm? I?m not aware of any obvious changes between v.7 and v.8 that would account for the change and nothing jumps out looking at your mapfile. Would you be able to share one of your SVG graphics? --Steve
From: MapServer-users On Behalf Of Marcin Niemyjski via MapServer-users
Sent: Wednesday, December 7, 2022 6:45 AM
To: Marcin Niemyjski via MapServer-users
Subject: [MapServer-users] Filled SVG symbol after switching to Mapserver 8
Hello,
after switching to Mapserver 8 my svg symbols started to be rendered as filled:
how it looks now:
https://pasteboard.co/4K4CIEW6oFIm.png
how it was looking (the good way):
https://pasteboard.co/wDQGW0xzFGRg.png
My mapfile:
https://pastebin.com/KRYDEAR2
What can I do to render svg the good way?
Best,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From pschmitt at gmail.com Wed Dec 7 09:07:50 2022
From: pschmitt at gmail.com (Peter Schmitt)
Date: Wed, 7 Dec 2022 10:07:50 -0700
Subject: [MapServer-users] [EXTERNAL] Vector tileindex with
connectiontype OGR
In-Reply-To: <0c6ff3ba957a4736b3376dc7052a9ce2@saabgroup.com>
References:
<0c6ff3ba957a4736b3376dc7052a9ce2@saabgroup.com>
Message-ID:
On Wed, Dec 7, 2022 at 1:16 AM Schylberg Lars
wrote:
> The important thing is to have a one layer for the actual tile index,
that has status off and one layer that is using the tile index layer.
Thanks for the message, Lars! This gave me another idea to debug.
When I set DEBUG 5 and request
mapserv -nh
QUERY_STRING='service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test2.map&typename=vector_via_ogr&OUTPUTFORMAT=geojson'
then the log contains
OGROPen(tindex_ogr)
msOGRFileOpen(): OGR error. Open failed for OGR connection in layer
`vector_via_ogr'. File not found or unsupported format. Check server logs.
Open failed for OGR connection in layer `vector_via_ogr'.
with the layers
LAYER
DEBUG 5
NAME "tindex_ogr"
TYPE POLYGON
CONNECTIONTYPE OGR
CONNECTION "/app/mapfiles/tindex.geojson"
STATUS OFF
END
LAYER
DEBUG 5
NAME "vector_via_ogr"
TYPE POLYGON
TILEINDEX tindex_ogr
CONNECTIONTYPE OGR
STATUS OFF
END
This log line
OGROPen(tindex_ogr)
makes me suspect the following lines of code are setting the OGR dataset
name to "tindex_ogr", whereas I expect it to do something like use the
value from CONNECTION in the layer with name "tindex_ogr".
https://github.com/MapServer/MapServer/blob/71ecf4028b0769027df3a970a36d56feb1d46ab6/mapogr.cpp#L1205-L1238
In other words, I expect the log line to read
OGROPen(/app/mapfiles/tindex.geojson)
and not
OGROPen(tindex_ogr)
This seems to be unique for a vector tile index of vectors. This otherwise
works fine when using a vector tileindex of rasters. So if I make a bogus
raster layer like
LAYER
DEBUG 5
NAME "bogus_raster"
TYPE RASTER
TILEINDEX tindex_ogr
STATUS OFF
PROJECTION
"init=epsg:3857"
END
END
and then issue a bogus request like
curl '
http://localhost:8000/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&map=/app/mapfiles/test2.map&layers=bogus_raster&WIDTH=256&HEIGHT=256&CRS=EPSG:3857&STYLES=&BBOX=4163066.308523841,5943743.319455305,4167958.2783340923,5948635.289265556
'
Then the log line includes
msOGRFileOpen(/app/mapfiles/tindex.geojson)...
OGROPen(/app/mapfiles/tindex.geojson)
msConnPoolRegister(tindex_ogr,/app/mapfiles/tindex.geojson,0x556aba222630)
and _not_
msOGRFileOpen(tindex_ogr)...
like I see for a vector tile index of vectors.
Thanks, Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From steve.lime at state.mn.us Wed Dec 7 09:21:39 2022
From: steve.lime at state.mn.us (Lime, Steve D (MNIT))
Date: Wed, 7 Dec 2022 17:21:39 +0000
Subject: [MapServer-users] Filled SVG symbol after switching to
Mapserver 8
In-Reply-To:
References:
Message-ID:
Which SVG library are you using - RSVG or Cairo?
From: Marcin Niemyjski
Sent: Wednesday, December 7, 2022 9:38 AM
To: Lime, Steve D (MNIT) ; Marcin Niemyjski via MapServer-users
Subject: Re: Filled SVG symbol after switching to Mapserver 8
Steve,
link to my svgs:
https://cloudferro-my.sharepoint.com/:f:/p/mniemyjski/EobJZb14qXRHj34634dWZdgBnZa3r7Qztx4-Z2HVFvZO9A?e=L2hCXj
Thanks,
Marcin
________________________________
From: Lime, Steve D (MNIT) >
Sent: Wednesday, December 7, 2022 4:33 PM
To: Marcin Niemyjski >; Marcin Niemyjski via MapServer-users >
Subject: RE: Filled SVG symbol after switching to Mapserver 8
Hmmm... I'm not aware of any obvious changes between v.7 and v.8 that would account for the change and nothing jumps out looking at your mapfile. Would you be able to share one of your SVG graphics? --Steve
From: MapServer-users > On Behalf Of Marcin Niemyjski via MapServer-users
Sent: Wednesday, December 7, 2022 6:45 AM
To: Marcin Niemyjski via MapServer-users >
Subject: [MapServer-users] Filled SVG symbol after switching to Mapserver 8
Hello,
after switching to Mapserver 8 my svg symbols started to be rendered as filled:
how it looks now:
https://pasteboard.co/4K4CIEW6oFIm.png
how it was looking (the good way):
https://pasteboard.co/wDQGW0xzFGRg.png
My mapfile:
https://pastebin.com/KRYDEAR2
What can I do to render svg the good way?
Best,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From mniemyjski at cloudferro.com Wed Dec 7 09:26:49 2022
From: mniemyjski at cloudferro.com (Marcin Niemyjski)
Date: Wed, 7 Dec 2022 17:26:49 +0000
Subject: [MapServer-users] Filled SVG symbol after switching to
Mapserver 8
In-Reply-To:
References:
Message-ID:
I am using the camptocamp/mapserver 8 image. I have not changed anything in the default configuration provided as part of the image.
Wysy?ane z aplikacji Outlook dla systemu iOS
________________________________
Od: Lime, Steve D (MNIT)
Wys?ane: Wednesday, December 7, 2022 6:21:39 PM
Do: Marcin Niemyjski ; Marcin Niemyjski via MapServer-users
Temat: RE: Filled SVG symbol after switching to Mapserver 8
Which SVG library are you using ? RSVG or Cairo?
From: Marcin Niemyjski
Sent: Wednesday, December 7, 2022 9:38 AM
To: Lime, Steve D (MNIT) ; Marcin Niemyjski via MapServer-users
Subject: Re: Filled SVG symbol after switching to Mapserver 8
Steve,
link to my svgs:
https://cloudferro-my.sharepoint.com/:f:/p/mniemyjski/EobJZb14qXRHj34634dWZdgBnZa3r7Qztx4-Z2HVFvZO9A?e=L2hCXj
Thanks,
Marcin
________________________________
From: Lime, Steve D (MNIT) >
Sent: Wednesday, December 7, 2022 4:33 PM
To: Marcin Niemyjski >; Marcin Niemyjski via MapServer-users >
Subject: RE: Filled SVG symbol after switching to Mapserver 8
Hmmm? I?m not aware of any obvious changes between v.7 and v.8 that would account for the change and nothing jumps out looking at your mapfile. Would you be able to share one of your SVG graphics? --Steve
From: MapServer-users > On Behalf Of Marcin Niemyjski via MapServer-users
Sent: Wednesday, December 7, 2022 6:45 AM
To: Marcin Niemyjski via MapServer-users >
Subject: [MapServer-users] Filled SVG symbol after switching to Mapserver 8
Hello,
after switching to Mapserver 8 my svg symbols started to be rendered as filled:
how it looks now:
https://pasteboard.co/4K4CIEW6oFIm.png
how it was looking (the good way):
https://pasteboard.co/wDQGW0xzFGRg.png
My mapfile:
https://pastebin.com/KRYDEAR2
What can I do to render svg the good way?
Best,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From jukka.rahkonen at maanmittauslaitos.fi Wed Dec 7 11:18:41 2022
From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka)
Date: Wed, 7 Dec 2022 19:18:41 +0000
Subject: [MapServer-users] [EXTERNAL] Vector tileindex with
connectiontype OGR
In-Reply-To:
References:
<0c6ff3ba957a4736b3376dc7052a9ce2@saabgroup.com>
Message-ID:
Hi,
I made some tests and noticed that the OGR tileindex does not need to be a shapefile but GeoPackage worked as well. Actully what did not work was to make a vector layer from tileindex that was saved into GeoPackage and to use that layer in TILEINDEX. And then I noticed that this behavior is documented in https://www.mapserver.org/input/vector/ogr.html#tileindex-with-ogr:
"OGR layers can utilize tile indexes in a similar fashion to Shapefile based layers. The TILEINDEX keyword should contain the connection string for the tile index file. The tile index file may be any supported OGR format, including shapefiles."
So this is what I used in LAYER and it worked both for WMS and WFS:
CONNECTIONTYPE OGR
TILEINDEX "c:\data\000\mapservertest\tindex.gpkg"
I do not know when and if this behavior has changed. I thought as well that the layer-as-a-tileindex would be the way to follow if tileindex is not in shapefile format.
-Jukka Rahkonen-
L?hett?j?: MapServer-users Puolesta Peter Schmitt
L?hetetty: keskiviikko 7. joulukuuta 2022 19.08
Vastaanottaja: Schylberg Lars
Kopio: Mapserver-Users (mapserver-users at lists.osgeo.org)
Aihe: Re: [MapServer-users] [EXTERNAL] Vector tileindex with connectiontype OGR
On Wed, Dec 7, 2022 at 1:16 AM Schylberg Lars > wrote:
> The important thing is to have a one layer for the actual tile index, that has status off and one layer that is using the tile index layer.
Thanks for the message, Lars! This gave me another idea to debug.
When I set DEBUG 5 and request
mapserv -nh QUERY_STRING='service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test2.map&typename=vector_via_ogr&OUTPUTFORMAT=geojson'
then the log contains
OGROPen(tindex_ogr)
msOGRFileOpen(): OGR error. Open failed for OGR connection in layer `vector_via_ogr'. File not found or unsupported format. Check server logs.
Open failed for OGR connection in layer `vector_via_ogr'.
with the layers
LAYER
DEBUG 5
NAME "tindex_ogr"
TYPE POLYGON
CONNECTIONTYPE OGR
CONNECTION "/app/mapfiles/tindex.geojson"
STATUS OFF
END
LAYER
DEBUG 5
NAME "vector_via_ogr"
TYPE POLYGON
TILEINDEX tindex_ogr
CONNECTIONTYPE OGR
STATUS OFF
END
This log line
OGROPen(tindex_ogr)
makes me suspect the following lines of code are setting the OGR dataset name to "tindex_ogr", whereas I expect it to do something like use the value from CONNECTION in the layer with name "tindex_ogr".
https://github.com/MapServer/MapServer/blob/71ecf4028b0769027df3a970a36d56feb1d46ab6/mapogr.cpp#L1205-L1238
In other words, I expect the log line to read
OGROPen(/app/mapfiles/tindex.geojson)
and not
OGROPen(tindex_ogr)
This seems to be unique for a vector tile index of vectors. This otherwise works fine when using a vector tileindex of rasters. So if I make a bogus raster layer like
LAYER
DEBUG 5
NAME "bogus_raster"
TYPE RASTER
TILEINDEX tindex_ogr
STATUS OFF
PROJECTION
"init=epsg:3857"
END
END
and then issue a bogus request like
curl 'http://localhost:8000/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&map=/app/mapfiles/test2.map&layers=bogus_raster&WIDTH=256&HEIGHT=256&CRS=EPSG:3857&STYLES=&BBOX=4163066.308523841,5943743.319455305,4167958.2783340923,5948635.289265556'
Then the log line includes
msOGRFileOpen(/app/mapfiles/tindex.geojson)...
OGROPen(/app/mapfiles/tindex.geojson)
msConnPoolRegister(tindex_ogr,/app/mapfiles/tindex.geojson,0x556aba222630)
and _not_
msOGRFileOpen(tindex_ogr)...
like I see for a vector tile index of vectors.
Thanks, Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From steve.lime at state.mn.us Wed Dec 7 14:35:55 2022
From: steve.lime at state.mn.us (Lime, Steve D (MNIT))
Date: Wed, 7 Dec 2022 22:35:55 +0000
Subject: [MapServer-users] Filled SVG symbol after switching to
Mapserver 8
In-Reply-To:
References:
Message-ID:
Interestingly the SVG-related regression tests all pass using a more complex SVG file than what you had shared. Using 8.0, the msautotest/misc/data/Road_Works.svg (https://github.com/MapServer/MapServer/blob/branch-8-0/msautotest/misc/data/Road_Works.svg) file renders fine as a point symbol while your marker_customers.svg does not and matches your sample output. Using the current 7.6 branch, both symbols render as expected as point symbols.
More digging will be necessary. Are any devs aware of specific changes relative to SVG (or vector) symbol support?
--Steve
From: Marcin Niemyjski
Sent: Wednesday, December 7, 2022 11:27 AM
To: Lime, Steve D (MNIT) ; Marcin Niemyjski via MapServer-users
Subject: Re: Filled SVG symbol after switching to Mapserver 8
I am using the camptocamp/mapserver 8 image. I have not changed anything in the default configuration provided as part of the image.
Wysy?ane z aplikacji Outlook dla systemu iOS
________________________________
Od: Lime, Steve D (MNIT) >
Wys?ane: Wednesday, December 7, 2022 6:21:39 PM
Do: Marcin Niemyjski >; Marcin Niemyjski via MapServer-users >
Temat: RE: Filled SVG symbol after switching to Mapserver 8
Which SVG library are you using - RSVG or Cairo?
From: Marcin Niemyjski >
Sent: Wednesday, December 7, 2022 9:38 AM
To: Lime, Steve D (MNIT) >; Marcin Niemyjski via MapServer-users >
Subject: Re: Filled SVG symbol after switching to Mapserver 8
Steve,
link to my svgs:
https://cloudferro-my.sharepoint.com/:f:/p/mniemyjski/EobJZb14qXRHj34634dWZdgBnZa3r7Qztx4-Z2HVFvZO9A?e=L2hCXj
Thanks,
Marcin
________________________________
From: Lime, Steve D (MNIT) >
Sent: Wednesday, December 7, 2022 4:33 PM
To: Marcin Niemyjski >; Marcin Niemyjski via MapServer-users >
Subject: RE: Filled SVG symbol after switching to Mapserver 8
Hmmm... I'm not aware of any obvious changes between v.7 and v.8 that would account for the change and nothing jumps out looking at your mapfile. Would you be able to share one of your SVG graphics? --Steve
From: MapServer-users > On Behalf Of Marcin Niemyjski via MapServer-users
Sent: Wednesday, December 7, 2022 6:45 AM
To: Marcin Niemyjski via MapServer-users >
Subject: [MapServer-users] Filled SVG symbol after switching to Mapserver 8
Hello,
after switching to Mapserver 8 my svg symbols started to be rendered as filled:
how it looks now:
https://pasteboard.co/4K4CIEW6oFIm.png
how it was looking (the good way):
https://pasteboard.co/wDQGW0xzFGRg.png
My mapfile:
https://pastebin.com/KRYDEAR2
What can I do to render svg the good way?
Best,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From pschmitt at gmail.com Wed Dec 7 15:02:29 2022
From: pschmitt at gmail.com (Peter Schmitt)
Date: Wed, 7 Dec 2022 16:02:29 -0700
Subject: [MapServer-users] [EXTERNAL] Vector tileindex with
connectiontype OGR
In-Reply-To:
References:
<0c6ff3ba957a4736b3376dc7052a9ce2@saabgroup.com>
Message-ID:
Hi Jukka,
On Wed, Dec 7, 2022 at 12:18 PM Rahkonen Jukka <
jukka.rahkonen at maanmittauslaitos.fi> wrote:
> ?OGR layers can utilize tile indexes in a similar fashion to Shapefile
> based layers. The TILEINDEX keyword should contain the connection string
> for the tile index file. The tile index file may be any supported OGR
> format, including shapefiles.?
>
>
>
> So this is what I used in LAYER and it worked both for WMS and WFS:
>
>
> CONNECTIONTYPE OGR
>
TILEINDEX "c:\data\000\mapservertest\tindex.gpkg"
>
Thanks for your message, it is very helpful! I am now struggling how to
use an SQL query of my choosing when the OGR TILEINDEX is in a Postgis
database.
I can get a TILEINDEX working using the OGR format. Ultimately my
TILEINDEX lives in Postgis. I can make a postgis table and populate it
with items like so:
create table testtable (id int, location text, geom
geometry(Polygon,4326));
insert into testtable (id, location, geom) values (1,
'/test_data/test.geojson,0', 'POLYGON((122.01377475333321
29.96355712017804,122.01424752183958 29.915620560607106,122.06927507957919
29.91602043815968,122.0688286928125 29.963957768165944,122.01377475333321
29.96355712017804))'::geometry);
and then reference my Postgis TILEINDEX of vectors in this fashion:
LAYER
DEBUG 5
NAME "vector_via_postgis"
TYPE POLYGON
TILEINDEX "PG:\"host='localhost' user='postgres' dbname='mydatabase'
password='mypwd' tables=testtable(geom)\""
CONNECTIONTYPE OGR
STATUS OFF
END
and now I can query my vector index of tiles:
mapserv -nh
QUERY_STRING='service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test2.map&typename=vector_via_postgis&OUTPUTFORMAT=geojson'
I can query the database with the OGR driver by passing the `-sql` option:
ogrinfo -ro PG:"host='localhost' user='postgres' dbname='mydatabase'
password='mypwd'" -sql 'SELECT * FROM testtable'
but let's say my query was more complicated than `SELECT * FROM
testtable;`. I could make a Postgres view, but I'm hoping there is some
way to override the default SQL query used.
How do I specify such a query using the OGR PG driver as a Mapserver layer
to be used as a TILEINDEX of OGR vector files?
Perhaps this is more of a GDAL question... or how does Mapserver's use of
OGR TILEINDEX of OGR vector files allow custom SQL? Note that as a
TILEINDEX of Rasters the TILEINDEX can point to a Mapserver Layer, so I
/can/ add custom SQL queries in that case. But I don't know how to do it
as a OGR TILEINDEX pointing to OGR vectors.
Thanks,
Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From even.rouault at spatialys.com Wed Dec 7 15:17:37 2022
From: even.rouault at spatialys.com (Even Rouault)
Date: Thu, 8 Dec 2022 00:17:37 +0100
Subject: [MapServer-users] [EXTERNAL] Vector tileindex with
connectiontype OGR
In-Reply-To:
References:
<0c6ff3ba957a4736b3376dc7052a9ce2@saabgroup.com>
Message-ID: <327a7dea-295c-6451-aa6b-2ae12a70572f@spatialys.com>
Pete,
> How do I specify such a query using the OGR PG driver as a Mapserver
> layer to be used as a TILEINDEX of OGR vector files?
A potential solution would be to create a OGR VRT file that contains
your SQL request, and reference that VRT file in the TILEINDEX
???
??????? PG:"host='localhost' user='postgres'
dbname='mydatabase' password='mypwd'
??????? SELECT * FROM testtable
Actually you may be able to inline the VRT file as the TILEINDEX value
(it is a bit tricky regarding quoting however, but there's an example of
that in https://mapserver.org/input/vector/VirtualSpatialData.html as
the value of CONNECTION, not TILEINDEX, but that shouldn't make a
difference)), since the OGR VRT XML content can be used as a valid OGR
dataset name.
>
> Perhaps this is more of a GDAL question... or how does Mapserver's?use
> of OGR TILEINDEX of OGR vector files allow custom SQL?? Note that as a
> TILEINDEX of Rasters the TILEINDEX can point to a Mapserver Layer, so
> I /can/ add custom SQL queries in that case.? But I don't know how to
> do it as a OGR TILEINDEX pointing to OGR vectors.
For vector layer, it doesn't look like it is possible to have TILEINDEX
pointing to a MapServer vector layer (contrary to rasters), at least I
can't see any related tests in mapserver regression test suite
Even
--
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From pschmitt at gmail.com Wed Dec 7 16:31:47 2022
From: pschmitt at gmail.com (Peter Schmitt)
Date: Wed, 7 Dec 2022 17:31:47 -0700
Subject: [MapServer-users] [EXTERNAL] Vector tileindex with
connectiontype OGR
In-Reply-To: <327a7dea-295c-6451-aa6b-2ae12a70572f@spatialys.com>
References:
<0c6ff3ba957a4736b3376dc7052a9ce2@saabgroup.com>
<327a7dea-295c-6451-aa6b-2ae12a70572f@spatialys.com>
Message-ID:
On Wed, Dec 7, 2022 at 4:17 PM Even Rouault
wrote:
> How do I specify such a query using the OGR PG driver as a Mapserver layer
> to be used as a TILEINDEX of OGR vector files?
>
> A potential solution would be to create a OGR VRT file that contains your
> SQL request, and reference that VRT file in the TILEINDEX
>
>
Brilliant! This indeed works:
LAYER
NAME "vector_via_vrt"
TYPE POLYGON
TILEINDEX "
PG:host='localhost' user='postgres'
dbname='mydatabase' password='mypwd'
SELECT * FROM testtable
"
CONNECTIONTYPE OGR
STATUS OFF
END
and now requests like
http://localhost:8000/wfs?service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test.map&typename=vector_via_vrt&OUTPUTFORMAT=geojson
return the vectors pointed by the vector tileindex of vectors. I will
attempt to submit a PR to add this example to the docs when I can.
VRTs: Is there anything they can't do!?
Cheers,
Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From jukka.rahkonen at maanmittauslaitos.fi Wed Dec 7 23:55:53 2022
From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka)
Date: Thu, 8 Dec 2022 07:55:53 +0000
Subject: [MapServer-users] [EXTERNAL] Vector tileindex with
connectiontype OGR
In-Reply-To:
References:
<0c6ff3ba957a4736b3376dc7052a9ce2@saabgroup.com>
<327a7dea-295c-6451-aa6b-2ae12a70572f@spatialys.com>
Message-ID:
Hi,
We are using the ?layer-as-a-tileindex? method right now with a bit older Mapserver version and with native POSTGIS connection type. In the orthophoto layer we use
LAYER
GROUP "ortokuva"
NAME "ortokuva_r16"
STATUS ON
TILEINDEX "ortokuva_r16_postgis_tileindex"
TILESRS "crs"
and in the "ortokuva_r16_postgis_tileindex" layer
LAYER
NAME "ortokuva_r16_postgis_tileindex"
STATUS ON
TYPE POLYGON
UNITS METERS
SIZEUNITS PIXELS
CONNECTIONTYPE POSTGIS
CONNECTION "dbname=db user=user password=password"
DATA "the_geom from (SELECT fid, '/beginning/of/path/'||location as location, crs, resolution, the_geom FROM ortokuva_16m) as subquery using unique fid"
I hope that this still works with Mapserver 8. It would be nice if you could make a test and compare OGR vs POSTGIS connection types.
-Jukka Rahkonen-
L?hett?j?: Peter Schmitt
L?hetetty: torstai 8. joulukuuta 2022 2.32
Vastaanottaja: Even Rouault
Kopio: Rahkonen Jukka ; Mapserver-Users (mapserver-users at lists.osgeo.org)
Aihe: Re: [MapServer-users] [EXTERNAL] Vector tileindex with connectiontype OGR
On Wed, Dec 7, 2022 at 4:17 PM Even Rouault > wrote:
How do I specify such a query using the OGR PG driver as a Mapserver layer to be used as a TILEINDEX of OGR vector files?
A potential solution would be to create a OGR VRT file that contains your SQL request, and reference that VRT file in the TILEINDEX
Brilliant! This indeed works:
LAYER
NAME "vector_via_vrt"
TYPE POLYGON
TILEINDEX "
PG:host='localhost' user='postgres' dbname='mydatabase' password='mypwd'
SELECT * FROM testtable
"
CONNECTIONTYPE OGR
STATUS OFF
END
and now requests like http://localhost:8000/wfs?service=WFS&VERSION=1.0.0&REQUEST=getfeature&map=/app/mapfiles/test.map&typename=vector_via_vrt&OUTPUTFORMAT=geojson return the vectors pointed by the vector tileindex of vectors. I will attempt to submit a PR to add this example to the docs when I can.
VRTs: Is there anything they can't do!?
Cheers,
Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From mniemyjski at cloudferro.com Thu Dec 8 03:07:00 2022
From: mniemyjski at cloudferro.com (Marcin Niemyjski)
Date: Thu, 8 Dec 2022 11:07:00 +0000
Subject: [MapServer-users] Can't pass features attributes to GetFeatureInfo
output
Message-ID:
Hello,
I encountered the problem with GetFeatureInfo, namely:
only one attribute value is passed to GetFeatureInfo output - value of attribute used in mapfile's expression.
My GetFeatureInfo Output:
https://pasteboard.co/lAtZ5HBp1FuT.png
How I defined template:
https://pasteboard.co/uPG1DnJpgE5q.png
and how my mapfile is constructed:
https://pastecode.io/s/txa03nfw
I have checked mentioning another attribute in expression - after that its value was passed into GetFeatureinfo output.
Best,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From pschmitt at gmail.com Thu Dec 8 07:44:28 2022
From: pschmitt at gmail.com (Peter Schmitt)
Date: Thu, 8 Dec 2022 08:44:28 -0700
Subject: [MapServer-users] [EXTERNAL] Vector tileindex with
connectiontype OGR
In-Reply-To:
References: