Julien Cigar | 5 Feb 14:41 2015
Picon
Picon

copyright, logos, etc

Hello,

I'm using Mapserver to generate maps for various PostGIS layers and it
works pretty well, especially with SLD to filter WMS requests.

Now the users want to include:
- a logo (PNG file) in the upper right corner
- a copyright text at the bottom center of the page
- a text "generated at ..." with the date

For now I have the following MAP file:
https://gist.github.com/silenius/545d479132981dc5a55a (only relevant
parts are shown)

For the logo and the copyright text it works more or less (although it
seems "über complicated" for such simple thing, but maybe there is a
simpler way of doing it ?), the only problem I have is that if I change
the WIDTH and HEIGHT of the map the things disappear, as the POINTS in
the FEATURE section don't fit the map size. I wonder if there is a
simple way to tell Mapserver to "just put that 20px .PNG file in the
upper right corner of the generated map" or something like that .. ?

Any idea how could I do for the generated date ?

Thanks !

Julien

--

-- 
Julien Cigar
(Continue reading)

zach cruise | 4 Feb 18:34 2015
Picon

how to create vectiles from geojson?

looks like we need vectiles but i am not sure if i create them in
postgis or geoserver/mapserver.

does anyone know?

we have a large static geojson file that needs to be chunked up into
vectiles for different zooms and bounds. but before i apply regex on
it, is there already a solution out there?

http://tilestache.org/
_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

geo.graefin | 30 Jan 19:10 2015
Picon

Re: change htdocs directory

Unfortunately, it still does not work.
"http://localhost" displays the ms4w start page, but "http://localhost/geomoose2/geomoose.html" is empty (error 404).
 
Can you help me again? Thank you in advance!
 
Gesendet: Freitag, 30. Januar 2015 um 18:11 Uhr
Von: "TC Haddad" <tchaddad <at> gmail.com>
An: geo.graefin <at> web.de
Betreff: Re: Re: [mapserver-users] change htdocs directory
Well, the URL you must use will have to contain the name of the alias that you put in http.d
 
so if your alias is called "geomoose" then your URL would be
 
http://localhost/geomoose/
 
