Re: [MapServer-users] getting incomplete parts of a geometry

2024-01-31 Thread Scott via MapServer-users

In your .map file try setting:

PROCESSING "POLYLINE_NO_CLIP=True"

On 1/31/24 12:56, Rahkonen Jukka via MapServer-users wrote:

Hi,

The client is making tiled requests like this:


https://ibm-test.containers.wur.nl/mapserver/?map=%2Fetc%2Fmapserver%2FFood_Forest.map=WMS=mapserver=WMS=1.3.0=GetMap=image%2Fpng=true=true=mapserver=Food_Forest_layers=Food_Forest=EPSG%3A3857_FORMAT=text%2Fhtml=256=256==664084.9017416127%2C6758256.292862143%2C664696.3979678941%2C6758867.789088425
 


This tile contains most part of the parcel. What might happen is that 
when the client is asking for the next tile to the left, then the BBOX 
is partially outside the EXTENT that you have configured for the layer. 
Maybe Mapserver considers that the request is off-site and does not 
render anything.
Make your extent bigger or comment it out altogether. Also check the 
extent at the MAP level. It should cover the whole area where you 
possibly have data.


-Jukka Rahkonen-

*Lähettäjä:* MapServer-users  
*Puolesta *Eloi Ribeiro via MapServer-users

*Lähetetty:* keskiviikko 31. tammikuuta 2024 21.33
*Vastaanottaja:* mapserver-users@lists.osgeo.org
*Aihe:* Re: [MapServer-users] getting incomplete parts of a geometry

Hi,

That I don't know, but I'll check tomorrow with my colleague that is 
doing the front-end.


The URL is https://ibm.wur.nl/  and the Basemap and 
the layer is Food_Forest.


Eloi

On Wednesday, January 31st, 2024 at 20:29, Rahkonen Jukka 
> wrote:


Hi,

How about the client, what is the BBOX that it is using in the WMS
GetMap request that it creates?

-Jukka Rahkonen-

*Lähettäjä:* MapServer-users
mailto:mapserver-users-boun...@lists.osgeo.org>> *Puolesta *Eloi
Ribeiro via MapServer-users
*Lähetetty:* keskiviikko 31. tammikuuta 2024 21.19
*Vastaanottaja:* mapserver-users@lists.osgeo.org

*Aihe:* Re: [MapServer-users] getting incomplete parts of a geometry

Hi Jukka,

Thanks for your email. I got the extent from the geometry it self.
Like so:

   ogrinfo PG:"host=px port=5432 dbname=px user=px"
ibm.food_forest -summary

   INFO: Open of `PG:host=px port=5432 dbname=px user=px'

         using driver `PostgreSQL' successful.

   Layer name: ibm.food_forest

   Geometry: Polygon

   Feature Count: 1

   Extent: (194914.00, 420110.00) - (195152.00,
420307.00)

(...)

Eloi

On Wednesday, January 31st, 2024 at 19:58, Rahkonen Jukka
mailto:jukka.rahko...@maanmittauslaitos.fi>> wrote:

Hi,

Does the rendered part perhaps match with the extent that you
have configured for the layer “EXTENT 194914 420110 195152 420307”?

-Jukka Rahkonen-

*Lähettäjä:* MapServer-users
mailto:mapserver-users-boun...@lists.osgeo.org>> *Puolesta
*Eloi Ribeiro via MapServer-users
*Lähetetty:* keskiviikko 31. tammikuuta 2024 19.27
*Vastaanottaja:* mapserver-users@lists.osgeo.org

*Aihe:* [MapServer-users] getting incomplete parts of a geometry

Hi all,


I'm using Mapserver 8.0 and I'm getting incomplete parts of a
geometry, either if is TYPE LINE or POLYGON. Please, see
pictures https://pasteboard.co/ToPTZ6OnjPaJ.png
.
I wonder if I'm missing something in the mapfile. The LAYER part
of the mapfile looks like this:

/  LAYER/

/      TEMPLATE "X.tmpl"/

/      NAME "Food_Forest"/

/      STATUS ON/

/      TYPE *LINE*/

/      PROJECTION #source/

/        "init=epsg:28992"/

/      END # PROJECTION/

/      CONNECTIONTYPE POSTGIS/

/      CONNECTION "host=X port=X dbname=X user=X
password=X"/

/      DATA "geom FROM X.X USING UNIQUE X_id USING
srid=28992"/

/      EXTENT 194914 420110 195152 420307/

/      PROCESSING "CLOSE_CONNECTION=DEFER"/

/      CLASS/

/        NAME "Food_Forest"/

/        STYLE/

/          COLOR 255 0 0/

/          OUTLINEWIDTH 1/

/        END # STYLE/

/      END # CLASS/

/  END # LAYER/


Thanks!

Cheers,

Eloi


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


Re: [MapServer-users] Looking for Examples of COMPOSITE

2023-08-03 Thread Scott

Can you use color and outline color at specified width? Such as:

   CLASS
  NAME 'state'
  EXPRESSION ("[rttyp]" eq "S")
  MAXSCALEDENOM 150
  STYLE
 COLOR '#ff'
 WIDTH 8
 OUTLINECOLOR '#0e3e09'
 OUTLINEWIDTH 2
  END
   END

You could also add transparency to your outline color.


On 8/3/23 08:45, Bob Basques wrote:

Hello all,

I’m looking for example uses of the COMPOSITE function in MapFiles.   
I’m specifically in need of a way to shadow a line, to scale, on both 
sides as a way of indicating a tolerance to each side of the line.


Anyone have an example of a COMPOSITE block for accomplishing this, or 
even something close (one side)?


Thanks

Bobb

Get me in Teams 



*PW19-S295-C024*


___
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] FlatGeobuf as output format

2023-06-21 Thread Scott
I'm not sure how you're creating your fgb's, but from an ogr2ogr context 
try promoting all geoms to multi:


-nlt PROMOTE_TO_MULTI

On 6/21/23 07:50, Benedek Petrovicz wrote:

Hi!

I'm trying to integrate OGR's FlatGeobuf driver as an output format in 
my mapfiles.
It works for the most part and it's awesome, but it fails immediately 
when I feed some MultiPolygons into it.


The geometries are queried from an MSSQL DB.

I get the following error:
msOGRWriteShape(): OGR error. Attempt to write feature failed (code=6): 
ICreateFeature: Mismatched geometry type msCalculateScale(): General 
error message. Invalid image width or height.


I found a little note in the docs which corresponds with this issue 
(https://mapserver.org/input/vector/ogr.html 
):
/"Even though MapInfo and other OGR data sources may support layers with 
mixed geometry types (e.g. points, lines and polygons in the same file) 
this is not yet supported in MapServer. So you still have to define a 
layer ‘TYPE’ and make sure that all the shapes in the OGR data source 
are compatible with that layer type, otherwise MapServer may produce an 
error about incompatible geometry types at runtime."/

/
/
So it fails for me when I have Polygons and MultiPolygons in the table 
I'm querying.
But it also fails if it includes MultiPolygons only. So with no mixing 
of types.


I'm using the POLYGON type for my layer in the mapfile.

The same dataset works fine when I'm using the GML2 output format. Even 
with mixing Polygons and MultiPolygons.


Am I doing something wrong here?
Is it a known limitation for MultiPolygons?
Is there a way to bypass the issue while retaining the geometries in the DB?

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] What is the optimal value of requests per second for Mapserver?

2023-04-20 Thread Scott
Depending on what you're doing, any bulk requests should be to a 
pre-seeded MapCache and not the WMS server per se. In a production 
environment a modestly detailed raster, it's easy to kill a WMS server 
of any size.


You're going to have to test a range of requests to get a usable setup. 
You may even consider limiting the size of bounding box requests.


On 4/20/23 06:59, Oskar Ravhed wrote:
It is impossible to answer on without knowing what kind of for 
wms/wcs/wfs you are serving with mapserver


For example a simple raster wms will be able to do many request per second.

On the other side serve out osm from a postgis database will in some 
heavy scale not do more then 1 tile every 5 second


I would determ it based on cpu/disk usage instead of request  per second



On 20/04/2023 15:48, Marcin Niemyjski via MapServer-users wrote:


Hello

I'm looking for a benchmark advice.

If I have a machine running on 6 CPUs and 25gb RAM what would be the 
value of the number of requests per second from which I should start 
scaling my VMs with Mapserver?


Is there any way of testing or investingating? I'm using Locust and 
JMeter but it's really hard to get a logical answer for this question.


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

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


Re: [MapServer-users] Asking help for urgences

2023-02-10 Thread Scott

Looks like www.tinyows.org was abandoned in 2013 and re-registered in 2021.

I think what you're looking for is: https://mapserver.org/tinyows/


On 2/10/23 13:07, Boubacar Bah wrote:
hello Jeff McKenna it's been a long time since I post the same question 
but without a satisfactory answer I have a problem with the tinyows 
server.  is tinyows functional with the ms4w by what I have checked all 
the required configurations but so far the problem cannot be solved.  I 
followed all the steps detailed on your Site to save new data in the 
Frida database but in vain.  but I think the server has problems because 
the tinyows site is not even functional, here is the address 
http://www.tinyows.org 


___
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] Multiple requests to s3 bucket to the same Tiff after GetMap request

2023-02-10 Thread Scott
That file appears to be a cloud optimized geotiff. If that's the case 
multiple gets is perfectly normal as it's possibly retrieving overviews.


I don't see a server return code, but if it's 206, everything is fine.

Additionally, you can open your dev tools in your browser (Ctrl+Shift+I) 
and watch how many bytes each request gets. With COG it should never be 
the whole file.


On 2/10/23 08:27, Marcin Niemyjski via MapServer-users wrote:

Hello,
I wasn't happy with the time it took for the GetMap request to complete, 
so I decided to check apache's error logs. I realized that S3 Get 
request is performed multiple times and I have no idea why.


Below you can see GET request which appears in log file of one request 5 
times.


