Re: [MapServer-users] Up-to-date docker image for mapserver

2024-05-20 Thread Seth G via MapServer-users
Hi Rob,

As far as I'm aware, the camptocamp Docker image is the best maintained public 
Docker image.
You could fork this and create a new Docker image with the updated Apache. I 
believe it would be a case of updating the versions in 
https://github.com/camptocamp/docker-mapserver/blob/master/ci/dpkg-versions.yaml
 (and the version being available). 
You could also create an issue at 
https://github.com/camptocamp/docker-mapserver/issues detailing the security 
issues with the current version of Apache used. 

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Fri, May 17, 2024, at 3:40 PM, Rob Dennett via MapServer-users wrote:
> We're currently using a docker image from camptocamp 
> (https://github.com/camptocamp/docker-mapserver) in an ECS service for our 
> MapServer implementation.  However, the 7.6 tag version we're using, along 
> with latest 8.0 tag and even the master bundle MapServer with Apache 2.4.52 
> at the latest.  The most recent version is 2.4.59 and we're trying to update 
> it to resolve issues found in a pen test.  Is there a more recent Docker 
> image that people are using?
> 
> Thanks,
> Rob
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] Mapscript access to ShapeObj of GeomTransform operation

2024-05-20 Thread Seth G via MapServer-users
Hi Nicol,

The setGeomTransform method simply sets the string expression for the layer - 
no changes to the geometries occur until rendering (with the draw function), 
and temporary shapes are created and rendered. 

If you need to access transformed geometries you'd need to loop through the 
shapes and use methods on the shapeObj, e.g. 
https://mapserver.org/mapscript/mapscript-api/stub/mapscript.shapeObj.html#mapscript.shapeObj.simplify

The relatively new centerline transformation however is not part of the 
MapScript API. It could be added (and would be a nice addition).

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Sun, May 19, 2024, at 7:05 PM, Nicol Hermann via MapServer-users wrote:
> Hallo all,
>
> I'am using Python MapScript to perform a GeomTransform centerline
> operation.
> The corresponding line looks like this:
> layerObj.setGeomTransform( "simplify((centerline([shape])), 100)" )
>
> How do I get access to the calculated shapeObj of the centerline?
> The feature count of
> layerObj.numitems
> is 0 even if the underlaying data layer has two features.
>
> Interestingly with map.draw() everything look like expected
>
> Thanks for any pointers
> Nicol
>
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] zoomRectangle error image rectangle maxy >= miny

2024-05-07 Thread Seth G via MapServer-users
Hi Fernando,

There is a test case for this at:

https://github.com/MapServer/MapServer/blob/0cb56232d4ca0e64d747efa1db602ff08e0ea42f/src/mapscript/python/tests/cases/zoom_test.py#L99

This test has the MaxY < MinY. It looks like the rectObj represents an image 
rather than a map, and so the maxy and miny need to be reversed as in your 
original PHP code for SWIG MapScript too. 

The error message is:

> Exception: mapscript::mapObj::zoomRectangle(): General error message. 
> image rectangle maxy >= miny in 

And is raised at 
https://github.com/MapServer/MapServer/blob/0cb56232d4ca0e64d747efa1db602ff08e0ea42f/src/mapscript/swiginc/mapzoom.i#L239

There is a comment in the source code where this error is thrown (I think it 
applies to maxy too):

/* This is not a typo: "maxx >= minx". For historical reason, we
 * keep this as it is. See documentation for more info about this 
check. */
if (poPixRect->maxy >= poPixRect->miny) {
msSetError(MS_MISCERR, "image rectangle maxy >= miny", 
"mapscript::mapObj::zoomRectangle()");
return MS_FAILURE;
}

See https://github.com/MapServer/MapServer/issues/3286
So you'll need to reverse the Y values below (likely as it did in the old 
code). The API docs should also include this note.

> $this->geoext0->minx -334.31761006289
> $this->geoext0->miny -22
> $this->geoext0->maxx 525.31761006289
> $this->geoext0->maxy 342


Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Tue, May 7, 2024, at 10:43 AM, Fernando Sánchez García via MapServer-users 
wrote:
> Dear users, my name is Fernando and I work at the University of Córdoba 
> in Spain. I have been using mapserver for several years as a user at the 
> University together with pmapper. Our old virtual machine has Ubuntu 
> Server 18.04 LTS + mapserver 7.2.1 + PHP 5.6.40 + postgres/postgis with 
> pmapper 4.3.2. and locally on my computer I have MS4W 3.2.3 with pmapper 
> 4.3.2. Unfortunately pmapper was discontinued a few years ago and 
> although I don't have much programming knowledge, I have started trying 
> to make some small changes to the pmapper code to adapt it to PHP 7/8 
> (although I know other more up-to-date alternatives such as Openlayers).
> I have reached the "Zoom to rectangle" function where Armin implemented 
> it like this:
>
>
>      /
>   * ZOOM FUNCTIONS
>   /
>      /**
>   * Zoom to rectangle
>   */
>      protected function pmap_zoomrect()
>      {
>      if (isset($_REQUEST["imgbox"])) {
>      $imgbox_str = $_REQUEST["imgbox"];
>      //error_log($imgbox_str);
>      if ($imgbox_str != "") {
>      $imgbox_arr = explode(" ", $imgbox_str);
>      // New map extent in image pixel ((0,0) top-left)
>      $pix_minx = $imgbox_arr[0];
>      $pix_miny = $imgbox_arr[1];
>      $pix_maxx = $imgbox_arr[2];
>      $pix_maxy = $imgbox_arr[3];
>
>      if ($pix_minx == $pix_maxx) $pix_maxx = $pix_maxx + 3;  
> ## increase max extent if min==max
>      if ($pix_miny == $pix_maxy) $pix_maxy = $pix_maxy - 3;  ##
>
>      $pixext = ms_newrectObj();
>
>      // Modified by Thomas RAFFIN (SIRAP)
>      // If the rectangle is not in the same proportions as 
> the map,
>      // To leave the coeff Y / X unghanged, we need to made 
> $geoNewCoeff = $geo0Coeff...
>              $geo0Coeff = $this->mapheight / $this->mapwidth;
>              $geoNewDeltaX = $pix_maxx - $pix_minx;
>              $geoNewDeltaY = $pix_maxy - $pix_miny;
>              $geoNewCoeff = $geoNewDeltaY / $geoNewDeltaX;
>              if ($geoNewCoeff < $geo0Coeff) {
>                  $newDeltaYCorrected = $geo0Coeff * $geoNewDeltaX;
>                  $newDeltaYToAdd = ($newDeltaYCorrected - 
> $geoNewDeltaY) / 2;
>                  $pix_miny -= $newDeltaYToAdd;
>                  $pix_maxy += $newDeltaYToAdd;
>              } else {
>                  $newDeltaXCorrected = $geoNewDeltaY / $geo0Coeff;
>                  $newDeltaXToAdd = ($newDeltaXCorrected - 
> $geoNewDeltaX) / 2;
>                  $pix_minx -= $newDeltaXToAdd;
>                  $pix_maxx += $newDeltaXToAdd;
>              }
>
> $pixext->setExtent($pix_minx,$pix_miny,$pix_maxx,$pix_maxy);
>      }
>
>      // Zoom to full extent when starting
>      } else {
>      $pixext = ms_newrectObj();
>      $pixext->setExtent(0, 0, $this->mapwidth, $this->mapheight);
>      }
>
>      $this->map->zoomrectangle($pixext, $this->mapwidth, 
> $this->mapheight, $this->geoext0);
>      PMCommon::freeMsObj($pixext);
>      }
>
> In this function Mapscript zoomrectangle is called, which according to 
> the old 

Re: [MapServer-users] WMS GetFeatureInfo default FEATURE COUNT

2024-05-03 Thread Seth G via MapServer-users
Hi Andrew,