Here is the example http.d file that comes with Geomoose for MS4W web mercator demo (http://www.geomoose.org/downloads/GeoMOOSE-2.7.1-MS4W.zip)
 
-------------- fwd ----------------------- >>

Alias /geomoose2/ "/ms4w/apps/geomoose2/htdocs/"

<Directory "/ms4w/apps/geomoose2/htdocs/">
  AllowOverride None
  Options Indexes FollowSymLinks Multiviews
  Order allow,deny
  Allow from all
</Directory>

------------------------------------------------
 
In this example the alias is called geomoose2, so the URL will be

http://localhost/geomoose2/
 
Normally all you have to do with the package above is unzip the contents into the MS4W directory and restart Apache. The package assumes that you did not mess with the other parts of MS4W...
 
Tanya
 
 
On Fri, Jan 30, 2015 at 9:04 AM, <geo.graefin <at> web.de> wrote:
Hi Tanya, thank you for your answer!
 
I created the file with content as decribed in the instruction of README_HTTPD.txt and restarted the Apache, but still I can not go to the changed htdocs directory.
 
Anything else what I have to do?
 
 
Gesendet: Freitag, 30. Januar 2015 um 17:54 Uhr
Von: "TC Haddad" <tchaddad <at> gmail.com>
An: geo.graefin <at> web.de
Betreff: Re: [mapserver-users] change htdocs directory
Hi Geograefin

you have to put a file in
 
ms4w/httpd.d/
 
with your geomoose home location . leace the regular Apache http.conf file alone.
 
look at the other httpd example files in ms4w for example of the syntax.
 
Tanya
 
On Fri, Jan 30, 2015 at 2:54 AM, <geo.graefin <at> web.de> wrote:
Hello,
 
I installed the package MS4W 3.0.6. Now I will change the directory from "ms4w/Apache/htdocs" to "ms4w/apps/geomoose/htdocs". Where I have to change the directory settings? A change in the httpd.conf file (ms4w/Apache/conf) did not lead to success.
 
I would be very grateful if you help me!
 
Thank you!
 
Geograefin

_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
geo.graefin | 30 Jan 18:04 2015
Picon

Re: change htdocs directory

Hi Tanya, thank you for your answer!
 
I created the file with content as decribed in the instruction of README_HTTPD.txt and restarted the Apache, but still I can not go to the changed htdocs directory.
 
Anything else what I have to do?
 
 
Gesendet: Freitag, 30. Januar 2015 um 17:54 Uhr
Von: "TC Haddad" <tchaddad <at> gmail.com>
An: geo.graefin <at> web.de
Betreff: Re: [mapserver-users] change htdocs directory
Hi Geograefin

you have to put a file in
 
ms4w/httpd.d/
 
with your geomoose home location . leace the regular Apache http.conf file alone.
 
look at the other httpd example files in ms4w for example of the syntax.
 
Tanya
 
On Fri, Jan 30, 2015 at 2:54 AM, <geo.graefin <at> web.de> wrote:
Hello,
 
I installed the package MS4W 3.0.6. Now I will change the directory from "ms4w/Apache/htdocs" to "ms4w/apps/geomoose/htdocs". Where I have to change the directory settings? A change in the httpd.conf file (ms4w/Apache/conf) did not lead to success.
 
I would be very grateful if you help me!
 
Thank you!
 
Geograefin

_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
geo.graefin | 30 Jan 11:54 2015
Picon

change htdocs directory

Hello,
 
I installed the package MS4W 3.0.6. Now I will change the directory from "ms4w/Apache/htdocs" to "ms4w/apps/geomoose/htdocs". Where I have to change the directory settings? A change in the httpd.conf file (ms4w/Apache/conf) did not lead to success.
 
I would be very grateful if you help me!
 
Thank you!
 
Geograefin
_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Steve.Toutant | 26 Jan 15:54 2015
Picon

Mapserver doesn't send good filter to postgis

Sorry my first post was with an inapprpriate title......

I'm using mapserver 6.4.1 and postgis 2.1

using OpenLayers 2.13.1 I draw a small polygon that I use for a within spatial filter of a WFS getfeature request. The problem is that mapserver is not sending this polygon to postgis, it is sending the extent of the mapfile as filter...

The wfs POST Request (created and send by OpenLayers client)
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:Within><ogc:PropertyName>msGeometry</ogc:PropertyName><gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="urn:ogc:def:crs:EPSG::3857"><gml:exterior><gml:LinearRing><gml:posList>-8081644.2511244 5835062.56996 -8081707.5505384 5834980.1612889 -8081638.2794815 5834913.2788892 -8081533.1785677 5834988.5215889 -8081644.2511244 5835062.56996</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogc:Within></ogc:Filter>

In Mapserver log, I see
FLTLayerApplyPlainFilterToLayer():  ([shape]  within  fromText('POLYGON ((-8081644.2511243997141719 5835062.5699599999934435, -8081707.5505384001880884 5834980.1612889003008604, -8081638.2794815003871918 5834913.2788891997188330, -8081533.1785677000880241 5834988.5215889001265168, -8081644.2511243997141719 5835062.5699599999934435))'))

Then a few lines later, I see that it is not sending the polygon received as filter
select .......  where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857);

See the polygon definition is different, postgis receive the extent defined in the mapfile
EXTENT -9239517 5465442 -5565974 9349764


And, in postgis log I see this query, See the
select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857);


Why Mapserver is not sending the polygon received as filter to postgis?


Thanks!

Steve Toutant, M. Sc.
Analyste en géomatique
Secteur environnement
Direction de la santé environnementale et de la toxicologie
Institut national de santé publique du Québec
Tél.: 418 646-6777 poste 30015
Téléc.: 418 644-4593
steve.toutant <at> inspq.qc.ca
http://www.inspq.qc.ca
http://www.monclimatmasante.qc.ca

