queryByLayer - is it a valid method on layerObj?

All,

 

The Mapscript SWIG interface on the layerObj defines a queryByFilter method as

  public int queryByFilter(mapObj map, string arg1)

where arg1 is supposedly the filter to apply when querying the layer, analogous to

    public int queryByRect(mapObj map, rectObj rect)

 

Where is this method documented? It is not described in either the 6.4 or 7.0 documentation. Based upon the history of the code that I’m attempting to bring back to life the method was probably documented in MapServer 4.x or 5.x. Note that is still visible through SWIG.

 

How should it be used? I tried it with a WFS OGC filter and the log file showed (ignore line wrapping here):

 

  [Mon Mar 09 12:18:35 2015].727000 yyparse(): Expression parser error. syntax error

  [Mon Mar 09 12:18:35 2015].727000 msEvalExpression: Expression parser error.

     Failed to parse expression:

     <Filter><Intersect><PropertyName>Geometry</PropertyName><gml:Polygon>

       <gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>

         -88.0865046533,37.5555143852 -88.0860204771,37.5600435404

         -88.0782858287,37.5595392364 -88.0787704736,37.5550101113

         -88.0865046533,37.5555143852

       </gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>

     </gml:Polygon></Intersect></Filter>

 

I tried with a much simpler mapfile filter and got much the same result:

 

  [Mon Mar 09 12:53:22 2015].470000 yyparse(): Expression parser error. syntax error

  [Mon Mar 09 12:53:22 2015].470000 msEvalExpression: Expression parser error.

    Failed to parse expression: ([mukey] in (713970, 713898))

 

Do any of you have a working example of its use?

 

Is there a way to use the OGC filter directly within mapscript code? That is ultimately what I’m after.

 

Thanks.

 

- Phil Anzel

  USDA/NRCS contractor – Team Vistronix

 

This electronic message contains information generated by the USDA solely for the intended recipients.  Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties.  If you believe you have received this message in error, please notify the sender and delete the email immediately.

 

_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Gertjan van Oosten | 9 Mar 12:45 2015
Picon

Errors with LAYER DATA "geom FROM (...huge SELECT...)"

Hi all,

We have some layers in Oracle where the map config specifies:

  LAYER
    ...
    DATA "geom FROM (
	SELECT a_very_long_select_statement_with_lots_of_%PARAMS%
	FROM some_table
      )
      USING FILTER"
    ...
  END

After a certain length of the SELECT, we get strange errors: an
imcomplete SQL statement is being sent to Oracle.

Turns out that this is due to the define in maporaclespatial.c:

  #define TABLE_NAME_SIZE            2000

Since I found no other alternatives, I was only able to fix it by
changing this define and recompiling Mapserver. This particular
assumption (that "2000 characters ought to be enough for anybody") is
still present in the Mapserver 7 source code. Additionally, the buffer
to hold the query string is hard-coded as:

  char query_str[6000];

Shouldn't this be fixed (or made configurable), or at least, clearly
documented somewhere? The current situation is, frankly, sub-optimal...

Kind regards,
--

-- 
-- Gertjan van Oosten, Principal Consultant, West Consulting B.V.
-- gertjan <at> West.NL     +31 15 2191 600       www.west.nl
_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

alok mathur | 9 Mar 12:40 2015
Picon

Reading KML

Hi,

I have a kml file in which there is a folder containing both Line and Point geometry placemarks. I want to show both line and point geomerty on map using mapserver. but the issue is that the data source is same. so how can i show the point and line data on map.
Please help me.



--

Alok Mathur | Software Engineer 2A | Ciena
Mobile +91 9899413266