It looks like this is hard-coded to be set to 1 if missing (there is a comment 
that it is up to the server what to do if FEATURECOUNT is not provided). 
You could handle this at the web server level with a URL rewrite to add 
FEATURECOUNT to any GetFeatureInfo request where it is missing.

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Fri, May 3, 2024, at 3:43 PM, Andrew Harfoot via MapServer-users wrote:
> Hi list,
>
> In a WMS GetFeatureInfo request, if the client does not include the 
> FEATURECOUNT parameter then MapServer appears to default to 
> FEATURECOUNT=1. Is there any way to override this default in the server 
> configuration?
>
> Thanks,
>
> Andy
>
>
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] Data from MSSQL without extent

2024-04-25 Thread Seth G via MapServer-users
Hi,

You are probably looking for *wfs_use_default_extent_for_getfeature* (and 
setting to "false" in the LAYER METADATA) - see 
https://mapserver.org/ogc/wfs_server.html#layer-object

I ran into this myself as described in 
https://github.com/MapServer/MapServer/issues/5994

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Thu, Apr 25, 2024, at 5:55 PM, Benedek Petrovicz via MapServer-users wrote:
> Hi!
> 
> Is there a possibility to skip filtering for the extent when pulling in data 
> from MSSQL?
> I have to deal with some layers where I'd like to load everything for a 
> certain criteria, but don't need the extent filtering.
> 
> Thank you
> Petrovicz
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] setting COLOR of SVG symbol ?

2024-03-28 Thread Seth G via MapServer-users
Hi,

Unfortunately, I don't think this is currently possible, based on a previous 
reply from Steve Lime [1]:

> I don't believe you can muck with the SVG color since SVG can carry multiple 
> elements and colors. That complexity doesn't map very well to a single color 
> value in a styleObj. It's probably best to consider SVG as immutable, same as 
> an image symbol. You can use truetype fonts (or vector symbols) if you want 
> something scaleable where you can alter color.

I guess if it works in QGIS then it should be possible to implement this in the 
MapServer codebase too. 

Seth

[1] https://lists.osgeo.org/pipermail/mapserver-users/2019-June/081218.html

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Wed, Mar 27, 2024, at 10:45 PM, karsten via MapServer-users wrote:
> Hi All,
>  
> for the first time trying to use svg symbols for a layer. The svgs I am using 
> can be styled in QGIS (have edited to allow). 
> What is the status in MapServer should setting  the color via a style work ? 
> 
> I had no luck setting the COLOR on the symbol so far
> 
> Here is my style
>  
>  STYLE
>SYMBOL "electric_point"
>SIZE 20
>COLOR 255 0 0
>  END # STYLE 
>  
> symbol
>  
> SYMBOL
> NAME 'electric_point'
> TYPE svg
> image 'symbols/annotation/electric.svg'
> END
>  
> So far this renders black symbols , any ideas how to fix this ?
>  
> Cheers
> Karsten
>  
> Karsten Vennemann
> www.terragis.net
>  
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] WFS, OpenLayers and OUTPUTFORMAT explanations

2024-03-20 Thread Seth G via MapServer-users
Hi,

Probably best to check the WFS service GetCapabilities document to check which 
formats are supported. 
(From memory) wfs_getfeature_formatlist can include either the NAME or the 
MIMETYPE of the OUTPUTFORMAT.
You have MIMETYPE set to "application/json;subtype=geojson", so maybe try 
chaging this to "application/json" or changing the NAME from "geojson" to 
""application/json" to get an exact match. 

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Tue, Mar 19, 2024, at 11:26 AM, mathias cunault via MapServer-users wrote:
> Hello,
> Something that was never clear to me.
> Here is a mapfile for a WFS definition:
> MAP
> NAME "Mapserver-Inrap"
> FONTSET "C:\ms4w\Apache\site\fonts\fonts.txt"
> OUTPUTFORMAT
> NAME "geojson"
> DRIVER "OGR/GEOJSON"
> MIMETYPE "application/json;subtype=geojson" #option
> # FORMATOPTION "STORAGE=stream" #requis
> # FORMATOPTION "FORM=SIMPLE"
> FORMATOPTION "STORAGE=memory" #requis
> FORMATOPTION "FORM=SIMPLE"
> END #fin format
> 
> EXTENT 103362.94 6049964.789658545 1242388.01001 7108973.60237487 #xmin 
> ymin xmax ymax
> 51.07538310654 #xmin ymin xmax ymax
> UNITS METERS
> DEBUG 5
> CONFIG "CPL_DEBUG" "ON"
> CONFIG "PROJ_DEBUG" "ON"
> CONFIG MS_ERRORFILE 
> "C:/ms4w/Apache/error/errorMapFile_vue_ol_prescription.txt"
> 
> SYMBOLSET "C:\ms4w\Apache\site\symbols\symbols.sym"
> 
> PROJECTION # proj de sortie
> "init=epsg:2154"
> END
> 
> WEB 
> METADATA
> "wfs_title" "WFS Caviar"
> "wfs_onlineresource" 
> "http:///mapserv.exe?MAP=C:/ms4w/Apache/site/mapfile/vue_ol_prescription.map;
> "wms_encoding" "UTF-8"
> "wfs_srs" "EPSG:2154 EPSG:32620 EPSG:3857 EPSG:900913 EPSG:4326"
> "wfs_enable_request" "*"
> "wfs_abstract" "blabla"
> "wfs_getfeature_formatlist" "application/json, GeoJSON, json"
> END #fin metadata
> END #end web
> 
> #-debut prescription
> LAYER
> NAME "prescription"
> TYPE POLYGON
> CONNECTIONTYPE POSTGIS
> CONNECTION "host=xxx dbname=activite user=wxxx password=xxx port=5432"
> DATA "geom from activite.vue_ol_prescription using unique gid using SRID=2154"
> EXTENT 103362.94 6049964.789658545 1242388.01001 7108973.60237487 #aide 
> pour performance
> PROCESSING "CLOSE_CONNECTION=DEFER"
> CLASS
> ...
> END #-fin classe unique
> METADATA
> "gml_include_items" "all" #obligé pour afficher attributs getfeatureinfo
> "wfs_title" "prescription_2154"
> #d'après la doc pas besoin si défini dans les metadata de la map cf.10.1
> #"wfs_srs" "EPSG:2154"
> "gml_featureid" "gid"
> "wfs_enable_request" "*"
> "wfs_use_default_extent_for_getfeature" "false"
> # si geojson en premier alors geoson dans l'url pour OpenLayers:
> "wfs_getfeature_formatlist" "GeoJSON, json, application/json"
> END #fin metadata prescription
> TEMPLATE "bidon.html"
> END #fin layer prescription
> 
> END #-fin mapfile
> 
> It works fine in QGIS.
> In a javascript file with the OpenLayers library, I can define a source with 
> an url function like this:
>  url: function (extent) {
> return (
>   "http:///cgi-bin/mapserv.exe?MAP=C:/.../vue_ol_prescription.map&; +
>   "service=WFS=1.1.0=GetFeature=prescription&" +
>   "outputformat=geojson=EPSG:2154=" +
>   extent.join(",") +
>   ",EPSG:3857"
> )
> 
> Why can't I use outputformat = application/json though it is permitted by the 
> outpuformat in mapfile layer definition ? I have an error : "application.json 
>  not permitted".
> Leehan
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] filter issues with WFS

2024-02-17 Thread Seth G via MapServer-users
Hi Carlos,

If you add DEBUG 5 to the LAYER, and set the CONFIG MS_ERRORFILE do you get 
more details in the logs for why the filter is failing?
The error indicates MapServer cannot parse the filter. The unencoded filter is 
shown below. 

http://www.opengis.net/fes/2.0; 
xmlns:gml="http://www.opengis.net/gml/3.2;>

  
   wkb_geometry
   
448535 197714
448849 197791
   
  
  http://www.opengis.net/fes/2.0;>
   wkb_geometry
   http://www.opengis.net/fes/2.0; name="geomFromWKT">