Pour me rejoindre par courrier
Service de l'infrastructure et du réseau
Direction des technologies de l'information
Ministère de la Sécurité Publique
2525 boul. Laurier, 2e étage
Tour Laurentides
Québec, G1V 2L2

_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Steve.Toutant | 26 Jan 15:31 2015
Picon

Does WFS filter use spatial index?

I'm using mapserver 6.4.1 and postgis 2.1

using OpenLayers 2.13.1 I draw a small polygon that I use for a within spatial filter of a WFS getfeature request. The problem is that mapserver is not sending this polygon to postgis, it is sending the extent of the mapfile as filter...

The wfs POST Request (created and send by OpenLayers client)
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:Within><ogc:PropertyName>msGeometry</ogc:PropertyName><gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="urn:ogc:def:crs:EPSG::3857"><gml:exterior><gml:LinearRing><gml:posList>-8081644.2511244 5835062.56996 -8081707.5505384 5834980.1612889 -8081638.2794815 5834913.2788892 -8081533.1785677 5834988.5215889 -8081644.2511244 5835062.56996</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogc:Within></ogc:Filter>

In Mapserver log, I see
FLTLayerApplyPlainFilterToLayer():  ([shape]  within  fromText('POLYGON ((-8081644.2511243997141719 5835062.5699599999934435, -8081707.5505384001880884 5834980.1612889003008604, -8081638.2794815003871918 5834913.2788891997188330, -8081533.1785677000880241 5834988.5215889001265168, -8081644.2511243997141719 5835062.5699599999934435))'))

But, in postgis log I see this query, See the
select * from msp.aq_v2_3857 where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857);

See the polygon definition is different, postgis receive the extent defined in the mapfile
EXTENT -9239517 5465442 -5565974 9349764

Why Mapserver is sending this polygon to postgis?


Thanks!

_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Scout | 23 Jan 20:46 2015

reverse the order of shapes of a layer

Hello,

I am using phpmapscript with mapserver 6.4.1.

I would like to be able to reverse the order of the shapes in a layer 
before drawing the map.

I want to draw the map both ways, actually.  I need it drawn 
right-side-up and up-side-down.  It is simple to reverse the order of 
the layers of the map, just (in phpmapscript):

##################
    // make arrays to hold the current and reversed orders
    $layerOrder = array ();
    $layerOrder = $map->getlayersdrawingorder();
    $reversed = array_reverse($layerOrder);

    // reverse the order for upside-down
    $r = $map->setlayersdrawingorder($reversed);

    // reset the order for upside-up
    $r = $map->setlayersdrawingorder($layerOrder);
##################

Is there something equivalent for the shapes within a layer?  Maybe a 
layer PROCESSING directive SQL call like: "select * from layer order by 
fid desc"?  Or define the layer with OGR CONNECTIONTYPE and CONNECTION 
back to itself and a SQL call like above??  Maybe I need to build a new 
layer adding the shapes in reversed order?

Thanks!
_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

geographika | 23 Jan 17:24 2015
Picon

Display multiple classes using WMS

Hi list,

I'm trying to do something I thought would be quire simple, but seems may not be possible in MapServer.

I have a client JavaScript application that uses MapServer as a WMS/WFS backend. The UI has a checkbox that allows the user to see the data with or without labels.
With the deprecation of the ANNOTATION layer I started to update my MAPFILE LAYER definitions. Some of the DATA clauses are very complicated so I moved my LABEL class into the same layer as the line features which are also colour coded.

I can switch between by LABEL class and the other classes using CLASSGROUP and the WMS STYLES parameter.

E.g. in the MapFile:

    CLASSGROUP "default"

    CLASS
        NAME 'Complete'
        GROUP "default"
        ...
    END

    CLASS
        NAME 'Incomplete'
        GROUP "default"
        ...
    END

   # a single class containing labels for all features
    CLASS
        GROUP "labels" # hidden by default, but can be activated with STYLE
    ...
    END


I can then use the STYLES property of the WMS server to hide/show labels by requesting the same layer twice with two different styles e.g.