[Fri Feb 10 15:49:45.456184 2023] [cgi:error] [pid 1300229] [client 
127.0.0.1:37842] AH01215: > GET 
/DIAS/Sentinel-1-COG/SAR/GRD-COG/2022/03/01/S1A_IW_GRDH_1SDV_20220301T045236_20220301T045301_042123_0504C2_3E5D_COG.SAFE/measurement/s1a-iw-grd-vh-20220301t045236-20220301t045301-042123-0504c2-002.tiff HTTP/1.1\r: /usr/lib/cgi-bin/mapserv


The way my mapfile gets source raster data:

TileIndex -> VRT -> COG with Ground Control Points (this is caused by GCP)

I would be grateful if you could check full log file -> 
https://pastecode.io/s/xdyuay0f 


Thanks,
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] Failed to download capabilities:Download of capabilities failed: Connection on mapfile with more than 1000 layers

2022-12-20 Thread Scott

Yet another reason to put a wrapper around you mapserv binary.

I have hundreds of layers and block GetCapabilities outright and return 
a proper warning stating such.


Obviously, this is not a solution for everyone. Adding this, some 
security traps and whatever else you need to your wrapper is really 
beneficial.



On 12/20/22 11:33, Kralidis,Tom (ECCC) wrote:
Option: we could consider adding a mapfile directive to point to a 
GetCapabilities file (oh disk), which can act as an early out (instead 
of generating Capabilities XML on the fly).  We would want to test how 
effective this would be for larger mapfiles (i.e. reading mapfile vs. 
rendering Capabilities XML).


Feel free to open an issue if this could be helpful/is of interest.

Thanks

..Tom

*From:* MapServer-users  *On 
Behalf Of *Oskar Ravhed

*Sent:* Tuesday, December 20, 2022 10:01
*To:* Rahkonen Jukka ; Marcin 
Niemyjski ; mapserver-users@lists.osgeo.org
*Subject:* Re: [MapServer-users] Failed to download 
capabilities:Download of capabilities failed: Connection on mapfile with 
more than 1000 layers




You don't often get email from oskar.rav...@t-kartor.com 
. Learn why this is important 





Hi it took 40 s

Merry Christmas

On 20/12/2022 15:38, Rahkonen Jukka wrote:

Hi,

The time is not a constant (number of layers * x milliseconds). For
example, it is faster to generate the layer BoundingBox into
GetCapabilities if the wms_extent metadata is set for the layer
https://www.mapserver.org/ogc/wms_server.html


 but how much faster it is depends on the data source.

I think that instead of 1200 layers you could have just one time
enabled layer https://www.mapserver.org/ogc/wms_time.html

.

-Jukka Rahkonen-

*Lähettäjä:* MapServer-users

 *Puolesta *Marcin
Niemyjski via MapServer-users
*Lähetetty:* tiistai 20. joulukuuta 2022 16.18
*Vastaanottaja:* Oskar Ravhed 
; mapserver-users@lists.osgeo.org

*Aihe:* Re: [MapServer-users] Failed to download
capabilities:Download of capabilities failed: Connection on mapfile
with more than 1000 layers

Great advice, thank you Oskar.

Could you tell me how long it takes to load the WMS into qgis or
GetCap with that many layers?

I am also interested in what purpose you are using the WMS with this
amount of data. Could you share it? In my case it is daily
Sentinel-1 imagery for the whole world from the beginning of 2021.

Merry Christmas to all,

Marcin



*From:*MapServer-users mailto:mapserver-users-boun...@lists.osgeo.org>> on behalf of Oskar
Ravhed mailto:oskar.rav...@t-kartor.com>>
*Sent:* Tuesday, December 20, 2022 1:08 PM
*To:* mapserver-users@lists.osgeo.org

mailto:mapserver-users@lists.osgeo.org>>
*Subject:* Re: [MapServer-users] Failed to download
capabilities:Download of capabilities failed: Connection on mapfile
with more than 1000 layers

Hello!

I have 3234 layers in a service and it works fine. also works fine with
10.000 layers

1 try the getcap in browser
2a if step 1 is success change network timeout in qgis
2b if step 1 does not work change timeouts on server and check
mapserver
log

On 20/12/2022 09:59, Jörg Thomsen (WhereGroup) wrote:
 > Hi,
 >
 > funny, how you type twelve.
 >
 > 1200 are very much and I guess no one has tried this before.
 > So to your question: I would say yes.
 >
 > I suggest to split it into several services / mapfiles. The
 > capability-xml ist very big I think and most clients will habe
 > problems with it. The usability is bad, the users have to scroll
 > through 1200 Layers, puh. And I don't know whether a getMap with
 > http-get will work (is there a current length-limit in http-get?).
 >
 >
  

Re: [MapServer-users] How do I use an SQL query in a Postgis tileindex of vector files?

2022-12-06 Thread Scott

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.0137747521 
29.96355712017804,122.01424752183958 
29.915620560607106,122.06927507957919 
29.91602043815968,122.0688286928125 
29.963957768165944,122.0137747521 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=/tmpp/mapfile.map=1.3.0=GetMap=image/png=vector=256=256=EPSG:3857=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=/tmpp/mapfile.map=1.3.0=GetMap=image/png=vector=256=256=EPSG:3857=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@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] Problems with vrt created from GCP raster

2022-12-06 Thread Scott
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
 
<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 <https://aka.ms/o0ukef>

*Od:* MapServer-users  w 
imieniu użytkownika Scott 

*Wysłane:* Tuesday, December 6, 2022 6:39:00 PM
*Do:* mapserver-users@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@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users 

<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 
<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] Problems with vrt created from GCP raster

2022-12-06 Thread Scott

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@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] Fwd: Setting up authorization for Mapserver access using Apache2 .htaccess

2022-11-16 Thread Scott
Another way is to put a wrapper around your mapserv binary. I use PHP, 
call my wrapper 'reflect' then let apache know to use PHP on 'reflect'. 
Note the lack of .php extension. If you did have the extension no extra 
modifications to apache conf would be required.


This has huge benefits. The single biggest advantage is I can use a 
non-standard WMS uri, ie, pass only a width or height then calculate the 
missing dimension from bbox. This always results in a perfect aspect 
ratio for the resulting image. (Yes, GeoServer uses the name 'reflect', 
too. No accident).


I also use it for security screening. 'GetCapabilities' has also been 
intercepted and largely disabled.


On 11/16/22 12:00, Neil Underhill wrote:


Posting here as I didn't yet get a reply to the same query on 
StackOverflow 
(https://stackoverflow.com/questions/74309087/setting-up-authorization-to-mapserver-using-apache2-htaccess ).


I am running a website with Apache/2.4.53 (Debian) and Mapserver 7.6.2. 
I have set up a 'secure' part of the web site following instructions 
here: 
https://www.digitalocean.com/community/tutorials/how-to-set-up-password-authentication-with-apache-on-ubuntu-14-04  .


I would now like to display some geospatial data held in Mapserver via 
an Openlayers WFS map on the secure site. The challenge I have is that 
once a user logs in, they can see the MapServer access details in the 
Openlayers script so have the server URL and mapfile name, and can 
access this outside the secure site i.e. without going through Apache 
authentication.


There was some discussion about securing access MapServer 11 years ago 
(https://gis.stackexchange.com/questions/5686/securing-wms-against-unauthorized-access ) but this didn't seem applicable.


As I understand it Mapserver is accessed through a CGI to which requests 
are redirected through Apache. Would moving the /usr/bin/mapserv 
executable into a folder managed by Apache2 work? (as seems to be 
suggested here: 
https://stackoverflow.com/questions/51850322/cgi-bin-htaccess-or-apache2-config-rules-bring-up-password-dialog-but-cgi-exec 


Any advice appreciated.

___
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] "Emergency" map server on Raspberry Pi - raster/PNG source in folder structure

2022-10-12 Thread Scott

This is an ideal scenario for serverless.

Put your vector data in FlatGeoBuf (.fgb) format and your highest res 
tiles as a COG tif. You can have those files on a local device or in the 
cloud.


Use leaflet with flatgeobuf, georaster-layer-for-leaflet and some modest 
javascript.


You're making this wy too difficult.


On 10/12/22 04:55, Stefan Gofferje wrote:

Hi all,

Life (and COVID) hit, so I never got anywhere with updating my weather 
website and taking mapserver into use there.


Currently I have another project - due to the geopolitical situation:
I'm working on a mobile system to provide emergency/off-grid "tactical" 
communication and data. It's centered on a Raspberry Pi and includes 
things like Meshtastic and others. One of the things I would like to add 
is a WMS/WFS server to provide map data via local Wifi AP to connected 
devices.


Topographical (and other) maps of whole Finland are available under CC4 
from the Finnish Land Survey through the KAPSI non-profit. The maps are 
in 12kx12k PNGs in a folder structure by UTM grid. See here: 
http://kartat.kapsi.fi/files/peruskarttarasteri_jhs180/taustavari_korkeuskayrilla/1m/etrs89/png/

The data can by rsync'd down.
I'm not clear how I would configure mapserver for that. Do I have to 
create one map with extent and such for each PNG tile or can I point 
mapserver to the root directory  of the data and tell it to go through 
it recursively and get the data from the PGW sidecar files?


-Stefan


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


Re: [MapServer-users] WMS: Not all features show, depending on how I zoom and pan

2022-10-02 Thread Scott
It would be interesting if you could change your 
'irrigation-network.gml' into a different format, say .shp, something like:


ogr2ogr irrigation-network.shp irrigation-network.gml

Then try that as a data source in your layer and see if your results 
differ. This would might help us distinguish between a driver issue and 
a mapserver issue.




On 10/2/22 04:51, Antonis Christofides wrote:

Hello Seth,

Thanks for replying. I experimented and found out there's no difference 
if I use something minimal such as what you suggested. What does make a 
difference is the CRS: if I tell QGIS to use EPSG:2100 (Greek grid—the 
CRS the data files use), then everything works fine. If I use 4326 or 
3857, then the problem appears. Therefore it appears that the problem is 
with reprojecting (as the stackexchange user "nmtoken" had suspected). 
Leaflet seems to be requesting 3857.


What would be the right course of action here? Should I tell Leaflet to 
do the reprojection instead? Should I investigate further why mapserver 
has trouble reprojecting (and how would I do that)? Should I reproject 
my data files (GML) offline and store them in 3857 instead of 2100? Is 
there any common/best practice regarding this?


Thanks!

Antonis



On 28/09/2022 17.47, Seth G wrote:

Hi,

Is there any change if you update the layer to have a single class 
with a simple line (no EXPRESSION, LABEL, MAXSCALEDENOM)?


E.g.

    CLASS
    STYLE
    COLOR 0 0 255
    WIDTH 6
    END

Seth

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

On Wed, Sep 28, 2022, at 1:03 PM, Antonis Christofides wrote:


Hello,

I have a problem that has already been discussed in stackexchange 
(https://gis.stackexchange.com/questions/440902/mapserver-wms-not-all-features-show-depending-on-how-i-zoom-and-pan ), but without solution so far.


I'm repeating the full text here, but if there's any problem with the 
images it might be better to go to stackexchange to read it.


Here is how QGIS shows an irrigation network, received by MapServer 
via WMS and superimposed on OpenStreetMap:


enter image description here

Here is the same thing, but slightly panned to the right:

enter image description here

Several items are obviously missing. In fact there are items missing 
in the top picture as well. Different items become visible as I zoom 
and pan differently.


Since this pretty much tells the whole story, I'm not going into more 
details. MapServer version is 7.6.2 (prepackaged for Debian). The 
base URL is 
https://poros.irmasys.com/cgi-bin/mapserv?map=/opt/aira-poros/aira-poros/mapserver/extralayers.map . Finally, below I paste the interesting parts of the mapfile.


Thanks!

Antonis




|MAP NAME "aira-poros" STATUS ON SIZE 9040 7731 EXTENT 103986.57 
3850796.18 1007945.14 4623933.00 UNITS meters PROJECTION 
"init=epsg:2100" END CONFIG MS_ERRORFILE 
"/var/log/mapserver/extralayers.log" # [Omitting some OUTPUTFORMAT 
sections] WEB IMAGEPATH "/var/cache/mapserver/" IMAGEURL 
"/mapserver_tmp/" METADATA "wms_title" "Aira Poros" 
"wms_onlineresource" 
"https://poros.irmasys.com/cgi-bin/mapserv?map=/opt/aira-poros/aira-poros/mapserver/extralayers.map&;  "wms_srs" "EPSG:4326 EPSG:2100 EPSG:3857" "wms_enable_request" "*" "wms_feature_info_mime_type" "text/html" "wfs_title" "Aira Poros" "wfs_onlineresource" "https://poros.irmasys.com/cgi-bin/mapserv?map=/opt/aira-poros/aira-poros/mapserver/extralayers.map&;  "wfs_srs" "EPSG:2100 EPSG:4326 EPSG:3857" "wfs_enable_request" "*" END END LAYER NAME "irrigation-network" TYPE LINE CONNECTIONTYPE OGR CONNECTION "irrigation-network.gml" METADATA "wms_title" "Irrigation network" "wfs_title" "Irrigation network" "gml_include_items" "all" "gml_featureid" "id" END STATUS ON PROJECTION "init=epsg:2100" END CLASSITEM 'category' CLASS EXPRESSION '1' STYLE COLOR 0 0 255 OPACITY 50 WIDTH 6 END LABEL COLOR 0 0 255 ANGLE FOLLOW OFFSET 5 99 MAXSCALEDENOM 1 TEXT "[irri_code]" END LABEL COLOR 0 0 255 ANGLE FOLLOW OFFSET -8 99 MAXSCALEDENOM 1 EXPRESSION (NOT('[Diameter]' = '')) TEXT "D=[Diameter] mm" END END # [Omitting three more classes] END # [Omitting four more layers] END|

___
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] MapServer-users Digest, Vol 176, Issue 10

2022-09-20 Thread Scott
I was asking if they were both on the same server, that is, they have 
the same ip address (127.0.0.1). MapServer/tinyows are on the same 
server as PostGIS.


On 9/20/22 11:08, Boubacar Bah wrote:

hi scott, yes indeed i connect with the same parameter.
but you say that the database must be on the same server, that tinyows 
is what you developed a little bit that.
because my database is on my postgis server and tinyows is however an 
implementation of mapserver how can I put them on the same server so 
that they are not managed by the same software

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


Re: [MapServer-users] asking help

2022-09-20 Thread Scott
It looks like a database connection error. Are you able to connect with 
psql using those parameters? Is tinyows on the same server as your database?


You might also try using 127.0.0.1 instead of localhost.


On 9/20/22 04:12, Boubacar Bah wrote:

   Hello, I hope you are doing well.
here I need your help concerning tinyows. I try to connect tinyows to 
postgis but it sends me an error saying that the connection failed. I 
really don't know what to do anymore.

any help will be good.
here are the configuration parameters
http://127.0.0.1/cgi-bin/tinyows 
"

schema_dir="C:/ms4w/apps/tinyows/schema/"
check_schema="0">

port="5432"/>




http://www.tinyows.org/ "
email="tinyows-us...@lists.maptools.org 
" />


http://www.tinyows.org/ "
name="demo_tyny"
title="Frida Parks" />


and the error message.
http://www.opengis.net/ows 
"xmlns:ows="http://www.opengis.net/ows 
"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
"xsi:schemaLocation="http://www.opengis.net/ows 
 
http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd 
"version="1.1.0"language="en">


Connection to database failed



___
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 UTF grids with MapServer and MapCache

2022-09-07 Thread Scott

In your .map file do you have the MVT format defined, something like:

 OUTPUTFORMAT
NAME "mvt"
DRIVER MVT
FORMATOPTION "EDGE_BUFFER=10"
  END

On 9/7/22 12:38, karsten wrote:

Thanks Scott,
I do have a tileset like this below
   

Flurst UTF
Flurst UTF

flurst_utf
disk
   GoogleMapsCompatible

mvt
5 5
10
3600

but also with this get the error
tileset "flurst_utf_tiles" references format "mvt", but it is not configured

*From:* karsten [mailto:kars...@terragis.net]
*Sent:* Wednesday, September 07, 2022 12:08
*To:* 'mapserver-users@lists.osgeo.org'
*Subject:* Creating UTF grids with MapServer and MapCache

Hi All,
I am working on a correct configuration to cerate UTFGrid json tiles via 
MapCache and MapServerto seed a json tile set
MapCache is up and running on my ubuntu 20 server and WMS requests (PNG, 
Jpeg ) are working as is the seeding utility.


Now I am trying to add a UTFGrid tile layer and added the mvt format 
into the (working for the other layers correctly) mapcache.xml:


    
  mvt
  application/vnd.mapbox-vector-tile
    

the layer is

    
   
  
     mvt
     flurst
     /var/mapdata/utfgrid.map
  
   
   
  http://myserver/cgi-bin/mapserv
   
    

When tryign to restrart apache however I get this error message

systemctl status apache2.service
● apache2.service - The Apache HTTP Server
  Loaded: loaded (/lib/systemd/system/apache2.service; enabled; 
vendor preset: enabled)
  Active: failed (Result: exit-code) since Wed 2022-09-07 20:31:58 
CEST; 28s ago
    Docs: https://httpd.apache.org/docs/2.4/ 
<https://httpd.apache.org/docs/2.4/>
     Process: 1265907 ExecStart=/usr/sbin/apachectl start (code=exited, 
status=1/FAILURE)


Sep 07 20:31:58 terraz systemd[1]: Starting The Apache HTTP Server...
Sep 07 20:31:58 terraz apachectl[1265919]: AH00526: Syntax error on line 
43 of /etc/apache2/sites-enabled/000-default.conf:
Sep 07 20:31:58 terraz apachectl[1265919]: tileset "flurst_utf_tiles" 
references format "mvt", but it is not configured

Sep 07 20:31:58 terraz apachectl[1265907]: Action 'start' failed.

What am I missing here ?

Thanks

  


Karsten Vennemann
www.terragis.net <http://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] Creating UTF grids with MapServer and MapCache

2022-09-07 Thread Scott

You probably need to define the tileset, something like:


  test_wms_mvt
  myGridName
  disk
  MVT



On 9/7/22 12:08, karsten wrote:

Hi All,
I am working on a correct configuration to cerate UTFGrid json tiles via 
MapCache and MapServerto seed a json tile set
MapCache is up and running on my ubuntu 20 server and WMS requests (PNG, 
Jpeg ) are working as is the seeding utility.


Now I am trying to add a UTFGrid tile layer and added the mvt format 
into the (working for the other layers correctly) mapcache.xml:


    
  mvt
  application/vnd.mapbox-vector-tile
    

the layer is

    
   
  
     mvt
     flurst
     /var/mapdata/utfgrid.map
  
   
   
  http://myserver/cgi-bin/mapserv
   
    

When tryign to restrart apache however I get this error message

systemctl status apache2.service
● apache2.service - The Apache HTTP Server
  Loaded: loaded (/lib/systemd/system/apache2.service; enabled; 
vendor preset: enabled)
  Active: failed (Result: exit-code) since Wed 2022-09-07 20:31:58 
CEST; 28s ago
    Docs: https://httpd.apache.org/docs/2.4/ 

     Process: 1265907 ExecStart=/usr/sbin/apachectl start (code=exited, 
status=1/FAILURE)


Sep 07 20:31:58 terraz systemd[1]: Starting The Apache HTTP Server...
Sep 07 20:31:58 terraz apachectl[1265919]: AH00526: Syntax error on line 
43 of /etc/apache2/sites-enabled/000-default.conf:
Sep 07 20:31:58 terraz apachectl[1265919]: tileset "flurst_utf_tiles" 
references format "mvt", but it is not configured

Sep 07 20:31:58 terraz apachectl[1265907]: Action 'start' failed.

What am I missing here ?

Thanks

  


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] MB Tiles vs. UTF grids

2022-09-02 Thread Scott

I'm ill equipped to answer your question directly.

However, as you delve into the world of vector tiles I'd strongly 
suggest taking a look a FlatGeoBuf (.fgb). It's an index format 
supported by GDAL and MapServer. It's very fast and painless.