http://www.opengis.net/fes/2.0;>POLYGON((447915.652115244 
195673.1860001606531, 449272.4820001816079 195673.1860001606531, 
449272.4820001816079 200345.652186265, 447915.652115244 
200345.652186265, 447915.652115244 
195673.1860001606531))
   
  



I'm guessing the geomFromWKT is not supported, so the filter should pass a GML 
Polygon object to filter by using an intersecting geometry. See 
https://mapserver.org/ogc/filter_encoding.html#tests for an example



Geometry



135.5329,34.6624 135.4921,34.8153 135.3673,34.7815
  135.3800,34.6216 135.5361,34.6210 135.5329,34.6624






Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Mon, Feb 12, 2024, at 1:33 PM, Carlos Padron Florez via MapServer-users 
wrote:
> Hi,
> 
> I have a WFS version 2.0.0 and I want to request from it features using a 
> filter but I get this error:
> msWFSGetFeature(): WFS server error. Invalid or Unsupported FILTER in 
> GetFeature :  
> The request is the following:
> 
> https://SERVER/wfs?SERVICE=WFS=GetFeature=2.0.0=ms:layername=0=100=urn:ogc:def:crs:EPSG::27700=%3Cfes:Filter
>  xmlns:fes%3D%22http://www.opengis.net/fes/2.0%22 
> xmlns:gml%3D%22http://www.opengis.net/gml/3.2%22%3E%0A %3Cfes:And%3E%0A  
> %3Cfes:BBOX%3E%0A   
> %3Cfes:ValueReference%3Ewkb_geometry%3C/fes:ValueReference%3E%0A   
> %3Cgml:Envelope srsName%3D%22urn:ogc:def:crs:EPSG::27700%22%3E%0A
> %3Cgml:lowerCorner%3E448535 197714%3C/gml:lowerCorner%3E%0A
> %3Cgml:upperCorner%3E448849 197791%3C/gml:upperCorner%3E%0A   
> %3C/gml:Envelope%3E%0A  %3C/fes:BBOX%3E%0A  %3Cfes:Intersects 
> xmlns:fes%3D%22http://www.opengis.net/fes/2.0%22%3E%0A   
> %3Cfes:ValueReference%3Ewkb_geometry%3C/fes:ValueReference%3E%0A   
> %3Cfes:Function xmlns:fes%3D%22http://www.opengis.net/fes/2.0%22 
> name%3D%22geomFromWKT%22%3E%0A%3Cfes:Literal 
> xmlns:fes%3D%22http://www.opengis.net/fes/2.0%22%3EPOLYGON((447915.652115244
>  195673.1860001606531, 449272.4820001816079 195673.1860001606531, 
> 449272.4820001816079 200345.652186265, 447915.652115244 
> 200345.652186265, 447915.652115244 
> 195673.1860001606531))%3C/fes:Literal%3E%0A   %3C/fes:Function%3E%0A  
> %3C/fes:Intersects%3E%0A %3C/fes:And%3E%0A%3C/fes:Filter%3E%0A
> 
> The same request, with obvious changes of server name, works on Geoserver. 
> This request is generated by Qgis so I don't if I can fix it via Mapserver or 
> via QGIS.
> Any ideas?
> 
> Kind regards
> 
> *Carlos Padrón, MRes *| Geomatics Team Lead
> 
>  
> 
> D: 01865 664120  W: www.gigaclear.com
> 
>  
> 
>  
> 
> signature_261337870
> 
> Gigaclear ltd, Building 1, Wyndyke Furlong, Abingdon, Oxfordshire, OX14 1UQ
> 
> Gigaclear plc is registered in England and Wales with company number 07476617
> 
>  
> 
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] Pass time range in WCS 1.0.0 request GetCoverage

2024-02-17 Thread Seth G via MapServer-users
Hi Michał,

Looking at the code, I think this is an error in the documentation - time 
ranges in WCS 1.0 do not seem to be supported. There are no tests that cover 
time ranges either. 

You could use runtime substitution to create your own queries with custom 
parameters e.g. START_DATE=2022-03-10_DATE=2022-04-10 

The section at 
https://mapserver.org/ogc/wcs_server.html#spatio-temporal-indexes recommends 
using a TILEINDEX for the layer. 

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Fri, Feb 16, 2024, at 4:31 PM, Michał Bojko via MapServer-users wrote:
> Hello,
> I am trying to build WCS service with usage of postgis database, but now I am 
> unable to pass timerange in request to server. In my postgis database I have 
> specified column for geometry and timestamp and request that use BBOX and 
> TIME (single value) work fine. The problem is I cannot pass multiple dates or 
> date range. When providing TIME in such manner, I receive this error message: 
> "WCS server error. Temporal ranges are not supported, only individual 
> values". In official documentation it is stated that it's possible to pass at 
> least two TIME parameters at once in version 1.0.0, but it doesn't work for 
> me 
> (https://mapserver.org/pl/ogc/wcs_server.html#test-with-a-getcoverage-request).
>  Is there specified way to pass timeranges/timelist (I didn't find any 
> information about it)? Or maybe it isn't possible to pass multiple values? 
> But when I look into mapserver logs I see that postgis query searches for 
> records that are between selected one day, so why wouldn't it be possible to 
> pass two days and search for records between them? Below I will paste some 
> request and queries:
> Request with single TIME value that's working for me:
> http://localhost/cgi-bin/mapserv?map=/var/www/my_wcs.map=WCS=1.0.0=GetCoverage=T36SVD=EPSG:3857=10=10=GTiff=3572705,6277219,3637743,6334339=2022-03-10
>  
> 
> 
> Request with two TIME values that isn't working for me and error message:
> http://localhost/cgi-bin/mapserv?map=/var/www/my_wcs.map=WCS=1.0.0=GetCoverage=T36SVD=EPSG:3857=10=10=GTiff=3572705,6277219,3637743,6334339=2022-03-10,2022-03-15
> WCS server error. Temporal lists are not supported, only individual values.
> 
> Request with TIME range that also isn't working for me and error message:
> http://localhost/cgi-bin/mapserv?map=/var/www/my_wcs.map=WCS=1.0.0=GetCoverage=T36SVD=EPSG:3857=10=10=GTiff=3572705,6277219,3637743,6334339=2022-03-10/2022-03-15
> WCS server error. Temporal ranges are not supported, only individual values.
> 
> Postgis query from mapserver logs when request contains only one TIME value:
> select 
> "timestamp"::text,"cloudless_10"::text,"epsg"::text,ST_AsBinary(("geometry"),'NDR')
>  as geom,"unique_id"::text from (select * from mrc where maxcc <= 100 AND 
> (pid  = '-1' OR '-1' = '-1') AND (tile  = '-1' OR '-1' = '-1') order by maxcc 
> desc) as subquerry where ST_Intersects("geometry", 
> ST_GeomFromText('POLYGON((3572710 6277224,3572710 6334334,3637738 
> 6334334,3637738 6277224,3572710 6277224))',3857)) and ("timestamp" between 
> date_trunc('day',date '2022-03-10') and date_trunc('day',date '2022-03-10') + 
> interval '1 day' - interval '1 second')
> 
> So, is there any possibility to use multiple TIME values in one GetCoverage 
> request?
> Best regards,
> Michał
> 
> *Michał Bojko*
> Trainee 
> CloudFerro S.A.
> office: Fabryczna 5  *m:* 502 705 120
> 00-446 Warszawa, Poland    *e:* mbo...@cloudferro.com
 
> 
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] CGI variable "map" fails to validate

2024-02-07 Thread Seth G via MapServer-users
Hi Matthew,