No labels: http://localhost/mapserver/?LAYERS=Mylayer......STYLES=
Labels: http://localhost/mapserver/?LAYERS=Mylayer,MyLayer......STYLES=default,labels

This works well, but has a major drawback that the database is queried twice for the same data, which in my case causes a performance issue. Is there anyway to do this in a single-pass query?
It seems MapServer will only ever apply one class per feature. I could add a LABEL class to each default CLASS using includes, however I see no way of then turning these off, except maybe using MapScript?
Any workarounds / pointers helpful.

Regards,

Seth

--
web: http://geographika.co.uk
twitter: <at> geographika


_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Michel.Dastous | 22 Jan 21:03 2015

Union layers and WFS requests

Hi All,

 

We are actually testing the capabilities of the UNION layers especially in a WFS server context.  We were able to perform WFS GetFeature request against a union layer, however as soon as we add a  filtering criteria to our request It starts returns empty response.  Performing the same request on the underlying request works perfectly.

 

Here is the details about our map file definition and also sample WFS requests made.

 

LAYER

  NAME 'unioned'

  TYPE POLYGON

  STATUS DEFAULT

  CONNECTIONTYPE UNION

  CONNECTION "layer1,layer2"

  PROCESSING "ITEMS=PKEY,PROJ_NAME"

   EXTENT 815927.781772741 639558.864791513 1248160.81380272 917014.748839214

   METADATA

     "gml_featureid"        "PKEY"

     "ows_enable_request"        "*"

     "ows_extent"        "815927.781772741 639558.864791513 1248160.81380272 917014.748839214"

     "ows_srs"        "EPSG:2234"

     "ows_title"        "unioned"

     "gml_include_items"        "all"

     "gml_types"        "auto"

    END # METADATA

STYLEITEM "AUTO"

  # Define an empty class that will be filled at runtime from the color and

  # styles read from each source layer.

  CLASS

  END

END

 

  LAYER

    CONNECTION "layer1.shp"

    CONNECTIONTYPE OGR

    EXTENT 815927.781772741 639558.864791513 1248160.81380272 917014.748839214

    METADATA

      "gml_featureid"        "PKEY"

      "ows_enable_request"        "*"

      "ows_extent"        "815927.781772741 639558.864791513 1248160.81380272 917014.748839214"

      "ows_srs"        "EPSG:2234"

      "ows_title"        "layer1"

      "gml_include_items"        "all"

      "gml_types"        "auto"

    END # METADATA

    NAME "layer1"

    PROJECTION

      "init=epsg:2234"

    END # PROJECTION

    STATUS ON

    TILEITEM "location"

    TYPE POLYGON

    UNITS METERS

    CLASS

      NAME "01 STIP"

      EXPRESSION ('[PROJ_CURRE]' eq '01_STIP')

      STYLE

        COLOR "#ffc80066"

        OPACITY 40

        OUTLINECOLOR "#ffc80066"

        WIDTH 3

      END # STYLE

    END # CLASS

  END # LAYER

 

  LAYER

    CONNECTION "layer2.shp"

    CONNECTIONTYPE OGR

    EXTENT 815927.781772741 639558.864791513 1248160.81380272 917014.748839214

    METADATA

      "gml_featureid"        "PKEY"

      "ows_enable_request"        "*"

      "ows_extent"        "815927.781772741 639558.864791513 1248160.81380272 917014.748839214"

      "ows_srs"        "EPSG:2234"

      "ows_title"        "layer2"

      "gml_include_items"        "all"

      "gml_types"        "auto"

    END # METADATA

    NAME "layer2"

    PROJECTION

      "init=epsg:2234"

    END # PROJECTION

    STATUS ON

    TILEITEM "location"

    TYPE POLYGON

    UNITS METERS

    CLASS

      NAME "01 STIP"

      EXPRESSION ('[PROJ_CURRE]' eq '01_STIP')

      STYLE

        COLOR "#ffc80066"

        OPACITY 40

        OUTLINECOLOR "#ffc80066"

        WIDTH 3

      END # STYLE

    END # CLASS

  END # LAYER

 

 

 