The home page has demo's for openlayers, leaflet and mapbox, using a 
single 12GB census data file. Leaflet seems to be the most responsive.


http://flatgeobuf.org/




On 9/2/22 15:22, karsten wrote:

Hi All,
For the first time, I am diving into actually using vector tiles and or 
UTF grids on an OpenLayers map. I am confused  about UTF grids, 
especially I could not find clear answers whether UTFGrids have been 
completely replaced by MB Tiles or if UTF Grids are now a subset of MB 
Tiles. Posts on the web seem to suggest that UTF grids can be stored 
inside MB Tiles 
. 
Note that I am trying to stay outside the Mapbox empire (as much as 
possible) and trying to use GDAL, MapServeretc.
GDAL can produce MB tiles (but not sure if that includes UTF grid info 
as well) and MapServer can deliver UTF grid via WMS on the fly, but not 
sure how performance is so far ...

Would anyone have some insights ?
Thanks
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] Ask for advice on Caching large layers on high zoom level

2022-09-02 Thread Scott
COG files imply that they are already tiled. I'd be curious as to the 
performance of map rendering using just the COG files without creating 
tiles.


Being the 'size of Poland' doesn't really matter. It's the pixel 
resolution that is important. If the pixel resolution is 100 meters vs 3 
meters you will have different performance results.


Seeding will always be bound by CPU, memory, etc. Creating an image 
(ami) of your system in AWS, then running multiple EC2's instance can be 
insanely fast.




On 9/2/22 06:41, Marcin Niemyjski via MapServer-users wrote:

Hello,

My job is to cache 365 layers. These layers consist of up to 30 .tif 
(COG) files stored in a mapfile. These layers are roughly the size of 
Poland and I would like to acquire their tiles for level 14 zoom. One 
layer for these settings:
sudo mapcache_seed -c /DiscPlanetiler/2022/03/02/2022-03-02.xml -t 
20220302 -g PUWG1992 -z 10,10 -n 32
caches 83h (32 cores is my max). I am looking for advice on how I could 
speed up the generation of these tiles.


Thanks,
Marcin

___
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] Accessing FlatGeoBuf (.fgb) in S3 bucket?

2022-08-28 Thread Scott
Even with the .fgb and LAYER having the same layer name it doesn't work 
FROM S3.


It works fine even with different names IF the .fgb is on local disk 
relative to the web server. It doesn't work if the .fgb is in an AWS S3 
bucket. (note the vsis3 url). ogrinfo to the vsis3 url works fine. 
Raster data on S3 works fine.


Having .fgb accessible from object storage is kinda the whole point of 
the .fgb file format.


Thank for the suggestion!


On 8/28/22 08:34, Patrick Young wrote:

Hi Scott,

What does ogrinfo report the name of the layer in "data.fgb" to be? If 
the layer isn't named "rm_trace" I think you might see that error. FWIW 
I've served from .fgb's in mapserver in both 7.6.4 and 8.


Patrick

On Fri, Aug 26, 2022 at 11:32 AM Scott <mailto:pub...@postholer.com>> wrote:


Using mapserver 7.6 or 8rc1 I've never been able to serve .fgb from an
S3 bucket. Local disk works fine as does ogrinfo on S3 .fgb. COG raster
data works fine off S3.

Map file configs:

v8rc1:
CONNECTIONTYPE flatgeobuf
DATA "/vsis3/bucket/path/data.fgb"

v7.6.4
CONNECTIONTYPE OGR
CONNECTION "/vsis3/bucket/path/data.fgb"
DATA "rm_trace"

v8rc ms_error log:
[Fri Aug 26 10:24:13 2022].854479 msDrawMap(): Image handling error.
Failed to draw layer named 'rm_trace'.

v7.6.4 ms_error log
[Fri Aug 26 10:06:59 2022].388096 msOGRFileOpen(): OGR error. Open
failed for OGR connection in layer `rm_trace'.  File not found or
unsupported format. Check server logs.
[Fri Aug 26 10:06:59 2022].388132 Open failed for OGR connection in
layer `rm_trace'.


-- 
www.postholer.com <http://www.postholer.com>

___
MapServer-users mailing list
MapServer-users@lists.osgeo.org <mailto:MapServer-users@lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/mapserver-users
<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


[MapServer-users] Accessing FlatGeoBuf (.fgb) in S3 bucket?

2022-08-26 Thread Scott
Using mapserver 7.6 or 8rc1 I've never been able to serve .fgb from an 
S3 bucket. Local disk works fine as does ogrinfo on S3 .fgb. COG raster 
data works fine off S3.


Map file configs:

v8rc1:
CONNECTIONTYPE flatgeobuf
DATA "/vsis3/bucket/path/data.fgb"

v7.6.4
CONNECTIONTYPE OGR
CONNECTION "/vsis3/bucket/path/data.fgb"
DATA "rm_trace"

v8rc ms_error log:
[Fri Aug 26 10:24:13 2022].854479 msDrawMap(): Image handling error. 
Failed to draw layer named 'rm_trace'.


v7.6.4 ms_error log
[Fri Aug 26 10:06:59 2022].388096 msOGRFileOpen(): OGR error. Open 
failed for OGR connection in layer `rm_trace'.  File not found or 
unsupported format. Check server logs.
[Fri Aug 26 10:06:59 2022].388132 Open failed for OGR connection in 
layer `rm_trace'.



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


Re: [MapServer-users] Mapserver 8 rc1

2022-08-25 Thread Scott

Thank you for the quick response and all that you folks do!


On 8/25/22 14:54, Steve Lime wrote:
Thanks for checking! Looks like there might be an issue with 
the msPostGISReplaceBoxToken() rewrite in C++ in mappostgis.cpp.


On Thu, Aug 25, 2022 at 4:20 PM Scott <mailto:pub...@postholer.com>> wrote:


ms_error log is telling me it's unable to build the SQL query. There
are
no errors in the postgresql log.

Even if I comment the line out I get an error, such as:
--where st_intersects(geom, !BOX!)
or:
/* !BOX! */

If it exists any where in the DATA block, it fails.

Here's the ms error log:

[Thu Aug 25 13:46:55 2022].451955 msPostGISBuildSQL(): General error
message. Failed to build SQL 'where'.
[Thu Aug 25 13:46:55 2022].451980 msPostGISLayerWhichShapes(): Query
error. Failed to build query SQL.
[Thu Aug 25 13:46:55 2022].452010 msDrawMap(): Image handling error.
Failed to draw layer named 'wptByTrailType'.

On 8/25/22 13:03, Steve Lime wrote:
 > Hmmm... Wasn't an intentional omission. If you have logging
turned on
 > and can see the resulting SQL, does the !BOX! get replaced but just
 > incorrectly or is the !BOX! still in the SQL.
 >


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


Re: [MapServer-users] Mapserver 8 rc1

2022-08-25 Thread Scott
ms_error log is telling me it's unable to build the SQL query. There are 
no errors in the postgresql log.


Even if I comment the line out I get an error, such as:
--where st_intersects(geom, !BOX!)
or:
/* !BOX! */

If it exists any where in the DATA block, it fails.

Here's the ms error log:

[Thu Aug 25 13:46:55 2022].451955 msPostGISBuildSQL(): General error 
message. Failed to build SQL 'where'.
[Thu Aug 25 13:46:55 2022].451980 msPostGISLayerWhichShapes(): Query 
error. Failed to build query SQL.
[Thu Aug 25 13:46:55 2022].452010 msDrawMap(): Image handling error. 
Failed to draw layer named 'wptByTrailType'.


On 8/25/22 13:03, Steve Lime wrote:
Hmmm... Wasn't an intentional omission. If you have logging turned on 
and can see the resulting SQL, does the !BOX! get replaced but just 
incorrectly or is the !BOX! still in the SQL.


On Wed, Aug 24, 2022 at 5:16 PM Scott <mailto:pub...@postholer.com>> wrote:


I've installed 8rc1 and I've run into an issue. I didn't see
anything in
the change log, so I'll put it here.

The !BOX! variable that has been historically available doesn't seem to
be supported with CONNECTIONTYPE POSTGIS any longer. For instance:

     DATA "geom from (
        select
           geom
        from sometable
        where st_intersects(geom, !BOX!)
     ) as sq using unique geom using srid=4269"

...will throw an error:


http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd
<http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd>">


msDrawMap(): Image handling error. Failed to draw layer named
wptsAll.
msPostGISLayerWhichShapes(): Query error. Failed to build query SQL.
msPostGISBuildSQL(): General error message. Failed to build SQL
where.



If I remove the !BOX! it will work.

Thanks!
Scott

--
www.postholer.com <http://www.postholer.com>
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org <mailto:MapServer-users@lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/mapserver-users
<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


[MapServer-users] Mapserver 8 rc1

2022-08-24 Thread Scott
I've installed 8rc1 and I've run into an issue. I didn't see anything in 
the change log, so I'll put it here.


The !BOX! variable that has been historically available doesn't seem to 
be supported with CONNECTIONTYPE POSTGIS any longer. For instance:


   DATA "geom from (
  select
 geom
  from sometable
  where st_intersects(geom, !BOX!)
   ) as sq using unique geom using srid=4269"

...will throw an error:


"http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd;>



msDrawMap(): Image handling error. Failed to draw layer named 
wptsAll.

msPostGISLayerWhichShapes(): Query error. Failed to build query SQL.
msPostGISBuildSQL(): General error message. Failed to build SQL 
where.




If I remove the !BOX! it will work.

Thanks!
Scott

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


Re: [mapserver-users] getting the scale in a map file at runtime

2022-06-04 Thread Scott
If you're using an SQL query in your map file and it's a WMS/WFS (maybe 
others) service, you can determine scale from !BOX!, %WIDTH%, %HEIGHT%.


To add to your question, I'd be curious to know does a resource exist 
that lists all '[var]' resources available to a map file at run time?



On 6/3/22 08:00, Richard Greenwood wrote:
On Fri, Jun 3, 2022 at 8:43 AM Jörg Thomsen (WhereGroup) 
mailto:joerg.thom...@wheregroup.com>> wrote:


Richard,
sorry, yes, sure...

Perhaps you can use scaletoken? It's not the same as you are searching
for, but you could define a set of tolerance-values for different
scales.


Yes - I had not thought of that. It might be a better way than what I 
was trying to do. Thank you!



Am 03.06.22 um 16:21 schrieb Richard Greenwood:
 >
 >
 > On Fri, Jun 3, 2022 at 8:00 AM Jörg Thomsen (WhereGroup)
 > mailto:joerg.thom...@wheregroup.com>
>> wrote:
 >
 >     Hi,
 >
 >     what about:
 > https://mapserver.org/mapfile/template.html#image-geometry

 >     >
 >     -> scaledenom
 >
 >     Doesn't work?
 >
 >
 > Thanks, but no, it does not work. I'm trying to access the scale
in a
 > map file, not in a template. Using square brackets [variable] is
 > interpreted as a field name in the data, not as a runtime
variable. For
 > example:
 >    CLASS
 >      STYLE
 >        GEOMTRANSFORM (generalize([shape], [scaledenom]))
 >        COLOR "#2AB1F7"
 >      END
 >    END
 > returns the error:
 > DBASE file error. Item 'scaledenom' not found.
 >
 >
 >     Jörg
 >
 >
 >     Am 03.06.22 um 15:45 schrieb Richard Greenwood:
 >      > Can I get the current scale for use in a map file at runtime.
 >      > Specifically, I'd like to use it in a geotransform
something like:
 >      >     GEOMTRANSFORM (generalize([shape], [scale]))
 >      > or more likely for use in an expression:
 >      >     GEOMTRANSFORM (generalize([shape], [scale] / 100))
 >      > Thanks
 >      > --
 >      > Richard W. Greenwood
 >      > www.greenwoodmap.com 
>
 >     
>>
 >      >
 >      > ___
 >      > MapServer-users mailing list
 >      > MapServer-users@lists.osgeo.org

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

 >     >
 >
 >
 >     --
 >     Viele Grüße,
 >     Jörg Thomsen
 >
 >     -
 >     Aufwind durch Wissen!
 >     Jetzt neu: Web-Seminare und Online-Schulungen
 >     bei der www.foss-academy.com 
>
 >     -
 >
 >     Jörg Thomsen
 >     WhereGroup GmbH
 >     Bundesallee 23
 >     10717 Berlin
 >     Germany
 >
 >     Tel: +49 (0)30 / 5130 278 74
 >     Fax: +49 (0)30 / 5130 278 11
 >
 > joerg.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

 >     

Re: [mapserver-users] mapserver OGR does not forward BBOX at all

2022-03-29 Thread Scott
In your request you have a typeName=tiger:tigerRoads. In your map file 
the wfs_typename is GROUND_REFERENCE_VALUES_NI_int



On 3/29/22 01:17, Lars Fricke wrote:

Hi,
thank you for the fast reply. Unfortunately, even with the srs given 
with the bbox the "Fetch" command does not forward any bbox at all. So 
mapserver / OGR fetches up to the max number of features given no matter 
where they are located. They are then filtered out by mapserver using 
the original bbox because they do not fit (just the first 500 or so).


Mapfile layer definition (sorry I forgot):
LAYER
     NAME "GROUND_REFERENCE_VALUES_NI"
     UNITS METERS
     TYPE POLYGON
     DEBUG  "5"
     CONNECTION "ground_reference_values_ni.xml"
     CONNECTIONTYPE OGR
     STATUS ON
     DATA "boris:BR_BodenrichtwertZonal"
     METADATA
   "wfs_srs" "EPSG:25832"
   "wfs_version"    "1.1.0"
   "wfs_storedquery_id" ""
   "wfs_title"    "GROUND_REFERENCE_VALUES_NI"
   "wfs_connectiontimeout" "30"
   "wfs_typename"    "GROUND_REFERENCE_VALUES_NI_int"
   "wfs_maxfeatures"   "500"
   "gml_include_items" "all"
   "wfs_enable_request" "*"
   "gml_featureid" "gml_id"

     END # METADATA

     PROJECTION
   "init=epsg:25832"
     END # PROJECTION
     CLASS
   NAME "reference_map"
   STYLE
     OUTLINECOLOR 255 0 0
     WIDTH 0.7
   END # STYLE
     END # CLASS
   END # LAYER

The XML file referenced is in attach.

Best
Lars

Am 29.03.22 um 10:06 schrieb artcliff...@gmail.com:


Hi Lars,

Might this help?

geoserver - WFS and WMS query SRS parameter and BBOX usage - 
Geographic Information Systems Stack Exchange 



I haven’t done much with the WFS tech but based on the link above, you 
may need to provide the crs info for the bbox.


In their example:

http://demo.geo-solutions.it/geoserver/tiger/ows?service=WFS=1.1.0=GetFeature=tiger:tiger_roads=EPSG:3857=40.7,-74,40.8,-73,urn:ogc:def:crs:EPSG:4326=1 



Note the bbox is defined as:
bbox=40.7,-74,40.8,-73,urn:ogc:def:crs:EPSG:4326


If your bbox is the same as the requested projection:
your bbox in the wfs request would be:

BBOX=545592,5806696,548144,5810131,urn:ogc:def:crs: EPSG:25832

Or the epsg code at the end would be whatever units your bbox is in.
Note, the bbox EPSG code can be different than the srsName



*From:* MapServer-users  *On 
Behalf Of *Lars Fricke

*Sent:* Tuesday, March 29, 2022 12:31 AM
*To:* mapserver-users@lists.osgeo.org
*Subject:* [mapserver-users] mapserver OGR does not forward BBOX at all

Hi All,

First of all, thank you for your support and great work on Mapserver!

I have a strange issue using either OGR WFS driver on Mapserver 
7.6.4-1 or ogrinfo (GDAL 3.0.4, released 2020/01/28) on Ubuntu 20.


When I call on a particular public server, mapserver / gdal / ogr does 
not seem to forward the bbox. I had a similar issue before (over a 
year ago) on another server but this was fixed by an update in GDAL it 
seemed.


The Server is

`https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022?`

The Layer is
`boris:BR_BodenrichtwertZonal`

A direct call from the browser works:

`https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022?SERVICE=WFS=2.0.0=GetFeature=EPSG:25832=545592,5806696,548144,5810131=boris:BR_BodenrichtwertZonal 
`


I can see in Mapserver log (CONFIG "CPL_DEBUG" "ON"  CONFIG 
"PROJ_DEBUG" "ON") that the BBOX is missing:


`Fetch(https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022?SERVICE=WFS=1.1.0=500=EPSG:25832_CAPABILITIES_BOUNDS=YES=GetFeature=boris:BR_BodenrichtwertZonal 
)`


By the way, it does not matter if WFS 1.1.0 or 2.0.0 are used.