The CONFIG file I think is only reloaded when IIS or the Application Pool is 
restarted, so some changes to the regex may have been ignored. 
Do you have a sample request with the = parameter? Is there anything in a 
web.config file that could be stripping these out or modifying them?

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Wed, Feb 7, 2024, at 5:33 PM, Lernout, Matthew via MapServer-users wrote:
> MS_MAP_PATTERN '.' also results in the same failed validation error, 
> which is what makes me think the issue may be with another config 
> setting. '.' should match any input, right?
>
> Just to make sure my config file was being loaded, I commented out the 
> MS_MAP_PATTERN entry entirely, and got the error "msCGILoadMap(): Web 
> application error. Required configuration value MS_MAP_PATTERN not set."
>
> Matt
>
> -Original Message-
> From: MapServer-users  On 
> Behalf Of Jörg Thomsen (WhereGroup) via MapServer-users
> Sent: Wednesday, February 7, 2024 3:24 AM
> To: mapserver-users@lists.osgeo.org
> Subject: Re: [MapServer-users] CGI variable "map" fails to validate
>
> [You don't often get email from mapserver-users@lists.osgeo.org. Learn 
> why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Hi,
>
> I'm not sure whether the pattern is correct. Shouldn't ist start with ^?
>
> Have yout tried
> MS_MAP_PATTERN '.'? (not for production, just as a test)
>
> Jörg
>
> Am 06.02.24 um 20:12 schrieb Lernout, Matthew via MapServer-users:
>> Hi,
>>
>> Having trouble making requests since updating to 8.0.1 from 7.6.2.
>> Mapserver is running in IIS using FastCGI and the configuration steps
>> from:
>> https://maps/
>> erver.org%2Finstallation%2Fiis.html=05%7C02%7Cmatt.lernout%40stan
>> tec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c219a469297d3f2b4d
>> 80281e7%7C0%7C0%7C638428910243090792%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiM
>> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C
>> =dh%2BpgGwk5996f0GEMeX7O8rcv5J81TnPzeFNZ9XoVLs%3D=0
>> > server.org%2Finstallation%2Fiis.html=05%7C02%7Cmatt.lernout%40sta
>> ntec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c219a469297d3f2b4
>> d80281e7%7C0%7C0%7C638428910243098246%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
>> MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7
>> C=OIoWHSlKZJrXWspqwVfY5jhX4lzBcQuI%2Bw5IeOVtXBA%3D=0>
>>
>> A new config file was added to the filesystem and server Environment
>> variables as per documented requirements added since 7.6.3, but having
>> trouble validating any map arguments. All requests return the error
>> "CGI variable "map" fails to validate" even though regexp should pass
>> based on expression tests.
>>
>> Here is the full config file in use:
>>
>> CONFIG
>>ENV
>>  MS_MAP_PATTERN "\.map$"
>>  PROJ_LIB "F:/MapServer/bin/proj7/SHARE"
>>  CURL_CA_BUNDLE "F:\MapServer\bin\curl\curl-ca-bundle.crt"
>>END
>>
>>
>>PLUGINS
>>  "mssql" "F:/MapServer/bin/ms/plugins/mssql2008/msplugin_mssql2008.dll"
>>  "oci" "F:/MapServer/bin/ms/plugins/oci/msplugin_oracle.dll"
>>END
>> END
>>
>> The current MS_MAP_PATTERN is just a simplified test to confirm 8.0.1
>> working before I update to the real regexp, and my understanding is it
>> should map anything that ends in .map? But every map argument I throw
>> in (including verified working arguments for 7.6.2) result in a
>> failure to validate. Are there other crucial configurations missing
>> that are necessary to pass validation?
>>
>> Thanks,
>>
>> Matt
>>
>>
>> ___
>> MapServer-users mailing list
>> MapServer-users@lists.osgeo.org
>> https://list/
>> s.osgeo.org%2Fmailman%2Flistinfo%2Fmapserver-users=05%7C02%7Cmatt
>> .lernout%40stantec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c21
>> 9a469297d3f2b4d80281e7%7C0%7C0%7C638428910243105153%7CUnknown%7CTWFpbG
>> Zsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%
>> 3D%7C0%7C%7C%7C=c%2BjBl2NTy%2BIZxCYZmp0CLwa2ujlD%2BC%2BfzzIQgXKw
>> lyI%3D=0
>
> --
> Viele Grüße,
> Jörg Thomsen
>
> **
> Aufwind durch Wissen!
> Web-Seminare und Online-Schulungen
> bei der http://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.thom...@wheregroup.com
> http://www.wheregroup.com/
>
> Geschäftsführer:
> Olaf Knopp, Peter Stamm
> Amtsgericht Bonn, HRB 9885
>
> ---
> Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com
>
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>  Caution: This email originated from outside of Stantec. Please take 
> extra precaution.
>
>  

Re: [MapServer-users] Why is Mapserver slower in Postgres 13 than in Postgres 11?

2024-02-06 Thread Seth G via MapServer-users
Hi Rob,

Are you using the same MapServer machine to make the queries?
If the MapServer version, and dependencies are all identical then the generated 
SQL queries should also be identical.
You wrote about "hitting the web page" - but if the requested extents are 
different then it is likely the client requests are different. Are you using 
WMS services? What do these requests look like?
Also you mention 4 different layers, so I'd try testing them one by one - are 
they all generating different SQL and response times?

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Tue, Feb 6, 2024, at 8:53 PM, Rob Dennett via MapServer-users wrote:
> Both DBs are hosted on AWS Aurora.  The old one is serverless v1 and the new 
> one is serverless v2.  We were thinking that perhaps the geom column for my 
> table needed a spatial index even though the old db doesn't have one.  Is 
> that possible?  Also, would it make sense that the same query run on both 
> should take the same amount of time (roughly)?
> 
> Thanks,
> Rob
> 
> 
> 
> 
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] option to use sld in mapfile to configure layer styling

2024-01-18 Thread Seth G via MapServer-users
Hi Paul,

I think all the code functions are in place to do the bulk of this work, and 
this would be a nice addition to MapServer. Sharing SLD between applications is 
a huge benefit. If it is possible to apply SLD from a URL it should also be 
possible to apply SLD from disk. 

I wouldn't be a huge fan of embedding SLD directly in a Mapfile (although the 
CONNECTION parameter can accept large chunks of OGRVRTDataSource XML as long as 
quotes are escaped). 

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Tue, Jan 16, 2024, at 6:11 PM, Paul via MapServer-users wrote:
> mapserver has capability to use SLD to style a layer, by appending sld to 
> request
> 
> unfortunately there is currently no option to use sld as part of mapfile to 
> style a layer
> 
> what do you think to add this as a new feature to next version?
> 
> syntax could be something like this:
> 
> LAYER
> 
>   STYLEITEM "sld://mysldfile.xml" # relative path
> 
>   CLASS
> 
>   END
> 
> END
> 
> Alternative to introduce it also as embedded SLD, but the mix of ms syntax 
> and xml is not very nice.
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] filtering the data based on postgis attributes

2023-11-28 Thread Seth G via MapServer-users
Hi Marcin,

In these cases previously I've used a SQL trick to implement this, by setting a 
default value for the parameter (of a non-existent ID) and adding an OR clause 
to the SQL. E.g;

VALIDATION
"default_pid" "-1"
..

WHERE (pid  = %pid% OR %pid% = -1)