Request against Layer1, return correct data.

http://localhost/ms/Mapserv.exe?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&FILTER=<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo><ogc:PropertyName>PROJ_NAME</ogc:PropertyName><ogc:Literal>0172-0417</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>&RESULTTYPE=results&TYPENAME=layer1&PROPERTYNAME=(PROJ_NAME)&MAP=Internal/mastermap.map

Layer2 works, return correct data.:

http://localhost/ms/Mapserv.exe?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&FILTER=<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo><ogc:PropertyName>PROJ_NAME</ogc:PropertyName><ogc:Literal>0172-0417</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>&RESULTTYPE=results&TYPENAME=layer2&PROPERTYNAME=(PROJ_NAME)&MAP=Internal/mastermap.map

Unioned with filter returns empty answer:

http://localhost/ms/Mapserv.exe?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&FILTER=<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo><ogc:PropertyName>PROJ_NAME</ogc:PropertyName><ogc:Literal>0172-0417</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>&RESULTTYPE=results&TYPENAME=unioned&PROPERTYNAME=(PROJ_NAME)&MAP=Internal/mastermap.map

 

Unioned without filter returns correct data.:

http://localhost/MapRenderingEngine/Mapserv.exe?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&RESULTTYPE=results&TYPENAME=unioned&PROPERTYNAME=(PROJ_NAME)&MAP=Internal/mastermap.map

 

So is this a known limitation or maybe a bug?  Does anyone have any suggestion to work around this?

 

 

Thanks!

_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Fergus McDonald | 22 Jan 15:16 2015
Picon

Re: Set LABELANGLE [attribute] via Mapscript (6.41)

angle is mentioned as an attribute here, with a "TODO"

http://mapserver.org/mapscript/mapscript.html#labelobj

It doesn't specially say there is a setAngle() method, but you can see
is exists in the generated code.

On Thu, 22 Jan 2015 12:56:00 +0100
Håvard Tveite <havard.tveite <at> nmbu.no> wrote:

> Hi,
> 
> I am not able to find anything about labelObj.setAngle() in
> the current Mapserver docs.  Could you point me in the right
> direction?
> 
> Håvard
> 
> On 2015-01-18 16:27, Fergus McDonald wrote:
> > Thanks Steve.. that was it. I was able to set it using (in Java):
> >
> > setBinding(MS_LABEL_BINDING_ENUM.MS_LABEL_BINDING_ANGLE.swigValue(),
> >   strAngleAttribute);
> >
> > It would be good maybe if there was a hint about this in the docs
> > for labelObj.setAngle()
> >
> >
> > On Fri, 16 Jan 2015 22:06:54 +0000
> > "Lime, Steve D (MNIT)" <Steve.Lime <at> state.mn.us> wrote:
> >
> >> I believe it's done with the setBinding method. Labels and styles
> >> have that method.
> >>
> >> Steve
> >>
> >> -----Original Message-----
> >> From: mapserver-users-bounces <at> lists.osgeo.org
> >> [mailto:mapserver-users-bounces <at> lists.osgeo.org] On Behalf Of
> >> Fergus McDonald Sent: Friday, January 16, 2015 8:54 AM To:
> >> mapserver-users <at> lists.osgeo.org Subject: [mapserver-users] Set
> >> LABELANGLE [attribute] via Mapscript (6.41)
> >>
> >> I might be missing something in the docs, but how does one set the
> >> labelangle for a mapscript labelObj to an attribute name, the
> >> equivalent of ANGLE [attribute] in the LABEL declaration of the MAP
> >> file?
> >>
> >> The angle property of labelObj can only be a float value.
> >>
> >> The layer object has a labelangleitem property mentioned in the
> >> main docs, but the "PHP Mapscript Migration Guide" says that this
> >> property was removed as of version 6.
> >> _______________________________________________ mapserver-users
> >> mailing list mapserver-users <at> lists.osgeo.org
> >> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users <at> lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> 

_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Gmane