Trying with ogrinfo:
```
ogrinfo -ro -spat 545592 5806696 548144 5810131 
WFS:"https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022; 
 
"boris:BR_BodenrichtwertZonal"


INFO: Open of 
`WFS:https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022'

  using driver `WFS' successful.
Metadata:
  ABSTRACT=BORIS 2022 WFS by XtraServer
  PROVIDER_NAME=Landesamt für Geoinformation und Landesvermessung 
Niedersachsen (LGLN) - Landesbetrieb Landesvermessung und 
Geobasisinformation

  TITLE=BORIS 2022 WFS
ERROR 1: No schema information loaded
Warning 1: NAS: Skipping geometry without feature

Layer name: 

Re: [mapserver-users] Cannot read shp file from database

2022-03-28 Thread Scott

I think the srid should be 900913 and actually it should probably be 3857.


On 3/28/22 11:59, Jeremy JK wrote:

Thanks!


On Mon, Mar 28, 2022 at 2:52 PM Seth G > wrote:


__
Hi,

The following 3 lines should all be in your LAYER...END block (and
replacing the current DATA line):

   CONNECTIONTYPE postgis
   CONNECTION "user=postgres password=StrongAdminP@ssw0rd
dbname=news_test_shp host=127.0.0.1 port=5432"
   DATA "geom from sample.admintable using unique gid using
srid=9000913"


Seth
--
web:https://geographika.net 
twitter: @geographika


On Mon, Mar 28, 2022, at 8:29 PM, Jeremy JK wrote:

Hello all,
On my virtualbox linuxmint machine I can view a shp file with
MapServer when the shp file is on filesystem.
When I put it into the database, the browser returns an error message
but ogrinfo program can read the database well.
See below

And thanks for your assistance
J

*Error*: msLoadMap(): Unknown identifier. Parsing error near
(CONNECTIONTYPE):(line 9)
*Petition*:

http://localhost:8080/cgi-bin/mapserv?map=/opt/mapfile/mapserver_quickstart.map=WMS=Getmap=1.1.1=Countries=EPSG:4326=-137,29,-53,88=PNG=800=600




*ogrinfo *PG:"host=127.0.0.1 user=postgres
password=StrongAdminP@ssw0rd dbname=news_test_shp port=5432"
sample.admintable -summary
INFO: Open of `PG:host=127.0.0.1 user=postgres
password=StrongAdminP@ssw0rd dbname=news_test_shp port=5432'
      using driver `PostgreSQL' successful.

Layer name: sample.admintable
Geometry: Multi Polygon
Feature Count: 258
Extent: (-180.00, -90.00) - (180.00, 83.634101)
Layer SRS WKT:
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
...

+++
*MAP*
  NAME "MAPSERVER_QUICKSTART"
  EXTENT -137 29 -53 88
  UNITS DD
  SHAPEPATH "/opt/mapfile"
  SIZE 800 600

  IMAGETYPE PNG24
  CONNECTIONTYPE postgis
  CONNECTION "user=postgres password=StrongAdminP@ssw0rd
dbname=news_test_shp host=127.0.0.1 port=5432"
  DATA "geom from sample.admintable using unique gid using
srid=9000913"


  PROJECTION
    "init=epsg:4326"
  END

  WEB
    METADATA
      ows_title "MapServer Quickstart"
      ows_enable_request "*"
      ows_srs "EPSG:4326 EPSG:25832 EPSG:25833"
    END
  END

  LAYER
    NAME "Countries"
    STATUS ON
    TYPE POLYGON
    DATA "ne_10m_admin_0_countries"
    CLASS
      STYLE
        COLOR 246 241 223
        OUTLINECOLOR 0 0 0
      END
    END
  END

END

++
___
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

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


Re: [mapserver-users] Fwd: Why TileMode generates different display effect of WMS with the same map file?

2022-02-12 Thread Scott

Try OUTLINEWIDTH instead of WIDTH

On 2/12/22 16:14, Kyle Qian wrote:
Hi, I use the same map file to serve WMS and TileMode request. The style 
part in it is very simple:


   CLASS
       NAME       "highway"
       STYLE
         COLOR        0 0 0
         WIDTH        1
       END
     END

  But MapServer 7.6.4 generate different display effect for TileMode and 
WMS respectively. I also changed the WIDTH to 6 and it does not help. I 
have attached screenshots for comparison.

  How can I get almost the same display effect in these two modes?

___
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] Point query from Mapserver raster

2021-10-29 Thread Scott
If you're using postgres/postgis it's easy using the raster version of 
st_intersection. It returns lat/lon/value or more precisely 
geometry/value. See more here:


https://postgis.net/docs/RT_ST_Intersection.html

Then it's just WFS.


On 10/29/21 4:09 PM, Carl Godkin wrote:

Hi,
Now that I have my WMS and WCS servers working well (thanks, list!!), I 
have one more thing I would like to figure out how to do.


I want to do point queries on [Lat,Lon] points for their elevation from 
the terrain layer I have.


I have done some searching and come across various ideas such as Raster 
Query (https://mapserver.org/input/raster.html#raster-query 
) and a query 
template  
(https://gis.stackexchange.com/questions/167239/mapserver-raster-picking-elevation-data 
) 
but haven't found enough information for either to implement it.


I came up with a solution that works fine, but might be considered as 
going "All Around the Barn"   What works is to add an ASCII output 
format to my map file that serves terrain like this:


OUTPUTFORMAT
NAME XYZ
DRIVER "GDAL/XYZ"
MIMETYPE "text/plain"
IMAGEMODE FLOAT32
EXTENSION "txt"
END

and then use GetCoverage on a small rectangle whose lower-left corner
is the point whose elevation I want:

http://localhost:8080/wcs?SERVICE=WCS=2.0.1=GetCoverage=SRTM_3_arc-second_grid=XYZ=Lat(42.948,42.958)=Lon(-122.086,-122.076) 



and then take the first line of the returned output file.

What would Mapserver best practice be for a problem like this?

Thanks very much,

carl









___
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


[mapserver-users] Raster pixel alpha

2021-10-26 Thread Scott
I'm trying this but it doesn't seem to work, note the alpha byte on the 
end of colorrange values, IMAGEMODE for png is RGBA:



CLASS
   EXPRESSION ([pixel] >= 0 && [pixel] <= 100)
   STYLE
  datarange 0 100
  colorrange '#' '#ff00'
   END
END


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


Re: [mapserver-users] Getting started with mapcache for WMTS...

2021-10-25 Thread Scott
Try using mapcache seeder. That will create some cached images to work 
with. It will also test your mapcache config:


https://mapserver.org/mapcache/seed.html

How you use those tiles is a whole different subject.



On 10/25/21 2:54 PM, Carl Godkin wrote:

Hi again,

Is there a way to search through the mapserver-users mailing list 
archive except month-by-month?  If so, I can't find it.  (I usually use 
my Gmail archives for GDAL and PROJ since I've subscribed forever to 
those but I'm a mapserver newbie.)  Anyway...


I am trying to configure mapcache to serve from my (local and AFAICT 
fully working) WMS server on my MS4W 4.0.5 installation.  I am following 
the  directions at https://mapserver.org/mapcache/index.html 
 as well as the steps listed 
from the local MS4W page (#mapcache-apache-module).


I think I understand the basic principles and have added a new source 
that looks like this:





image/geotiff
FAA_Sectional_Charts
TRUE
EPSG:4326
-125,24,-61,49



http://localhost:8080/wms 



and a new tileset that looks like this:


faa
disk
WGS84
PNG
5 5
10
3600

(This is the same as the "test" tileset with a different source.)

But how do I test this? The query

http://localhost:8080/mapcache/wmts?service=wmts=getcapabilities=1.0.0 



lists my new source as a layer. The docs say

 5.

Test your MapCache configuration by following steps in the
associated MapCache testing docs


but that seems to be about testing the mapcache/demo.  I don't see how 
to add something to the mapcache/demo if that's possible.  What am I 
overlooking?


Thanks a lot,
carl






___
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


[mapserver-users] RASTER conditionally use default palette color based on pixel value

2020-12-05 Thread Scott



For instance:

...

   CLASS
  NAME "useDefaultColor"
  EXPRESSION ([pixel] >= 100 && [pixel] < 200)
  STYLE
 #COLOR "#cc"   <-- this works (uncommented of course)
 COLOR [red] [green] [blue] <-- this does not
  END
   END
...

Thank you!


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


Re: [mapserver-users] Clipping a .tif with a polygon within .map file

2020-11-22 Thread Scott


Thanks for solution, this is perfect!!

On 11/22/20 8:08 AM, Richard Greenwood wrote:
Here's an example using a shapefile for the mask but any vector source 
will work the same.


LAYER
   GROUP "a17"
NAME "a17-mask"
   STATUS off
   TYPE polygon
   DATA "shapefiles/mask"
   CLASS
     STYLE COLOR 0 0 0 END
   END
END

LAYER
   NAME "a2017"
   GROUP "a17"
   STATUS off
   TYPE raster
   DATA "raster/imagery/2017/a17.tif"
MASK "a17-mask"
END

On Sun, Nov 22, 2020 at 8:43 AM Scott <mailto:pub...@postholer.com>> wrote:


For instance:

DATA "/path/to/some.tif"

Within the same map file I'd like to clip that .tif with a polygon from
a database query.

I'm not sure how to go about this without loading the raster in the
database, which I'd rather not do.

Is this possible?

Thanks!

-- 
www.postholer.com <http://www.postholer.com>

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



--
Richard W. Greenwood, PLS
www.greenwoodmap.com <http://www.greenwoodmap.com>

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


[mapserver-users] Clipping a .tif with a polygon within .map file

2020-11-22 Thread Scott

For instance:

DATA "/path/to/some.tif"

Within the same map file I'd like to clip that .tif with a polygon from 
a database query.


I'm not sure how to go about this without loading the raster in the 
database, which I'd rather not do.


Is this possible?

Thanks!

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


Re: [mapserver-users] REST API as a LAYER DATA source

2020-07-30 Thread Scott

Thanks! The OGR method works great.

---

LAYER
   NAME "resttest"
   TYPE POINT
   STATUS ON
   CONNECTIONTYPE OGR
   CONNECTION "https://example.com/query?format=geojson;

   # DATA layername from:
   #ogrinfo 'https://example.com/query?format=geojson'
   DATA "OGRGeoJSON"

   METADATA
  ows_title "Rest Test"
  wms_abstract "Rest Test"
  gml_include_items "all"
  wfs_connectiontimeout "30"
  wfs_maxfeatures   "500"
  wfs_request_method   "GET"
  wfs_typename "resttest"
  wfs_featureid "fid"
  wfs_enable_request "*"
  wfs_getfeature_formatlist "CSV,JSON,GEOJSON"
   END

   CLASS
  NAME 'rest test'
  LABEL
 STYLE
SYMBOL 'pointMarkUnfilled'
SIZE 7
COLOR '#00'
WIDTH 2
 END

 PRIORITY 10
 TEXT '[colValue]'
 COLOR '#00'
 OUTLINECOLOR '#ff'
 OUTLINEWIDTH 3
 FONT "serifBold"
 TYPE truetype
 SIZE 10
 ANGLE 0
 POSITION AUTO
 PARTIALS false
 OFFSET 3 0
 WRAP ' '
 MAXLENGTH 21
  END
   END
END

On 7/30/20 11:29 AM, Steve Lime wrote:
Presumably you could use an OGR layer although I've not done it myself. 
I guess I'd recommend starting with:


   * https://mapserver.org/input/vector/ogr.html
   * https://gdal.org/drivers/vector/esrijson.html#vector-esrijson

--Steve


On Thu, Jul 30, 2020 at 11:50 AM Scott <mailto:pub...@postholer.com>> wrote:


I would like to use a REST API as a mapfile LAYER/DATA source, not
output.

Can someone point me to the correct documentation for that?

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org <mailto: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

[mapserver-users] REST API as a LAYER DATA source

2020-07-30 Thread Scott

I would like to use a REST API as a mapfile LAYER/DATA source, not output.

Can someone point me to the correct documentation for that?

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

Re: [mapserver-users] MAXSCALEDENOM using runtime var

2020-06-16 Thread Scott

Thanks for the response.

My mapserv binary is in a wrapper so I have control over dubious 
features I may (intentionally) introduce.


With that said, if it's not readily available and only available via 
modification, someone more knowledgeable had good reason. I'll think of 
a different approach.


Thanks again!

On 6/16/20 1:56 PM, Steve Lime wrote:
Hi Scott: Nope, the various scale denominator properties are not mutable 
via URL parameters. It's a relatively simple change to make it happen 
(just modify maplexer.l (look for the keyword of choice) and rebuild) 
but I'm not sure it's a great idea since you could be opening up some 
performance headaches for both your mapping box and backend data 
sources. I mean, a user could essentially affect at what level high 
density data could be drawn at, so imagine asking for high density roads 
at a global scale from a remote PostgreSQL/PostGIS source.


--Steve

On Tue, Jun 16, 2020 at 3:36 PM Scott <mailto:pub...@postholer.com>> wrote:


Is it possible to set MAX(MIN)SCALEDENOM using a runtime variable?

Example:

...
MAXSCALEDENOM %maxscaledenom%
...



-- 
www.postholer.com <http://www.postholer.com>

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org <mailto: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

[mapserver-users] MAXSCALEDENOM using runtime var

2020-06-16 Thread Scott

Is it possible to set MAX(MIN)SCALEDENOM using a runtime variable?

Example:

...
MAXSCALEDENOM %maxscaledenom%
...



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

[mapserver-users] SVG relative points

2018-10-02 Thread Scott
Is there a mapfile configuration option for specifying how the output 
svg geometry is created? Specifically, relative geometry instead of 
absolute.


For instance, to get relative geometry using postgis I can do this:

st_assvg(geom, 1, 0)

...which says output geom, in relative geometry (1) and number of 
decimal places(0).


Relative geometry and no decimal places (ie, epsg 3857, meters) reduces 
the resulting svg significantly.


Your thoughts?

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

Re: [mapserver-users] Server hacked via cgi-bin - Mapserver, PHP, …? How to better protect the machine now?

2013-12-09 Thread Scott
If I understand you correctly, you have the php executable in cgi-bin? 
That is a major no, no. You should never do that, be it the php binary 
or the perl binary as an attacker can pass command line parameters 
directly to the executable bypassing your configuration file.


Only scripts like *.pl or *.php, which call the binary on the first line 
ie, #!/usr/bin/php -q, should be placed in the cgi-bin directory.


As far as mapserve in cgi-bin, I don't know enough about it. Personally, 
I would never put *any* executable in cgi-bin, including mapserv.


Scott


On 12/09/13 02:59, Stefan Schwarzer wrote:

Hi there,

our server on which we have an application with mapserver running has been 
hacked two times within the last month. Each time (it seems), they succeeded to 
inject a perl script through /cgi-bin/.

Now, not yet 100% how they came in… But it seems they came in via PHP in 
/cgi-bin/. But we're not 100% sure. If it would be the case, we could delete 
the PHP in /cgi-bin? Are there any reports on /cgi-bin/mapserv being hacked?

Thanks for any hints,

Stefan

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


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


[mapserver-users] Lat/Lon variable? Vertical GRID labels?

2013-11-06 Thread Scott

Greetings!

Newbie here. I've been working with the excellent map server program for 
about 2 weeks. It is awesome.


2 questions (for now):

Are variables for lat/lon sent to a layer, ie, [lat] or [lon] so that 
they may be used in EXPRESSION?


How do you make vertical lat, left edge, labels for the GRID. I just 
can't figure that out.


Thanks!
Scott

www.postholer.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] GetLegendGraphic and Mapserver upgrade

2011-04-01 Thread Scott Stewart
Hi

I recently upgraded a mapserver 5.2 server to 5.6.6 and it has broken my
abiltity to get legend icons WITHOUT labels and a specificied size

here is my legend block from my mapfile

LEGEND
IMAGECOLOR 255 255 255
KEYSIZE 20 10
KEYSPACING 5 5
LABEL
  SIZE MEDIUM
  TYPE BITMAP
  BUFFER 0
  COLOR 0 0 0
  FORCE FALSE
  MINDISTANCE -1
  MINFEATURESIZE -1
  OFFSET 0 0
  PARTIALS TRUE
END
POSITION LL
STATUS OFF
  END


and here is my RULE for the layer

 CLASS
  NAME AboveNet
  STYLE
ANGLE 360
COLOR 0 0 255
OPACITY 100
SYMBOL 0
WIDTH 4
  END
END

 and here is my request

http://
server/cgi-bin/mapserv?map=/home/fiberlocatormaps/mapfiles/fiberlocator.mapLAYER=l_abovenetRULE=AboveNetSERVICE=WMSVERSION=1.1.1REQUEST=GetLegendGraphicFORMAT=image%2FpngWIDTH=16HEIGHT=16


When I make this call on the new server, I ALWAY get back a legend graphic
with a label. On the old server, i get back a nice 16x16 png. I have read in
some place about ommiting the RULE in the request, but this didnt work for
me. It still returns the label. If i remove the CLASS from the mapfile, it
returns an empty image

My question is what changed and how do i go about fixing or rectifying the
problem?

-- 
Scott Stewart
Principal
NBT Solutions LLC
phone: (757)941-5110
email: scott.stew...@nbtsolutions.com
website:www.nbtsolutions.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Changing map file parameters via a URL - special characters

2010-08-11 Thread Scott Pezanowski

Hi,

I am trying to use mapserver to generate image maps from a PostGIS connection 
based upon a user entered FILTER. The data column I am trying to filter by is a 
tsvector column type. So the FILTER for my LAYER looks something like this:

FILTER textsearchable_index_col @@ to_tsquery('search terms')

I do have things working where I can hard code the FILTER for the LAYER in the 
MAP file. Things work great and I am very happy about this. The problem lies 
that I would now like to allow my client application to change this FILTER 
dynamically through a URL request based upon what search terms the user enters. 
So the URL would look something like this:

http://.../mapserv?map.layer[layername].filter=%22textsearchable_index_col%20@@%20to_tsquery%28%27newsearchterms%27%29%22mode=mapmap=mapfile.maplayers=layernamemap_imagetype=pngmapext=-73203436.227488+-51717904.824712+73203436.227488+51717904.824712imgext=-73203436.227488+-51717904.824712+73203436.227488+51717904.824712map_size=1870+1321imgx=935imgy=660.5imgxy=1870+1321

I am getting the following error:

loadLayer(): Unknown identifier. Parsing error near (textsearchable_index_col 
@@ to_tsquery('newsearchterms')):(line 1)


Through looking around a little, I believe the @@ special characters in the 
filter parameter are causing the issue. Can anyone confirm that this is may be 
the case (or think of what else may be the issue) and suggest a workaround 
(escaping these characters in some way, etc.)?

Thanks,
Scott



* Scott Pezanowski 


email: scott...@hotmail.com  
*

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


[mapserver-users] RE: Changing map file parameters via a URL - special characters

2010-08-11 Thread Scott Pezanowski

Hi,

I have looked into this more and it may not be the special characters. I can 
not change the filter in any way using this url parameter method. The only url 
filter parameter that works is an empty one:

mapserv?map.layer[0].filter=''

If I add any filter into the single quotes (even a very simple one), then I get 
this error:

mapserv?map.layer[0].filter='oid=5'

loadLayer(): Unknown identifier. Parsing error near (oid=5):(line 1)


Does anyone know the correct syntax for this parameter? I am going but this 
document page:

http://mapserver.org/cgi/controls.html

In this section:

Changing map file parameters via a form or a URL

Thanks,
Scott




* Scott Pezanowski 


email: scott...@hotmail.com  
*



From: scott...@hotmail.com
To: mapserver-users@lists.osgeo.org
CC: scott...@hotmail.com
Subject: Changing map file parameters via a URL - special characters
Date: Wed, 11 Aug 2010 10:35:23 -0400








Hi,

I am trying to use mapserver to generate image maps from a PostGIS connection 
based upon a user entered FILTER. The data column I am trying to filter by is a 
tsvector column type. So the FILTER for my LAYER looks something like this:

FILTER textsearchable_index_col @@ to_tsquery('search terms')

I do have things working where I can hard code the FILTER for the LAYER in the 
MAP file. Things work great and I am very happy about this. The problem lies 
that I would now like to allow my client application to change this FILTER 
dynamically through a URL request based upon what search terms the user enters. 
So the URL would look something like this:

http://.../mapserv?map.layer[layername].filter=%22textsearchable_index_col%20@@%20to_tsquery%28%27newsearchterms%27%29%22mode=mapmap=mapfile.maplayers=layernamemap_imagetype=pngmapext=-73203436.227488+-51717904.824712+73203436.227488+51717904.824712imgext=-73203436.227488+-51717904.824712+73203436.227488+51717904.824712map_size=1870+1321imgx=935imgy=660.5imgxy=1870+1321

I am getting the following error:

loadLayer(): Unknown identifier. Parsing error near (textsearchable_index_col 
@@ to_tsquery('newsearchterms')):(line 1)


Through looking around a little, I believe the @@ special characters in the 
filter parameter are causing the issue. Can anyone confirm that this is may be 
the case (or think of what else may be the issue) and suggest a workaround 
(escaping these characters in some way, etc.)?

Thanks,
Scott



* Scott Pezanowski 


email: scott...@hotmail.com  
*

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


[mapserver-users] SUA convert

2009-11-09 Thread Scott Penrose

Hey team

I am using Mapserver to show some airspace, and the data comes in a  
standard format called SUA or OpenAir. Both a basic text files using  
LatLong and descriptives shapes, such as:


TYPE=CTA/CTR
TITLE=ADELAIDE
TOPS=FL245
BASE=FL180
POINT=S353001 E1364920
POINT=S351526 E1373454
POINT=S351526 E1373454
ANTI-CLOCKWISE RADIUS=49.97 CENTRE=S345649 E1383128 TO=S354540 E1381803
POINT=S354540 E1381803
POINT=S362422 E1380512
POINT=S362422 E1380512
ANTI-CLOCKWISE RADIUS=89.95 CENTRE=S345649 E1383128 TO=S353001 E1364920

What would be the best (probably read here - easiest) way to display  
the data on mapserver?
Which probably translates to - what is the easiest file format or  
tools to use to convert and display the data above?


E.g. I could write some Perl/XSL to convert the files into KML - but  
is that the right format? Perhaps shape files?


Or... hope above hope... maybe someone has done this already? or knows  
another way to show Airspace files?


Thanks

Scott

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


RE: [mapserver-users] symbolize a wms map based upon a sql count() query

2008-10-30 Thread Scott Pezanowski
Hi Pietro,

Thank you for your response. Sure, I will try below to add some sample data 
that illustrates what I am trying to do. I have a votes table which has a 
vote for each county (A versus B). This can be joined by a responseid to a 
table response, which has the date in which the votes were submitted. Also, 
countyid references my geometry in a separate table. In summary, the first 
thing I would like to do is count the number of votes for 'A', and count the 
number of votes for 'B', both per county and based upon a user entered 
datesubmitted range; And then symbolize my map based upon these results. Also, 
and I guess ideally, I'd like to also produce a percentage of votes for 'A', 
per county, based upon the total votes for A and B for each county. And then 
color code my counties based upon this percentage.

Thank you for help you may provide.

Scott

Below is some sample data:

votes table:

countyid;vote;responseid
1;B;296532B5A40C493592C9E6B480E15E37
2;A;296532B5A40C493592C9E6B480E15E37
3;B;296532B5A40C493592C9E6B480E15E37
4;B;296532B5A40C493592C9E6B480E15E37
5;B;296532B5A40C493592C9E6B480E15E37
6;B;296532B5A40C493592C9E6B480E15E37
7;B;296532B5A40C493592C9E6B480E15E37
8;B;296532B5A40C493592C9E6B480E15E37
9;A;296532B5A40C493592C9E6B480E15E37
10;B;296532B5A40C493592C9E6B480E15E37
11;B;296532B5A40C493592C9E6B480E15E37
12;B;296532B5A40C493592C9E6B480E15E37
13;B;296532B5A40C493592C9E6B480E15E37
14;A;296532B5A40C493592C9E6B480E15E37
15;B;296532B5A40C493592C9E6B480E15E37
16;B;296532B5A40C493592C9E6B480E15E37
17;B;296532B5A40C493592C9E6B480E15E37
18;B;296532B5A40C493592C9E6B480E15E37
19;B;296532B5A40C493592C9E6B480E15E37
20;B;296532B5A40C493592C9E6B480E15E37
21;B;296532B5A40C493592C9E6B480E15E37
22;B;296532B5A40C493592C9E6B480E15E37
23;A;296532B5A40C493592C9E6B480E15E37
24;A;296532B5A40C493592C9E6B480E15E37
25;A;296532B5A40C493592C9E6B480E15E37
26;A;296532B5A40C493592C9E6B480E15E37
27;B;296532B5A40C493592C9E6B480E15E37
28;B;296532B5A40C493592C9E6B480E15E37
29;B;296532B5A40C493592C9E6B480E15E37
30;A;296532B5A40C493592C9E6B480E15E37
31;B;296532B5A40C493592C9E6B480E15E37
32;B;296532B5A40C493592C9E6B480E15E37
33;B;296532B5A40C493592C9E6B480E15E37
34;B;296532B5A40C493592C9E6B480E15E37
35;A;296532B5A40C493592C9E6B480E15E37
36;B;296532B5A40C493592C9E6B480E15E37
37;A;296532B5A40C493592C9E6B480E15E37
38;B;296532B5A40C493592C9E6B480E15E37
39;A;296532B5A40C493592C9E6B480E15E37
40;A;296532B5A40C493592C9E6B480E15E37
41;B;296532B5A40C493592C9E6B480E15E37
42;B;296532B5A40C493592C9E6B480E15E37
43;A;296532B5A40C493592C9E6B480E15E37
44;B;296532B5A40C493592C9E6B480E15E37
45;B;296532B5A40C493592C9E6B480E15E37
46;A;296532B5A40C493592C9E6B480E15E37
47;B;296532B5A40C493592C9E6B480E15E37
48;B;296532B5A40C493592C9E6B480E15E37
49;B;296532B5A40C493592C9E6B480E15E37
50;B;296532B5A40C493592C9E6B480E15E37
51;A;296532B5A40C493592C9E6B480E15E37
52;B;296532B5A40C493592C9E6B480E15E37
53;B;296532B5A40C493592C9E6B480E15E37
54;B;296532B5A40C493592C9E6B480E15E37
55;B;296532B5A40C493592C9E6B480E15E37
56;B;296532B5A40C493592C9E6B480E15E37
57;B;296532B5A40C493592C9E6B480E15E37
58;B;296532B5A40C493592C9E6B480E15E37
59;B;296532B5A40C493592C9E6B480E15E37
60;B;296532B5A40C493592C9E6B480E15E37
61;B;296532B5A40C493592C9E6B480E15E37
62;B;296532B5A40C493592C9E6B480E15E37
63;A;296532B5A40C493592C9E6B480E15E37
64;B;296532B5A40C493592C9E6B480E15E37
65;B;296532B5A40C493592C9E6B480E15E37
66;B;296532B5A40C493592C9E6B480E15E37
67;B;296532B5A40C493592C9E6B480E15E37
1;B;AE2E9A609C65420A9DDF37A9E56A25A8
2;B;AE2E9A609C65420A9DDF37A9E56A25A8
3;A;AE2E9A609C65420A9DDF37A9E56A25A8
4;A;AE2E9A609C65420A9DDF37A9E56A25A8
5;A;AE2E9A609C65420A9DDF37A9E56A25A8
6;A;AE2E9A609C65420A9DDF37A9E56A25A8
7;A;AE2E9A609C65420A9DDF37A9E56A25A8
8;A;AE2E9A609C65420A9DDF37A9E56A25A8
9;B;AE2E9A609C65420A9DDF37A9E56A25A8
10;B;AE2E9A609C65420A9DDF37A9E56A25A8
11;A;AE2E9A609C65420A9DDF37A9E56A25A8
12;A;AE2E9A609C65420A9DDF37A9E56A25A8
13;A;AE2E9A609C65420A9DDF37A9E56A25A8
14;A;AE2E9A609C65420A9DDF37A9E56A25A8
15;A;AE2E9A609C65420A9DDF37A9E56A25A8
16;A;AE2E9A609C65420A9DDF37A9E56A25A8
17;A;AE2E9A609C65420A9DDF37A9E56A25A8
18;A;AE2E9A609C65420A9DDF37A9E56A25A8
19;B;AE2E9A609C65420A9DDF37A9E56A25A8
20;A;AE2E9A609C65420A9DDF37A9E56A25A8
21;B;AE2E9A609C65420A9DDF37A9E56A25A8
22;A;AE2E9A609C65420A9DDF37A9E56A25A8
23;A;AE2E9A609C65420A9DDF37A9E56A25A8
24;A;AE2E9A609C65420A9DDF37A9E56A25A8
25;A;AE2E9A609C65420A9DDF37A9E56A25A8
26;A;AE2E9A609C65420A9DDF37A9E56A25A8
27;A;AE2E9A609C65420A9DDF37A9E56A25A8
28;B;AE2E9A609C65420A9DDF37A9E56A25A8
29;A;AE2E9A609C65420A9DDF37A9E56A25A8
30;A;AE2E9A609C65420A9DDF37A9E56A25A8
31;A;AE2E9A609C65420A9DDF37A9E56A25A8
32;A;AE2E9A609C65420A9DDF37A9E56A25A8
33;A;AE2E9A609C65420A9DDF37A9E56A25A8


response table:

responseid;datesubmitted
296532B5A40C493592C9E6B480E15E37;2008-10-13 18:27:28-04
AE2E9A609C65420A9DDF37A9E56A25A8;2008-10-14 14:01:59-04
24165287C9D94F9CA9F6C6BBDEB4622B;2008-10-13 14:52:40-04



* Scott

[mapserver-users] symbolize a wms map based upon a sql count() query

2008-10-29 Thread Scott Pezanowski
Hi,

I am hoping to be able to symbolize a WMS or image map, based upon the results 
of a SQL COUNT() query. To be more specific, this query needs to be dynamic 
based upon user input from my application for specific attributes in the data, 
count up the number of records that meet that query, and then produce a 
choropleth map of the resulting counts. So the query would produce, a count of 
10 records for one county, 5 records for another county, etc. and my counties 
will be colored based upon a scheme for these counts. My data is in a PostGIS 
database.

Is there a way to do this with Mapserver? I am currently simply returning all 
of the records that meet my criteria and counting things up on the client 
application. But I am hoping there is a way to do this on the server or 
database-side of things.

Thank you very much in advance for any help or tips you may be able to offer. 
Also, please let me know if you need more info on what I am trying to do.

Thanks,
Scott




* Scott Pezanowski 


email: [EMAIL PROTECTED]  
*
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Mapserver equivalent for .NET

2008-03-05 Thread Scott Ellington
Hi,

I currently work at ISC and was asked to respond on this thread.

A few notes on some comments:

That being said, I can still wish that they be more open and give
credit 
to MapServer for providing the core of their system, or perhaps spend 
some time on this list helping users, or do something/anhything for the 
project... for me it's a wish, not a requirement. --Daniel Morissette

Howard Butler brought up a lot of these issues a while back.  In terms of 
openness, I can honestly tell you that there is no intent to hide the fact
that mapserver does the map rendering in MDNS.  I am not a sales guy, but
I have been told that there are some local governments that don't want to
hear that you are using open source, so it's just not something that is pushed.

There have been some contributions however.  Howard would be the person to list 
all these out.  But I know that someone here wrote the MS SQL Server 2008 
plugin.

this definitely sounds interesting.
Are they using the mapscript api or are they going via CGI?
How are exactly using mapserver? (I wish i could see this by myself, but
looks at their site that there is not a downloadable demo of it)  --Paolo Corti

MDNS uses mapscript/C# to render maps.  It has a Common .NET API that if you 
notice 
has many mapserver-isms.  All of the querying/editing is done within MDNS 
however.  Also, you 
should be able to download a demo if you log in.

and the mapfile docs themselves are awfully familiar.  --Daniel Morissette

The mapfile reference page is directly copied from the mapserver site.  
I included the license at the bottom that I found on the website.
Let me know if I am missing something.

The MapFile format used in MDNS adheres to the MapServer map file 
specification.  I didn't know that our good ol' mapfile was such a universal 
reference !
But, althought funny, this sentence tries to make people believe 
MapDotNet only use the mapfile format, and not mapserver itself, which 
can be considered unfaithfull if it effectively uses the mapserver 
engine behind.  --Guillaume Sueur

I wrote that.  I didn't mean to imply anything, but MDNS does use the mapFile 
outside of map
rendering.  However, I changed it to: 

MapDotNet Server currently uses MapServer 5.0 to render maps, and relies on 
its mapFile format.

http://www.mapdotnet.com/wiki/Wiki%20Pages/MapFile%20Complete%20Reference.aspx

Scott

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