If no value is provided then the SQL will be WHERE (pid  = -1 OR -1 = -1) which 
will always return True so all records will return.

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Tue, Nov 28, 2023, at 3:32 PM, Marcin Niemyjski via MapServer-users wrote:
> Hello, 
> I would like to define several dimensions for filtering my WMS (Web Map 
> Service). They are based on a PostGIS table from which the service is 
> exposed. Here lies my problem because among the required information to 
> expose, I need to provide the following to the map server:
> 
>  • wms_dimensionlist: (Mandatory)
>  • wms_[dimensionname]_item: (Mandatory)
>  • wms_[dimensionname]_units: (Mandatory)
>  • wms_[dimensionname]_extent: (Mandatory)
>  • wms_[dimensionname]_default: (Optional)
> My issue arises because I want to filter my data based on the "product_id" 
> column containing a string. The table is large, so it's not possible to 
> provide all the ID values to "wms_productid_extent."
> 
> So, I thought about using 
> https://mapserver.org/cgi/runsub.html#table-of-contents, but the problem 
> arises with the implementation in the query. I would like to lead to a 
> situation where if I don't provide any filtering parameters (product_id, 
> cloud_cover), the entire data set is returned.
> 
> I do not want to use this:
> DATA 'geometry from (select * from mrc order by maxcc desc) where pid = 
> '%pid%' as subquerry using unique unique_id using srid=3857'
> because if I do not provide pid, my query wiill not work.
> 
> 
> 
> So, to summarize I'm looking for something like this:
> 
> DATA 'geometry from (select * from mrc order by maxcc desc) as subquerry 
> using unique unique_id using srid=3857'
> 
> VALIDATION
> 'maxCC' '^[0-9](1, 3)$'
> 'tile' '^.{6}$'
> 'pid' '^.{65}$'
> END
> 
> No default values (except time), if none is provided Mapserver does not 
> filter the data (except time).
> 
> Best,
> Marcin
> 
 

> 
> Book time to meet with me 
> 
> 
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] PHP Mapscript: how to clone layers

2023-11-26 Thread Seth G via MapServer-users
Hi Jan,

I'm not a PHP MapScript user but you should be able to use:

$l2 = $l1->cloneLayer();

As per the note at the following link - "In the Java & PHP modules this method 
is named cloneLayer. "
https://mapserver.org/mapscript/mapscript-api/stub/mapscript.layerObj.html#mapscript.layerObj.clone

I'm guessing there is a clash with the a reserved keyword in PHP so the method 
needs a different name.

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Sun, Nov 26, 2023, at 7:38 PM, Jan Hartmann via MapServer-users wrote:
> Hi,
>
> In previous versions of PHP MapScript a new layer was defined as:
>
> $l2 = new layerObj($oMap,$l1);
>
> $l1 is the base layer from which $l2 is copied.
>
> In MapScript SWIG the second parameter has disappeared. $l2 has to be 
> cloned from $l1, and then inserted into the map. With PHP-MapScript this 
> should be:
>
> $l2 = $l1->clone();
> $oMap->insertLayer($l2);
>
> But there is no PHP-MapScript function layerObj::clone. What do I miss?
>
> Jan
>
>
>
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] Python MapScript - GEOS

2023-11-23 Thread Seth G via MapServer-users
Hi,

Testing the code here and the following line: shpObjBuffer = shpObj.buffer( 
0.0005 ) returns a valid buffered polygon:

>>> shpObjBuffer
 >
>>> shpObjBuffer.toWKT()
'POLYGON ((49.965857800020 8.16013072, 49

The buffer method [1] rerturns a new shape, so I'm not sure your check for a 
True value makes sense in this line:

 if shpObjBuffer == mapscript.MS_SUCCESS:

Are you sure the buffer isn't working?

Seth

[1] 
https://mapserver.org/mapscript/mapscript-api/stub/mapscript.shapeObj.html#mapscript.shapeObj.buffer

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Thu, Nov 23, 2023, at 7:16 PM, Nicol Hermann via MapServer-users wrote:
> Hello all,
>
> it there a way to verify that GEOS Support is properly working with
> Python mapscript.
> The below buffer method fails but the msGetVersion claims
> 'SUPPORTS=GEOS'. Anything else im overlooking?
>
>
> Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
> [GCC 10.2.1 20210110] on linux
> Type "help", "copyright", "credits" or "license" for more information.
 import mapscript
 pktObj= mapscript.pointObj( 49.9653578, 8.1601308, 100 )
 shpObj= pktObj.toShape()
 shpObjBuffer= shpObj.buffer( 0.0005 )
 if shpObjBuffer == mapscript.MS_SUCCESS:
> ...rectObj = shpObjBuffer['bounds']
> ...print( rectObj )
> ... else:
> ...print('Error')
> ... 
> Error
 print(mapscript.msGetVersion())
> MapServer version 8.0.1 PROJ version 7.2 GDAL version 3.2 OUTPUT=PNG
> OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE
> SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
> SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER
> SUPPORTS=OGCAPI_SERVER SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR
> INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF
>
>
> Thanks for any help
>
> Nicol
>
>
>
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] How to format labels on contours

2023-10-21 Thread Seth G via MapServer-users
Hi,

The MapScript API docs are back online - see 
https://mapserver.org/mapscript/mapscript-api/stub/mapscript.classObj.html#mapscript.classObj

The setText() method should give you what you need. Example (using Python):

s = mapscript.classObj(layer)
# other style and label stuff
s.setText('(tostring(([SQKM]),"%.0f")+" km2")')
# check the output using 
print(s.convertToString())

When using updateFromString it will replace everything in the classObj hence 
the error.

Seth


--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Fri, Oct 20, 2023, at 9:16 PM, Trygve Aspenes via MapServer-users wrote:
> Hi
>
> So I have made a contour plot from a raster. Works nicely.
> Then I added labels to give context to the contours. Fine.
> Now I want to format the labels.
>
> I have found this post 
> https://gis.stackexchange.com/questions/350089/round-number-for-label-in-mapserver
>  
> suggesting a syntax:
> TEXT (tostring(([SQKM]),"%.0f")+" km2")
>
> Nice, but I use mapscript. And I do not understand nor find any examples 
> how I could do this with mapscript
> I tried with:
> s = mapscript.classObj(layer)
> 
> s.updateFromString('TEXT (tostring(([SQKM]),"%.0f")+" km2")')
>
> But I get:
> EOFError: loadClass(): Premature End-of-File.
>
> So obviously not correct.
>
> Is there someone who could suggest what could be wrong here or what else 
> to look at and try?
>
> Trygve Aspenes
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] Inconsistent support for template substitution

2023-10-19 Thread Seth G via MapServer-users
Hi,

This seems like a bug - there is a check to see if the Map projection is a 
geographic coordinate system [1], and if it is then it skips all the [maplon], 
[maplat], [minlon] etc. substitutions. If it is in another projection then the 
point and extent are reprojected to latlon and included in the template. 

Seth


[1] https://github.com/MapServer/MapServer/blob/main/src/maptemplate.c#L4273

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Thu, Oct 19, 2023, at 3:50 PM, Andrew Harfoot via MapServer-users wrote:
> Hi list,
> 
> I am setting up a WMS server using Mapserver 7.6.2 and want to return a html 
> response to a GetFeatureInfo request where the response contains the 
> coordinates of the GFI click. The WMS supports multiple coordinate systems, 
> so ideally I'd like to have the coordinates in a CRS that I can predetermine.
> 
> I have a test template file as follows:
> 
>  
> 
> Map X/Y : [mapx],[mapy]
> Map LL : [maplon],[maplat]
> 
> If I configure an 'old style' TEMPLATE in the map file, directly referencing 
> the html template as follows:
> 
> LAYER
>   TEMPLATE "coord_comp.html"
> With a GFI request specifying a CRS of EPSG:27700:
> 
> ...=WMS=1.3.0=GetFeatureInfo
>   
> =379766.9556955648586154,58602.32640402266406454,405538.15569556411355734,94300.79913129436317831
>   
> =EPSG:27700=649=899=test==image/jpeg_LAYERS=test
>   _FORMAT=text/html=268=647_COUNT=50
> 
> 
> 
> the output of is as follows:
> 
> 
> Map X/Y : 390428.846605,68589.162768
> Map LL : 50.516415,-2.135015
> 
> When a similar requests are made specifying a CRS of EPSG:4326:
> 
> ...=WMS=1.3.0=GetFeatureInfo
>   
> =50.33460688675980776,-2.28814701603231718,50.84060858090575863,-1.92285769511938809
>   
> =EPSG:4326=649=899=test==image/jpeg_LAYERS=test
>   _FORMAT=text/html=298=579_COUNT=50
> 
> the output is as follows:
> 
> 
> 
> 
> Map X/Y : 50.514437,-2.120136
> Map LL : [maplon],[maplat]
> 
> The maplat and maplon templates are not substituted.
> 
> Mapserver has been compiled with PROJ support and a PROJECTION has been 
> defined for the layer in the map file.
> 
> The CRS of the source data is EPSG:27700
> 
> I was hoping that the maplat and maplon templates would provide me with a 
> consistent source of coordinate information, independent of the request CRS. 
> Can anybody shed any light on the observed behaviour?
> 
> Thanks,
> Andy
> 
> -- 
> Andy Harfoot
> 
> Skype: gdi_ajph
> Teams: a...@soton.ac.uk
> Phone: +44 2380 590566
> 
> GeoData Institute
> University of Southampton
> Southampton
> SO17 1BJ
> 
> www.geodata.soton.ac.uk
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] creating a layer with PHP MapScript - shapes do not use classindex