_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Rahkonen Jukka (MML | 6 Mar 16:30 2015
Picon

Speed of getting layer extents does matter

Hi,

 

I tried to repeat the issue with slow GetCapabilities and my hypothesis was that the reason was in the new nested layer groups which I had added lately. However, now it seems that the real issue was in the way I had added new Spatialite layers. That I were using those layers in groups was not important in my case.

 

I separated 7 layers from a production service for the speed tests. Three of the data tables have less than 10000 rows, three between 10000and 60000, and one 205000 rows so they are not big tables at all. Initially the time to read GetCapabilities with curl was 4.1 seconds. By rewriting the DATA lines as described below the time went down to 0.45 seconds.


I had followed the examples from http://www.mapserver.org/input/vector/ogr.html without thinking too much about what I was doing:

 

CONNECTIONTYPE OGR

CONNECTION “db.sqlite"

DATA "select * from my_table"

 

With this definition the layer extents are computed by aggregating the extents of all the geometries of the table. However, GetCapabilities is much faster if I define the layer as  

 

CONNECTIONTYPE OGR

CONNECTION “db.sqlite"

DATA "my_table"

 

I have up-to-date statistics in my Spatialite DB and the boost in speed must mean that OGR is clever enough for making a query to the layer_statistics table for getting the layer extents.

 

Now afterwards this feels trivial but I would suggest to improve the documentation in  http://www.mapserver.org/input/vector/ogr.html and http://mapserver.org/mapfile/layer.html Currently the latter document is putting rather low value on the importance of extents.

 

EXTENT [minx] [miny] [maxx] [maxy]

The spatial extent of the data. In most cases you will not need to specify this, but it can be used to avoid the speed cost of having MapServer compute the extents of the data.

 

I am not sure what could be the best place to add some documentation about this speed cost which can easily mean that GetCapabilities gets half a second slower than necessary per ill behaving layer in the mapfile. I sketched this text

 

Performance considerations

Layer extents and slow WMS GetCapabilities

 

Computing the extents of an OGR layer can be expensive if the layer is large and extents can’t be read directly from metadata. This is the case if:

-          Data source does not support fast method for accessing the extents (CSV, GML)

-          The source store does not have layer statistics available or they are not up-to-date and therefore disabled (Spatialite, PostGIS)

-          Layer data in the mapfile is defined as SQL SELECT

 

For example, if Spatialite database has a valid entry in the layer_statistics table GDAL/OGR is able to read the extents directly from the metadata when the layer is defined as

 

CONNECTIONTYPE OGR

CONNECTION “db.sqlite"

DATA "my_table"

 

However, if layer is defined as SQL SELECT the extents are computed by running a query that aggregates the extents of selected geometries

CONNECTIONTYPE OGR

CONNECTION “db.sqlite"

DATA "select * from my_table"

 

If computing the layer extents on-the-fly feels too slow consider to use the EXTENT keyword in LAYER http://mapserver.org/mapfile/layer.html.

 

For comparison, with Geoserver the layer extents are stored to configuration files when layers are added to server for the first time which means the same as having LAYER-EXTENT always set for all the layers in mapfiles.

 

-Jukka Rahkonen-

_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Elia Quirós Rosado | 26 Jan 21:05 2015
Picon

Fwd: Unable to load example 1.9 of mapserver tutorial

Hi,

I have a big problem with the exercise 1.9 of  mapserver tutorial.

When I click in the dynamic window a new png file is generated in my local tmp/ms_tmp/ path but it is not loaded at the browser.

I have been one week trying to change, directories, paths, browser configurations... but nothing works.

Could anyone be so kind and tell me how can I solve the problem?

I have attached a screenshot of what is happening.

Thank you for your help

best regards



------------------------------------------------------------------------------------------------------------------------------------------------
Elia Quirós Rosado
Escuela Politécnica
Universidad de Extremadura
Teléfono: 927257195  ext. 51525
Grupo de Investigación Kraken: http://www.unex.es/investigacion/grupos/kraken/estructura/personal
ResearcherID: C-3301-2013
------------------------------------------------------------------------------------------------------------------------------------------------

_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
rishi | 5 Mar 10:58 2015
Picon

transparency for colored polygons

hi all

i want to set transparency for colored polygons iam displaying a polygon layer on the google image and i want to set transparency so that background image has to visible in the colored polygons

i have attached my map also

my mapfile is

MAP EXTENT 8240841.450745 2400319.900386 9218007.463612 3107183.406947

IMAGETYPE png 

size 150 500

 TRANSPARENT on 

LEGEND 

STATUS EMBED 

POSITION LR 

TRANSPARENT TRUE 

END

web metadata wms_srs "EPSG:4326 EPSG:900913" end end

LAYER CONNECTIONTYPE postgis
CONNECTION "user=postgres password=****** dbname=mpdb host=localhost port=5432" DATA "geom FROM view_villagevidyut using unique village_code_c11"

STATUS Default TYPE polygon

labelitem "villname"

CLASSITEM "process" CLASS NAME "completed" EXPRESSION "completed" STYLE COLOR 0 255 0 outlinecolor 121 188 255 END

LABEL 

SIZE 2 

color 121 188 255 

END 

END 

CLASS NAME "uncompleted"

 EXPRESSION "uncompleted" 

STYLE

 COLOR 135 206 235

 outlinecolor 121 188 255 

END 

END 

CLASS NAME "plan not covered" 

EXPRESSION ""

STYLE COLOR 240 128 128 outlinecolor 121 188 255 END LABEL SIZE 2 color 121 188 255 END END PROJECTION "init=epsg:900913" END end END
_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
rishi | 5 Mar 10:49 2015
Picon

transparecy for colored polygons

hi all

i want to set transparency for colored polygons iam displaying a polygon layer on the google image and i want to set transparency so that background image has to visible in the colored polygons

i have attached my map also

my mapfile is

MAP EXTENT 8240841.450745 2400319.900386 9218007.463612 3107183.406947

IMAGETYPE png 

size 150 500

 TRANSPARENT on 

LEGEND 

STATUS EMBED 

POSITION LR 

TRANSPARENT TRUE 

END

web metadata wms_srs "EPSG:4326 EPSG:900913" end end

LAYER CONNECTIONTYPE postgis
CONNECTION "user=postgres password=****** dbname=mpdb host=localhost port=5432" DATA "geom FROM view_villagevidyut using unique village_code_c11"

STATUS Default TYPE polygon

labelitem "villname"

CLASSITEM "process" CLASS NAME "completed" EXPRESSION "completed" STYLE COLOR 0 255 0 outlinecolor 121 188 255 END

LABEL 

SIZE 2 

color 121 188 255 

END 

END 

CLASS NAME "uncompleted"

 EXPRESSION "uncompleted" 

STYLE

 COLOR 135 206 235

 outlinecolor 121 188 255 

END 

END 

CLASS NAME "plan not covered" 

EXPRESSION ""

STYLE COLOR 240 128 128 outlinecolor 121 188 255 END LABEL SIZE 2 color 121 188 255 END END PROJECTION "init=epsg:900913" END end END


On Thu, Mar 5, 2015 at 2:52 PM, Eichner, Andreas - SID <Andreas.Eichner <at> sid.sachsen.de> wrote:
> In Section 9.2.4 of the MapServer v6.0 Manual, under "OGC Support and
> Configuration / WMS Server / WMS 1.3.0 Support / Some Missing features" it
> lists "WMS 1.3.0 Post request should be an XML document containing the
> different operations and parameters."  (Also appears in the current
> version
> documentation v7 beta, although page hasn't been updated since 2013.)
>
> - is this suggesting that POST is not supported?
>

Nope. Sending the KVP request with mimetype "application/x-www-form-urlencoded" via POST is fully supported. Simple example:

# wget -d -O- --post-data="service=WMS&request=GetCapabilities" http://host/cgi-bin/mapserv?map=/path/to/mapfile.map
_______________________________________________
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
rishi | 5 Mar 07:37 2015
Picon

mapserver mapfile for transparancy

hi all

i want to set transparency for colored polygons iam displaying a polygon layer on the google image and i want to set transparency so that background image has to visible in the colored polygons

i have attached my map also

my mapfile is

MAP EXTENT 8240841.450745 2400319.900386 9218007.463612 3107183.406947

IMAGETYPE png 

size 150 500

 TRANSPARENT on 

LEGEND 

STATUS EMBED 

POSITION LR 

TRANSPARENT TRUE 

END

web metadata wms_srs "EPSG:4326 EPSG:900913" end end

LAYER CONNECTIONTYPE postgis
CONNECTION "user=postgres password=****** dbname=mpdb host=localhost port=5432" DATA "geom FROM view_villagevidyut using unique village_code_c11"

STATUS Default TYPE polygon

labelitem "villname"

CLASSITEM "process" CLASS NAME "completed" EXPRESSION "completed" STYLE COLOR 0 255 0 outlinecolor 121 188 255 END

LABEL 

SIZE 2 

color 121 188 255 

END 

END 

CLASS NAME "uncompleted"

 EXPRESSION "uncompleted" 

STYLE

 COLOR 135 206 235

 outlinecolor 121 188 255 

END 

END 

CLASS NAME "plan not covered" 

EXPRESSION ""

STYLE COLOR 240 128 128 outlinecolor 121 188 255 END LABEL SIZE 2 color 121 188 255 END END PROJECTION "init=epsg:900913" END end END
_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
alok mathur | 2 Mar 18:05 2015
Picon

kml style

Hi,

I am new to mapserver and kml. I want to create a .map file and the datasource will be the kml file. How could i use the kml style tags or i have to provide my own style tag in .map file.

Please help me out to write the config file. PFA the sample kml file

--
Attachment (KML_Samples.kml): application/vnd.google-earth.kml+xml, 47 KiB
_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Guillaume Sueur | 9 Feb 17:22 2015
Picon

Symbolscaledenom

Hi List,

It looks like label OUTLINEWIDTH and OFFSET are dependant of SYMBOLSCALE
which leads to strange behaviours and looks on large scale range (see
image included -> huge halo and distance between point and its label).
Is there a way to detach these parameters from the SYMBOLSCALE settings ?

Thanks

Guillaume

_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Ben Madin | 5 Mar 06:53 2015
Picon

WMTS tiles not at correct Latitude (and moving)

G’day all,

we have set up a map cache wmts layer to produce boundaries for our mapping system.

In isolation, it was looking OK, however when we layer the boundaries with any known background (OSM etc)
they appear to be offset by a few degrees S (it is all in EPSG:3857)

To confuse things more, as we zoom in a couple of layers, this seems to be moving north (which is good), but not
enough to converge with our background or data layers - so still bad.

I’ve put an image to illustrate this at :

https://s3-ap-southeast-2.amazonaws.com/uploads.ausvet.com.au/Misaligned-WMTS.png

My guess is I have done something wrong at some level of configuration (postgis data, mapfile, wms config,
mapcache.xml or OpenLayers),  but it might be that it is common enough that most people can figure it out
(which is why I couldn’t find a good reason!)

Any advice would be gratefully accepted. I can put up further details as required (or if it isn’t as simple
as I thought)

cheers

Ben

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

Gmane