2023-10-16 Thread Seth G via MapServer-users
Hi,

You could probably achieve this with the new SWIG MapScript. 

Alternatively how about creating an individual LAYER for each set of features 
with a single CLASS (I'm not sure how the CLASS is determined if the features 
have no attributes in the first place), and adding features to the relevant 
layer. 

If you then want to combine these into a single layer you could try a UNION 
LAYER [1], and use the STYLEITEM AUTO to pick up the styles from the layers.

Seth

[1] https://mapserver.org/mapfile/union.html
[2] https://mapserver.org/mapfile/union.html#classes-and-styles


--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Mon, Oct 16, 2023, at 2:57 PM, Worth Lutz wrote:
> Hi,
> 
> I had thought of trying that but the attributes in the values are read-only. 
> Since i created the shapeObj from WTK there are no values.
> 
> I'm using v7 of MapServer and the old PHP mapscript. There does not appear to 
> be a way for me to set attributes on these shapes which are being passed down 
> from an OpenLayers client app.
> 
> I had thought of setting a single class and putting the different colors, 
> etc, in as attribute values in the shapeObj but cannot find a way to write 
> them to the object.
> 
> I'll try any suggestions given.
> 
> Thanks,
> 
> *Worth Lutz*
> 
> On 10/16/23 03:59, Seth G wrote:
>> Hi,
>> 
>> The rendering code could be reassigning the classindex for the shapes based 
>> on their attributes. You will probably need to make sure the CLASS is 
>> assigned based on an attribute of the feature - e.g. add a CLASSITEM to the 
>> layer and add a value to the feature that will match the correct CLASS.
>> 
>> Seth
>> 
>> --
>> web:https://geographika.net & https://mapserverstudio.net
>> twitter: @geographika
>> 
>> On Sun, Oct 15, 2023, at 3:12 PM, Worth Lutz via MapServer-users wrote:
>>> HI,
>>> 
>>> I'm trying to create a layer to insert into a map. I have shapes in WKT and 
>>> am trying to insert them into a layer and draw it to a pdf.
>>> 
>>> It works fine if I only have one class for the shapes. I am trying to add 
>>> several classes to the layer to draw in different colors. I cannot get the 
>>> shapes to use the proper class.
>>> 
>>> Here is what I'm doing.
>>> 
>>> After creating a layer and adding all the classes, I add the shapes.
 for (i = 0, ii = count($features); $i < $ii; i++) {
 $shape = ms_shhapeObjFrom Wkt($features[$i]->geometry);
 $shape->set('classindex', $features[$i]->classindex);
 $success = $layer->addFeature($shape);
 }
>>> The shapes draw but all use $class[0].
>>> 
>>> If I add this line in before the draw,
>>> 
>>> $layer-moveclassup(1);
>>> 
>>> all the shapes are drawn with that class.
>>> 
>>> I have been able to verify that the classes exist in the layerObj and that 
>>> the classindex in the shapeObj points to the proper class.
>>> 
>>> Does anyone have any ideas why the drawing code is not using the classindex 
>>> to draw these shapes in different colors?
>>> 
>>> What am I doing wrong?
>>> --
>>> *Worth Lutz*
>>> 
>>> ___
>>> MapServer-users mailing list
>>> MapServer-users@lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>>> 
>> 
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] creating a layer with PHP MapScript - shapes do not use classindex

2023-10-16 Thread Seth G via MapServer-users
Hi,

The rendering code could be reassigning the classindex for the shapes based on 
their attributes. You will probably need to make sure the CLASS is assigned 
based on an attribute of the feature - e.g. add a CLASSITEM to the layer and 
add a value to the feature that will match the correct CLASS.

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Sun, Oct 15, 2023, at 3:12 PM, Worth Lutz via MapServer-users wrote:
> HI,
> 
> I'm trying to create a layer to insert into a map. I have shapes in WKT and 
> am trying to insert them into a layer and draw it to a pdf.
> 
> It works fine if I only have one class for the shapes. I am trying to add 
> several classes to the layer to draw in different colors. I cannot get the 
> shapes to use the proper class.
> 
> Here is what I'm doing.
> 
> After creating a layer and adding all the classes, I add the shapes.
>> for (i = 0, ii = count($features); $i < $ii; i++) {
>> $shape = ms_shhapeObjFrom Wkt($features[$i]->geometry);
>> $shape->set('classindex', $features[$i]->classindex);
>> $success = $layer->addFeature($shape);
>> }
> The shapes draw but all use $class[0].
> 
> If I add this line in before the draw,
> 
> $layer-moveclassup(1);
> 
> all the shapes are drawn with that class.
> 
> I have been able to verify that the classes exist in the layerObj and that 
> the classindex in the shapeObj points to the proper class.
> 
> Does anyone have any ideas why the drawing code is not using the classindex 
> to draw these shapes in different colors?
> 
> What am I doing wrong?
> 
> -- 
> *Worth Lutz*
> 
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] symbol minsize/maxsize in mapServer 8

2023-10-11 Thread Seth G via MapServer-users
Hi Jörg,

I've been playing around with the MINSCALE etc. When using an OUTLINECOLOR you 
also need to set the MINWIDTH and MAXWIDTH on the SYMBOL to change sizes with 
resolution. I think this is the issue you were seeing in your example. 
For example to keep a constant outline width of 1 you can use the following:

STYLE
SYMBOL "circle"
SIZE 100
MAXSIZE 200
MINSIZE 12
COLOR "#F9A03F"
OUTLINECOLOR "#813405"
MINWIDTH 1
MAXWIDTH 1
END

There is a working example at https://app.mapserverstudio.net/#akyRvQvW - if 
you zoom in you will notice the circles get bigger (up to 200 pixels) but the 
outline width remains at 1 pixel. 

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Wed, Oct 11, 2023, at 5:06 PM, Jörg Thomsen (WhereGroup) via MapServer-users 
wrote:
> Hello,
>
> I am curious about min- an maxsize in MS 8.
>
> I found in the docs:
>> MAXSIZE [double]
>> Removed in version 8.0.
>
> And I know don't now how to determine the maxsize of a point Symbol.
>
> maxsize still works, but not as expected. There is no error-message and 
> the maxsize auf the point-symbol is set, but when I zoom in more than 
> the scale of SYMBOLSCALEDENOM the outline of the symbol ist getting and 
> bigger.
>
> Here are two layers I tested with and you can test the WMS with
> https://schulung.foss.academy/cgi-bin/mapserv?map=minmaxsize=browse=openlayers=all
> (you have to zoom in to see what happens)
>
> LAYER
>NAME 'point'
>TYPE POINT
>DATA 'pois_p.shp'
>
>METADATA
>  'ows_title' 'Points'
>END
>
>SYMBOLSCALEDENOM 10
>CLASS
>  NAME 'points'
>  STYLE
>SYMBOL 'circle'
>SIZE 20
>COLOR 218 247 195
>OUTLINECOLOR 250 250 0
>  END
>END
>  END
>
>  LAYER
>NAME 'pointmaxsize'
>TYPE POINT
>DATA 'pois_p.shp'
>
>METADATA
>  'ows_title' 'Pointsmaxsize'
>END
>
>SYMBOLSCALEDENOM 10
>CLASS
>  NAME 'points'
>  STYLE
>SYMBOL 'circle'
>SIZE 20
>MAXSIZE 30
>COLOR 100 100 250
>OUTLINECOLOR 0 0 250
>  END
>END
>  END
>
> -- 
> Viele Grüße,
> Jörg Thomsen
> -
> Aufwind durch Wissen!
> 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.thom...@wheregroup.com
> www.wheregroup.com
>
> Geschäftsführer:
> Olaf Knopp, Peter Stamm
> Amtsgericht Bonn, HRB 9885
>
> ---
> Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] symbol minsize/maxsize in mapServer 8

2023-10-11 Thread Seth G via MapServer-users
Hi Jörg,

The STYLE MINSIZE and MAXSIZE are still valid Mapfile keywords - this was an 
error in the docs (and also came up on the dev list yesterday. This has now 
been corrected and the online docs fixed. 

I'm equally as confused as how exactly to use these. In your example what is 
your SYMBOL definition for "circle"?

I've not seen the OpenLayers template used for awhile - if could do with an 
upgrade to OL7!

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Wed, Oct 11, 2023, at 5:06 PM, Jörg Thomsen (WhereGroup) via MapServer-users 
wrote:
> Hello,
>
> I am curious about min- an maxsize in MS 8.
>
> I found in the docs:
>> MAXSIZE [double]
>> Removed in version 8.0.
>
> And I know don't now how to determine the maxsize of a point Symbol.
>
> maxsize still works, but not as expected. There is no error-message and 
> the maxsize auf the point-symbol is set, but when I zoom in more than 
> the scale of SYMBOLSCALEDENOM the outline of the symbol ist getting and 
> bigger.
>
> Here are two layers I tested with and you can test the WMS with
> https://schulung.foss.academy/cgi-bin/mapserv?map=minmaxsize=browse=openlayers=all
> (you have to zoom in to see what happens)
>
> LAYER
>NAME 'point'
>TYPE POINT
>DATA 'pois_p.shp'
>
>METADATA
>  'ows_title' 'Points'
>END
>
>SYMBOLSCALEDENOM 10
>CLASS
>  NAME 'points'
>  STYLE
>SYMBOL 'circle'
>SIZE 20
>COLOR 218 247 195
>OUTLINECOLOR 250 250 0
>  END
>END
>  END
>
>  LAYER
>NAME 'pointmaxsize'
>TYPE POINT
>DATA 'pois_p.shp'
>
>METADATA
>  'ows_title' 'Pointsmaxsize'
>END
>
>SYMBOLSCALEDENOM 10
>CLASS
>  NAME 'points'
>  STYLE
>SYMBOL 'circle'
>SIZE 20
>MAXSIZE 30
>COLOR 100 100 250
>OUTLINECOLOR 0 0 250
>  END
>END
>  END
>
> -- 
> Viele Grüße,
> Jörg Thomsen
> -
> Aufwind durch Wissen!
> 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.thom...@wheregroup.com
> www.wheregroup.com
>
> Geschäftsführer:
> Olaf Knopp, Peter Stamm
> Amtsgericht Bonn, HRB 9885
>
> ---
> Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] Call to StoredQuery successful as GET, but fails as POST request

2023-10-06 Thread Seth G via MapServer-users
Hi,

Are you able to log the SQL sent to Postgres and see the difference between the 
GET and POST request? Or maybe the query doesn't get to the database at all 
looking at that error. 
It looks like the filter is failing to convert to a Postgres query. 

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Fri, Oct 6, 2023, at 4:45 PM, Froehlich, Dominik via MapServer-users wrote:
> Dear *
> 
> 
> I'm stuck for some time experiencing a strange behavoiur with WFS POST 
> requests to stored querys on our mapserver (v.8.0.1/ubuntu 22.04) and can't 
> seem to find anythin helpful in the logs or on the web. The server is public, 
> so you can see for yourselves. To describe the issue I'll stick to our 
> address service providing the addresses in Freiburg im Breisgau, Southwest 
> Germany. 
> 
> https://geoportal.freiburg.de/wfs/gdm_address/gdm_address?SERVICE=WFS=2.0.0=GetCapabilities
> 
> The service is supposed to answer both GET and POST requests. This does work 
> just fine for "normal" GetFeature requests. However, there seems to be an 
> issue with stored queries. E.g. we set up some stored query for searching 
> addresses taking a street name and a house number as an argument. It can be 
> easily queried by calling e.g.
> 
> https://geoportal.freiburg.de/wfs/gdm_address/gdm_address?SERVICE=WFS=2.0.0=GetFeature_ID=findeStrasseHnr=fehren=12
> 
> wheras "strassenname" is the street name and "hausnummer" the house number.
> The GET call will return one matching feature as expected.
> 
> 
> The same request as POST to 
> https://geoportal.freiburg.de/wfs/gdm_address/gdm_address
> 
> http://www.opengis.net/wfs; service="WFS" version="2.0.0" 
> maxFeatures="3" xsi:schemaLocation="http://www.opengis.net/wfs 
> http://schemas.opengis.net/wfs/1.1.0/wfs.xsd; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;>
> http://www.opengis.net/wfs; 
> typeName="ms:addresses" srsName="urn:ogc:def:crs:EPSG::25832" 
> xmlns:ms="http://mapserver.gis.umn.edu/mapserver;>
> fehren
> 12
> 
> 
> 
> however will only return 
> 
> 
> xmlns:ms="http://mapserver.gis.umn.edu/mapserver;
>xmlns:gml="http://www.opengis.net/gml/3.2;
>xmlns:wfs="http://www.opengis.net/wfs/2.0;
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
>xsi:schemaLocation="http://mapserver.gis.umn.edu/mapserver 
> https://geoportal.freiburg.de/wfs/gdm_address/gdm_address?SERVICE=WFSVERSION=2.0.0REQUEST=DescribeFeatureTypeTYPENAME=ms:addressesOUTPUTFORMAT=application%2Fgml%2Bxml%3B%20version%3D3.2
>  http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd 
> http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd;
>timeStamp="2023-10-05T16:10:00" numberMatched="unknown" numberReturned="0">
> 
> 
> 
> Strange enough, it will also log some weired error at DEBUG 5:
> 
> [Fri Oct  6 14:59:29 2023].546904 msWFSParseRequest(): WFS post request: 
> http://www.opengis.net/wfs; service="WFS" 
> version="2.0.0" maxFeatures="200" 
> xsi:schemaLocation="http://www.opengis.net/wfs 
> http://schemas.opengis.net/wfs/1.1.0/wfs.xsdhttp://www.opengis.net/wfs%20http:/schemas.opengis.net/wfs/1.1.0/wfs.xsd;
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;> id="findeStrasseHnr" xmlns="http://www.opengis.net/wfs; 
> typeName="ms:addresses" srsName="EPSG::25832"> name="strassenname">fehren name="hausnummer">12
> [Fri Oct  6 14:59:29 2023].622878 FLTLayerApplyPlainFilterToLayer(): 
> (("[strassenname]" ~* "^.*feh.*$") AND (([hausnummer] =* 12) AND 
> ("[hausnummernzusatz]" = ""))), rect=399550,5305350,420740,5325690
> [Fri Oct  6 14:59:29 2023].689509 msPostGISLayerTranslateFilter(): General 
> error message. Translation to native SQL failed.
> [Fri Oct  6 14:59:30 2023].110714 msQueryByFilter(): No matching record(s) 
> found.[Fri Oct  6 14:59:30 2023].110799 mapserv request processing time 
> (msLoadMap not incl.): 0.564s
> 
> 
> The stored query itself is defined as
> 
> 
> 
> https://www.w3.org/2001/XMLSchema;
> xmlns:gml="https://www.opengis.net/gml/3.2;
> id="search_street_nr">
> 
> Straßen- und Hausnummernsuche
> Suche nach einem Straßenname und einer Hausnummer im 
> Adress-WFS
> 
> 
> 
> 
>  
> language="urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression"
> 
> xmlns:ms="https://geoportal.freiburg.de/wfs/gdm_address/gdm_address_gaz;
> returnFeatureTypes="ms:addresses">
>  xmlns:ogc="https://www.opengis.net/ogc;
> typeNames="ms:addresses">
> 
> 
> 
> 
> 
>  singleChar="?" escape="\">
> ms:strassenname
> *${strassenname}*
> 
> 
>  singleChar="?" escape="\">
> ms:hausnummer
> 

[MapServer-users] mappyfile is now an OSGeo Community Project

2023-09-28 Thread Seth G via MapServer-users
Hi all,

This month mappyfile became an official OSGeo Community Project [1]. To 
celebrate there is a v1.0.0 release, this drops Python 2.7 support, but 
includes over a year of fixes and improvements. Full release notes are at [2]. 

mappyfile is a Python library that allows you to easily create, edit, and 
format MapServer Mapfiles. Source code is on GitHub [3] and docs are at 
https://mappyfile.readthedocs.io/ and it is available on PyPI [4].

Any feedback or issue reporting welcome,

Seth

[1] https://www.osgeo.org/projects/mappyfile/
[2] https://mappyfile.readthedocs.io/en/latest/HISTORY.html
[3] https://github.com/geographika/mappyfile
[4] https://pypi.org/project/mappyfile/

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Mapscript C# and OWSRequest parameters

2021-05-31 Thread Seth G via mapserver-users
Actually as there are no URL limits with MapScript you should be able to add 
your filter as a WFS GET parameter and skip using POST requests altogether. 

https://www.mapserver.org/fr/ogc/filter_encoding.html#tests


--
web:http://geographika.co.uk
twitter: @geographika


On Mon, May 31, 2021, at 10:45 AM, Jelmer Baas wrote:
> Hi all,

>  

> Well, that route was a short one. Yes, I can call installStdinFromBuffer, but 
> actually reading something via bufferRead:

>  

> int msIO_bufferRead( void *cbData, void *data, int byteCount )

>  

> {

>   (void)cbData;

>   (void)data;

>   (void)byteCount;

>   /* not implemented yet. */

>   return 0;

> }

>  

> Unless I’m missing something, this isn’t possible, yet. I find it hard to 
> believe no-one uses MapServer to handle WFS Post requests, so I’m pretty sure 
> I’m missing something?

>  

> Regards,

> Jelmer Baas

>  

> *From:* mapserver-users  *On Behalf 
> Of *Seth G
> *Sent:* donderdag 27 mei 2021 20:35
> *To:* mapserver-users@lists.osgeo.org
> *Subject:* Re: [mapserver-users] Mapscript C# and OWSRequest parameters

>  

> Hi Jelmer,

>  

> I think you'd have to use mapscript.msIO_installStdinFromBuffer to read data 
> in.

> See https://mapserver.org/development/rfc/ms-rfc-16.html#io-hooking although 
> I'm not sure if the approach works or was fully implemented.

> Let us know how you get on,

>  

> Seth

>  

> --

> web:http://geographika.co.uk

> twitter: @geographika

>  

>  

> On Thu, May 27, 2021, at 10:39 AM, Jelmer Baas wrote:

>> Hello,

>>  

>> For a new project, I’ve decided to pickup MapScript again to function as an 
>> internal (back-end) WFS server. I use the OWSRequest class, which works fine 
>> when I fill it with loadParamsFromURL() – in the case of Get requests.

>>  

>> I can’t seem to figure out a way to get my POST data into this object, 
>> though. It has a loadParams method, but because I’m not running as a CGI 
>> application (back-end app without a webserver), this doesn’t do anything. I 
>> also tried setting postrequest property and then calling the loadParams, 
>> setting Environment variables, etc. No error, no exception, just -1 value 
>> from NumParams.

>>  

>> Any suggestions on how to proceed?

>>  

>> Regards,

>> Jelmer Baas

>>

>>  

>> ___

>> mapserver-users mailing list

>> mapserver-users@lists.osgeo.org 

>> https://lists.osgeo.org/mailman/listinfo/mapserver-users

>>  

>  

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Mapscript C# and OWSRequest parameters

2021-05-31 Thread Seth G via mapserver-users
Hi Jelmer,

There is no issue using MapServer to handle WFS POST requests, but it seems as 
though this functionality was never implemented for the MapScript bindings. 

See links:

https://github.com/MapServer/MapServer/issues/1788#issuecomment-42658553

> To implement this, we would need to actually implement the msIO_bufferRead()
> function in mapio.c, and add a function to push data into this buffer
> (something roughly like msIO_getStdoutBufferString() and
> msIO_getStdoutBufferBytes() from mapscript/swiginc/msio.i but in the
> opposite direction).
> 
And also https://github.com/MapServer/MapServer/issues/2681#issue-3960720

So two options - 1) add in the functionality for msIO_bufferRead (which would 
be a nice addition to MapServer), or 2) use the other MapScript querying 
mechanisms as documented at 
https://geographika.github.io/MapServer-documentation/mapscript/querying.html

Seth

--
web:http://geographika.co.uk
twitter: @geographika


On Mon, May 31, 2021, at 10:45 AM, Jelmer Baas wrote:
> Hi all,

>  

> Well, that route was a short one. Yes, I can call installStdinFromBuffer, but 
> actually reading something via bufferRead:

>  

> int msIO_bufferRead( void *cbData, void *data, int byteCount )

>  

> {

>   (void)cbData;

>   (void)data;

>   (void)byteCount;

>   /* not implemented yet. */

>   return 0;

> }

>  

> Unless I’m missing something, this isn’t possible, yet. I find it hard to 
> believe no-one uses MapServer to handle WFS Post requests, so I’m pretty sure 
> I’m missing something?

>  

> Regards,

> Jelmer Baas

>  

> *From:* mapserver-users  *On Behalf 
> Of *Seth G
> *Sent:* donderdag 27 mei 2021 20:35
> *To:* mapserver-users@lists.osgeo.org
> *Subject:* Re: [mapserver-users] Mapscript C# and OWSRequest parameters

>  

> Hi Jelmer,

>  

> I think you'd have to use mapscript.msIO_installStdinFromBuffer to read data 
> in.

> See https://mapserver.org/development/rfc/ms-rfc-16.html#io-hooking although 
> I'm not sure if the approach works or was fully implemented.

> Let us know how you get on,

>  

> Seth

>  

> --

> web:http://geographika.co.uk

> twitter: @geographika

>  

>  

> On Thu, May 27, 2021, at 10:39 AM, Jelmer Baas wrote:

>> Hello,

>>  

>> For a new project, I’ve decided to pickup MapScript again to function as an 
>> internal (back-end) WFS server. I use the OWSRequest class, which works fine 
>> when I fill it with loadParamsFromURL() – in the case of Get requests.

>>  

>> I can’t seem to figure out a way to get my POST data into this object, 
>> though. It has a loadParams method, but because I’m not running as a CGI 
>> application (back-end app without a webserver), this doesn’t do anything. I 
>> also tried setting postrequest property and then calling the loadParams, 
>> setting Environment variables, etc. No error, no exception, just -1 value 
>> from NumParams.

>>  

>> Any suggestions on how to proceed?

>>  

>> Regards,

>> Jelmer Baas

>>

>>  

>> ___

>> mapserver-users mailing list

>> mapserver-users@lists.osgeo.org 

>> https://lists.osgeo.org/mailman/listinfo/mapserver-users

>>  

>  

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users