lars.schylberg | 27 May 16:16 2015
Picon

Named WMS styles - CLASSGROUP and GROUP

Hi,

I have tried to understand how to create named styles in a WMS configuration, for some time.
I would like to have one style that is color and one style for grey scale.

The manual says the You can do that:

http://mapserver.org/ogc/sld.html#named-styles-support
 
With the basic set up I get this error when I try and to specify: styles=grey or styles=color

msWMSLoadGetMapParams(): WMS server error. Invalid style (color). Mapserver is expecting an empty string for the STYLES : STYLES= or STYLES=,,, or using keyword default  STYLES=default,default, ..

I have also looked at:

http://mapserver.org/ogc/inspire.html#style-section-for-root-layer-and-possibly-existing-group-layers

but I haven't understood that clearly. I don't understand how You set up the different style options.

When I try to play with wms_style or wms_style_name in main WEB METADATA block
and web_style_group_name in layer METEDATA block I get this this error:

msWMSLoadGetMapParams(): WMS server error. Style (color) not defined on root layer. or
msWMSLoadGetMapParams(): WMS server error. Style (grey) not defined on root layer.

I have created one example mapfile that is easy to understand and that should isolate the problem.
I works fine with styles= set to nothing.

Test url used:

http://localhost/cgi-bin/mapserv?map=/_YOUR_PATH_/style_test.map
&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1
&LAYERS=circles,squares
&styles=grey
&srs=EPSG:4326
&BBOX=0,0,20,15
&FORMAT=application/openlayers
&WIDTH=200&HEIGHT=150

or

mapserv -nh "QUERY_STRING=map=/_YOUR_PATH_/style_test.map\
&SERVICE=WMS\
&REQUEST=Getmap\
&VERSION=1.1.1\
&LAYERS=ST\
&styles=grey\
&srs=EPSG:4326\
&BBOX=0,0,20,15\
&FORMAT=png\
&WIDTH=200&HEIGHT=150" > test.png

/Lars

testfile: style_test.map
----------------------------------
MAP
    NAME ST
    EXTENT 0 0 20 15
    SIZE 200 150
    UNITS DD
    IMAGECOLOR 200 200 200
    CONFIG "MS_ERRORFILE" "/tmp/style_test.log"
    DEBUG 5

    OUTPUTFORMAT
      NAME 'AGG'
      DRIVER AGG/PNG
      IMAGEMODE RGB
    END

    WEB
      IMAGEPATH "/tmp/ms_tmp/"
      IMAGEURL "/ms_tmp/"
      METADATA
        "wms_srs" "EPSG:3006 EPSG:4326"
        "ows_enable_request" "*"
      END
    END

    PROJECTION
      "init=epsg:4326"
    END

    SYMBOL
        NAME "circle"
        TYPE ELLIPSE
        FILLED TRUE
        POINTS 1 1 END
    END
    SYMBOL
        NAME "square"
        TYPE VECTOR
        FILLED TRUE
        POINTS 0 0 0 1 1 1 1 0 0 0 END
    END
#
# Start of layer definitions
#
    LAYER
        NAME "circle objects"
        TYPE POINT
        FEATURE POINTS 10 5 END END
        FEATURE POINTS 15 10 END END
            METADATA
                "wms_title" "Cirles"
                "wms_enable_request"   "*"
                "wms_layer_group" "/ST/circles"
            END
        STATUS on
        CLASSGROUP "color"
        CLASS
            NAME "circle-color"
            GROUP "color"
            STYLE
                COLOR 255 0 0
                SIZE 15
                WIDTH 1
                SYMBOL "circle"
            END
        END
        CLASS
            NAME "circle-grey"
            GROUP "grey"
            STYLE
                COLOR 50 50 50
                SIZE 15
                WIDTH 1
                SYMBOL "circle"
            END
        END
    END # Layer
    LAYER
        NAME "square objects"
        TYPE POINT
        FEATURE POINTS 10 10 END END
        FEATURE POINTS 15 5 END END
            METADATA
                "wms_title" "Squares"
                "wms_enable_request"   "*"
                "wms_layer_group" "/ST/squares"
            END
        STATUS on
        CLASSGROUP "color"
        CLASS
            NAME "square-color"
            GROUP "color"
            STYLE
                COLOR 0 0 255
                SIZE 15
                WIDTH 1
                SYMBOL "square"
            END
        END
        CLASS
            NAME "square-grey"
            GROUP "grey"
            STYLE
                COLOR 100 100 100
                SIZE 15
                WIDTH 1
                SYMBOL "square"
            END
        END
    END # Layer
END # Map File




_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Renzo Kottmann | 27 May 11:47 2015
Picon

getting corrupted png with WMS request to mapserv CGI on command line

Hi All,

I have installed mapserver 6.4.1 in a docker container based on debian
jessie (see dockerfile below)

If I run:

/usr/lib/cgi-bin/mapserv -nh
"QUERY_STRING=EXCEPTIONS=application/vnd.ogc.se_inimage&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&map=/genes-mapserver/wms_test.map&SRS=EPSG:4326&BBOX=-180,-90,180,90&FORMAT=image/png&WIDTH=1080&HEIGHT=614&STYLES=&LAYERS=satellite_mod"
> /tmp/test.png

The png is corrupt and I can not open it with neither gimp nor firefox.

However, I get valid pngs using the very same map file with shp2img or
mapserv -nh
"QUERY_STRING=map=/genes-mapserver/wms_test.map&mode=map&layers=satellite_mod
.

Find below more details (mapserver version, exact command lines I used and
resulting debug logs, map file, and docker file)

I searched google, the mailing list archives, but nothing seems to be
similar to this problem. Therefore, any help is very much appreciated :)

ciao,
renzo

* Mapserver Version:

MapServer version 6.4.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML
SUPPORTS=PROJ SUPPORTS=GD SUPPORTS=AGG SUPPORTS=FREETYPE
SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG SUPPORTS=ICONV
SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS
INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

* Command lines

Generates valid png:

/usr/lib/cgi-bin/mapserv -nh
"QUERY_STRING=map=/genes-mapserver/wms_test.map&mode=map&layers=satellite_mod"
> /tmp/test.png

shp2img --all_debug 2 -m /genes-mapserver/wms_test.map -o /tmp/test.png

Generates invalid corrupt png:

/usr/lib/cgi-bin/mapserv -nh
"QUERY_STRING=EXCEPTIONS=application/vnd.ogc.se_inimage&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&map=/genes-mapserver/wms_test.map&SRS=EPSG:4326&BBOX=-180,-90,180,90&FORMAT=image/png&WIDTH=1080&HEIGHT=614&STYLES=&LAYERS=satellite_mod"
> /tmp/test.png

* Log file (for all three runs in that order):

[Wed May 27 08:51:44 2015].475696 CGI Request 1 on process 79
[Wed May 27 08:51:44 2015].476881 msDrawMap(): rendering using outputformat
named png (AGG/PNG).
[Wed May 27 08:51:44 2015].476916 msDrawMap(): WMS/WFS set-up and query,
0.000s
[Wed May 27 08:51:44 2015].478222 msDrawRasterLayerLow(satellite_mod):
entering.
[Wed May 27 08:51:45 2015].16608 msDrawMap(): Layer 0 (satellite_mod),
0.540s
[Wed May 27 08:51:45 2015].16665 msDrawMap(): Drawing Label Cache, 0.000s
[Wed May 27 08:51:45 2015].16677 msDrawMap() total time: 0.541s
[Wed May 27 08:51:45 2015].38545 msSaveImage(stdout) total time: 0.022s
[Wed May 27 08:51:45 2015].38838 mapserv request processing time (msLoadMap
not incl.): 0.563s

[Wed May 27 08:56:29 2015].752703 msDrawMap(): rendering using outputformat
named png (AGG/PNG).
[Wed May 27 08:56:29 2015].752820 msDrawMap(): WMS/WFS set-up and query,
0.000s
[Wed May 27 08:56:29 2015].754465 msDrawRasterLayerLow(satellite_mod):
entering.
[Wed May 27 08:56:30 2015].295590 msDrawMap(): Layer 0 (satellite_mod),
0.543s
[Wed May 27 08:56:30 2015].295664 msDrawMap(): Drawing Label Cache, 0.000s
[Wed May 27 08:56:30 2015].295684 msDrawMap() total time: 0.544s
[Wed May 27 08:56:30 2015].323794 msSaveImage(/tmp/test.png) total time:
0.028s

[Wed May 27 08:59:28 2015].995397 CGI Request 1 on process 82
[Wed May 27 08:59:28 2015].995464 msWMSLoadGetMapParams(): enabling
non-square pixels.
[Wed May 27 08:59:28 2015].996733 msDrawMap(): kicking into non-square
pixel preserving mode.
[Wed May 27 08:59:28 2015].997595 msDrawMap(): rendering using outputformat
named png (AGG/PNG).
[Wed May 27 08:59:28 2015].997614 msDrawMap(): WMS/WFS set-up and query,
0.000s
[Wed May 27 08:59:28 2015].998950 msDrawRasterLayerLow(satellite_mod):
entering.
[Wed May 27 08:59:29 2015].651061 msDrawMap(): Layer 0 (satellite_mod),
0.653s
[Wed May 27 08:59:29 2015].651143 msDrawMap(): Drawing Label Cache, 0.000s
[Wed May 27 08:59:29 2015].651167 msDrawMap() total time: 0.656s
[Wed May 27 08:59:29 2015].681373 msSaveImage(stdout) total time: 0.030s
[Wed May 27 08:59:29 2015].681769 mapserv request processing time
(msLoadMap not incl.): 0.686s

* map file

MAP
NAME "wms_test"
STATUS ON
EXTENT -180 -90 180 90
IMAGECOLOR 210 210 210
IMAGETYPE png
SIZE 1080 614
UNITS dd

CONFIG "MS_ERRORFILE" "/tmp/wms_test_error.txt"
DEBUG 2

PROJECTION
#this is WGS84
"init=epsg:4326"
END

SYMBOLSET "etc/symbols.sym"
FONTSET "etc/fonts/fonts.txt"

WEB
IMAGEPATH /tmp/
IMAGEURL "/tmp/"

ERROR "/error.html"
EMPTY "/no_result.html"

METADATA
### Enable WFS support
"wms_title"           "wms test"
"wms_onlineresource"  "http://localhost/wms?"
"wms_srs"             "EPSG:4326"
"wms_enable_request"  "GetCapabilities GetMap GetFeatureInfo
GetLegendGraphic"
"ows_enable_request"  "GetCapabilities GetMap GetFeatureInfo
GetLegendGraphic"
"ows_extent" "-180 -90 180 90"
"wfs_title"           "wfs test"
#necessary for the WMS GetFeatureInfo request
"WMS_FEATURE_INFO_MIME_TYPE" "text/html"
END

END

LEGEND
STATUS on
KEYSIZE 10 10
LABEL
SIZE 9
COLOR 0 0 0
TYPE truetype
ENCODING UTF-8
FONT sans
FORCE false
PARTIALS true
POSITION AUTO
END
TEMPLATE "template/legend.html" # HTML template file
END

LAYER
NAME satellite_mod

METADATA
"wms_title"     "World Map Lite"
"unit"          "false"
END #end of wms metadata

DATA data/satelliteMod.png
TYPE RASTER
STATUS ON
END
#map end
END

* Dockerfile

FROM debian:jessie	

ENV GMS_DIR=/genes-mapserver
ENV LANG C.UTF-8

# Update and upgrade system
RUN apt-get -qq update --fix-missing && \
apt-get install -y cgi-mapserver mapserver-bin

RUN mkdir ${GMS_DIR}

VOLUME ${GMS_DIR}

ENTRYPOINT ["/usr/lib/cgi-bin/mapserv"]

The actual tests are done within the container by:

sudo docker run -v ~/src/genes-mapserver/:/genes-mapserver --rm
--entrypoint=/bin/bash -ti renzok/mapserver-cgi 

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

Picon

Setting up many vitual hosts

Hi,


I’m installing Mapserver for the first time. The demo works fine on RHEL but I would like to add my data in a new virtual host. Is it possible to set up many vitual hosts on Apache/Mapserver?

Merci!

Jacques Mérette

Architecte technologique

Division des infrastructures technologiques

Service des infrastructures technologiques appliquées aux opérations

Direction des technologies de l’information

Ministère des Transports du Québec 

Tél: 418-643-5350 # 24685

jacques.merette-c <at> mtq.gouv.qc.ca

 

Boîte commune : Architectes-Technologique._C-DTI <at> mtq.gouv.qc.ca

 

_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Samuel Lapointe | 26 May 22:03 2015
Picon

ScribeUI on Google Summer of Code 2015

Hi all,

ScribeUI has been accepted as a project for the 2015 edition of the Google Summer of Code. This means I will be working on it all summer long.

ScribeUI is a web utility to create and preview mapfiles using either the regular mapfile syntax or the Scribe syntax. Its main objective is making the work of mapfiles developers easier. 

You can try it without installing it by going on http://demo.scribeui.org. This page is reset every day to prevent it from going too messy. There is a guide available on the wiki to help you get started here: 


I have three big objectives for this summer:

1. Improve the error detection of ScribeUI. This means displaying the line numbers of the Scribe files and not the mapfiles when appropriate

2. Add an import/export workspace feature. The buttons are already there but the feature isn't implemented

3. Automatically create classes based on sets of data. This would allow users to make demographics maps very easily for example.

I will also post regular updates on the Scribe blog, here: 


I hope I will be able to make this project more active. If you have any troubles or questions, don't hesitate to ask.

Have a nice day!
Samuel Lapointe
_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Mark Volz | 22 May 21:57 2015
Picon
Picon

stretching imagery in MapServer

Hello,

 

I added our new Pictometry Air Photos on our mapping site at http://geomoose.lyonco.org/geomoose2/geomoose.html.  The air photos seem somewhat washed out.  In ArcGIS I was able to get a nicer looking image by stretching the air photo using standard deviations.  Can we stretch imagery in MapServer?  If not please let me know if you have a comment regarding how I can improve the image quality.

 

Thanks

Sincerely,

Mark Volz, GISP

 

 

_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Mac Moyor | 22 May 19:00 2015
Picon

projection error

Hi,


i'm building a mapserver/mapcache, imported osm data using imposm to database every thing seems Ok, so when i test the osm data on my browser i got the projection erros as follows :'

.."the Projection library error. proj says: latitude or longitude exceeded limits "..


Please any idea any idea how to troubleshoot this error.

thanks

Mac

_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
William Hudspeth | 21 May 22:00 2015
Picon

mapserver and netcdf subdatasets/bands

Hello all,

I am trying to provide wcs and wms services from specific bands within a 
netcdf file. The documentation appears to be sparse online, and was 
wondering whether anyone can point me to some good information about how 
to set up a layer in the mapfile that points to a specific band in a 
netcdf file....

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

Re: [EXTERNAL] Re: Mapserver 7+oracle - wfs getFeature with filter on numeric field

It looks like whats happening is that’s being converted into 3 Tokens and the oracle driver converts it into a number + comma + number. 

The tokenizer is not treating that value as a single value. 

Mike

From: "Steve.Toutant <at> inspq.qc.ca" <Steve.Toutant <at> inspq.qc.ca>
Date: Tuesday, May 19, 2015 at 11:44 AM
To: Michael Smith <michael.smith <at> erdc.dren.mil>
Cc: "Rahkonen Jukka (MML)" <jukka.rahkonen <at> maanmittauslaitos.fi>, MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>
Subject: Re: [mapserver-users] [EXTERNAL] Re: Mapserver 7+oracle - wfs getFeature with filter on numeric field

here is the mapserver log with <ogc:PropertyIsEqualTo matchCase="true"><ogc:PropertyName>LONG_STAT</ogc:PropertyName><ogc:Literal>-61,8031</ogc:Literal></ogc:PropertyIsEqualTo>

msOracleSpatialLayerWhichShapes. Using this Sql to retrieve the data: SELECT ID, NO_STAT_CLIM, NO_STAT_FADQ, NOM_STAT, LATI_STAT, LONG_STAT, ALTI_STAT, D_DEB, D_FIN, TIMB_MAJ, USAG_MAJ, rownum, GEOM_POIN FROM (select * FROM SMDVDP_STAT_METE WHERE EXTRACT(YEAR FROM D_DEB) = 2014) WHERE  ( LONG_STAT = -61.000000,8031.000000 )  AND SDO_FILTER( GEOM_POIN, MDSYS.SDO_GEOMETRY(2003, :srid, NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),:ordinates ),'querytype=window') = 'TRUE'


The problem is
WHERE  ( LONG_STAT = -61.000000,8031.000000 )




"Smith, Michael ERDC-RDE-CRREL-NH" <Michael.Smith <at> erdc.dren.mil>

2015-05-19 09:42

A
"Steve.Toutant <at> inspq.qc.ca" <Steve.Toutant <at> inspq.qc.ca>, "Rahkonen Jukka (MML)" <jukka.rahkonen <at> maanmittauslaitos.fi>
cc
MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>
Objet
Re: [mapserver-users] [EXTERNAL] Re: Mapserver 7+oracle - wfs getFeature with filter on numeric field







Steve,

Rerun this with DEBUG 3 on the LAYER and the generated SQL will show up in your error logs. Then it should show why the generated sql is not valid.

Mike

--
Michael Smith
Remote Sensing/GIS Center
US Army Corps of Engineers

From: "Steve.Toutant <at> inspq.qc.ca" <Steve.Toutant <at> inspq.qc.ca>
Date: Tuesday, May 19, 2015 at 9:37 AM
To: "Rahkonen Jukka (MML)" <jukka.rahkonen <at> maanmittauslaitos.fi>
Cc: MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>, Michael Smith <michael.smith <at> erdc.dren.mil>
Subject: Re: [mapserver-users] [EXTERNAL] Re: Mapserver 7+oracle - wfs getFeature with filter on numeric field

Thank you all for this discussion.
We had different problems in our use case coming from gdal, mapserv, oracle, ......
I don't know how gdal should manage this comma issue, but I would like to clarify our problem with mapserv and see if something must be done.

Resume
- We use MS7.1 with oraclespatial connection
- gml_type = auto, which returns <element name="LONG_STAT" minOccurs="0" type="double"/>
- matchCase =true
- LONG_STAT = -61,8031

The problem is
<ogc:PropertyIsEqualTo matchCase="true"><ogc:PropertyName>LONG_STAT</ogc:PropertyName><ogc:Literal>-61,8031</ogc:Literal></ogc:PropertyIsEqualTo>, crash with this error
<ows:Exception exceptionCode="NoApplicableCode" locator="mapserv">
   <ows:ExceptionText>msWFSGetFeature(): WFS server error. FLTApplyFilterToLayer() failed
msOracleSpatialLayerWhichShapes(): OracleSpatial error. Check your data statement and server logs</ows:ExceptionText>
 </ows:Exception>

But, using LIKE it Works ...Probably because it "convert" the value as a string
<ogc:PropertyIsLike matchCase="true" wildCard="*" singleChar="." escapeChar="!"><ogc:PropertyName>LONG_STAT</ogc:PropertyName><ogc:Literal>*-61,8031*</ogc:Literal></ogc:PropertyIsLike>

But why ogc:PropertyIsEqualTo is crashing?



"Rahkonen Jukka (MML)" <jukka.rahkonen <at> maanmittauslaitos.fi>

2015-05-15 10:05


A
"Steve.Toutant <at> inspq.qc.ca" <Steve.Toutant <at> inspq.qc.ca>, "Smith, Michael ERDC-RDE-CRREL-NH" <Michael.Smith <at> erdc.dren.mil>
cc
MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>
Objet
Re: [mapserver-users] [EXTERNAL] Re: Mapserver 7+oracle - wfs getFeature with filter on numeric field









Hi,
 
I think that the real trouble is that with certain database and client settings the numerical data that is stored into Oracle is not interpreted correctly and correct place to fix the issue is somewhere very close to Oracle. Not in making GML parser to accept commas or to make WFS string comparisons to work correctly with numerical data in Oracle.
 
GDAL had similar troubles for sure with Finnish, Italian and French locales and probably with all the other locales using comma as decimal separator as well. In practice it meant for me that GDAL truncated decimal numbers “1234,56” at comma “1234”. For many years I used some workarounds but after this GDAL fix it has not been necessary any more:
http://trac.osgeo.org/gdal/ticket/5709
 
I suggest to study the patch “'OCI: force NLS_NUMERIC_CHARACTERS to ". " (patch by giorgiomugnaini, #5709)'” and consider if it could be applied to the native Oracle driver in Mapserver. I guess and hope that Mapserver would recognize the datatype correctly if the Oracle layer is configured to read Oracle through OGR and GDAL 2.0 is in use.
 
Perhaps setting environment "ALTER SESSION SET NLS_NUMERIC_CHARACTERS = '. '" locally before starting Mapserver would be enough but I do not know how and where to set it.
 
-Jukka Rahkonen-
 
 
Steve.Toutant wrote:
 
Is there a documentation that says that it is not?
Folks from gdal list also think that it is not supported...I guess you are right. But as I said on the gdal list, many countries are using a comma as a decimal separator....what other people on the planet do?
Anyway the comma is another problem that I try to manage later......

For now, We have an application that generate and launch spatial queries on WFS, matchCase=false by default. Before modifying the code I want to understand what is going on....
It seems,when using numeric value, that matchCase as no impact in PostGIS, but it is important in oracle to be set to true

gml_type = auto, returns double in postgis and oracle, so that is fine
A WFS getFeature with the operator PropertyIsEqualTo AND matchCase=false
using this value -64.225
PostGis: it works
Oracle (from mike's test): it fails...matchCase must be set to true

A WFS getFeature with the operator PropertyIsEqualTo AND matchCase=false
using this value -64,225
PotsGis: not tested
Oracle: it fails...matchCase must be set to true

Is there a reason why, with oracle, matchCase should be set to true when using numeric value, or that could be fixed?
Regards
Steve

"Smith, Michael ERDC-RDE-CRREL-NH" <Michael.Smith <at> erdc.dren.mil>

2015-05-14 09:17


A
"Steve.Toutant <at> inspq.qc.ca" <Steve.Toutant <at> inspq.qc.ca>
cc
MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>, thomas bonfort <thomas.bonfort <at> gmail.com>
Objet
Re: [EXTERNAL] Re: [mapserver-users] Mapserver 7+oracle - wfs getFeature with filter on numeric field


 







Its not clear to me that commas as the decimal separator is supported in XML/GML. I can't find any documentation to indicate that it is. Can you point some out to me?

In any event, I didn't test with comma decimal separators.

Mike


----
Michael Smith
US Army Corps
Remote Sensing GIS/Center
michael.smith <at> usace.army.mil


From: "Steve.Toutant <at> inspq.qc.ca" <Steve.Toutant <at> inspq.qc.ca>
Date: Thursday, May 14, 2015 at 8:54 AM
To: Michael Smith <michael.smith <at> erdc.dren.mil>
Cc: MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>, thomas bonfort <thomas.bonfort <at> gmail.com>
Subject: Re: [EXTERNAL] Re: [mapserver-users] Mapserver 7+oracle - wfs getFeature with filter on numeric field

Thanks Mike for having a look at it.
Your decimals are separated by a comma or a dot?

 

"Smith, Michael ERDC-RDE-CRREL-NH" <Michael.Smith <at> erdc.dren.mil>

2015-05-13 18:53

 


A
"Steve.Toutant <at> inspq.qc.ca" <Steve.Toutant <at> inspq.qc.ca>, thomas bonfort <thomas.bonfort <at> gmail.com>
cc
MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>
Objet
Re: [EXTERNAL] Re: [mapserver-users] Mapserver 7+oracle - wfs getFeature with filter on numeric field


 








Steve,

I tested this out with 7.1 with numeric type fields and it works for me as long as I don't use matchCase="false". That seems to kick it in to a string comparison. matchCase="true" and just PropertyIsEqualTo work fine.

In our metadata we use "gml_types"   "auto" when the database knows the types and explicit declarations (eg "gml_attributename_type"   "integer") when it doesn't work.

The key is that the field type has to report as a numeric type or the backend treats it as a string comparison.

Mike
----
Michael Smith
US Army Corps
Remote Sensing GIS/Center
michael.smith <at> usace.army.mil


From: "Steve.Toutant <at> inspq.qc.ca" <Steve.Toutant <at> inspq.qc.ca>
Date: Wednesday, May 13, 2015 at 10:35 AM
To: thomas bonfort <thomas.bonfort <at> gmail.com>
Cc: MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>
Subject: [EXTERNAL] Re: [mapserver-users] Mapserver 7+oracle - wfs getFeature with filter on numeric field
Resent-From: Michael Smith <michael.smith <at> usace.army.mil>

Precision: we are using MS7.1
Removing matchcase part makes oracle, and postgis, crash.
I have this error:

<ows:ExceptionReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows" version="1.1.0" language="en-US"xsi:schemaLocation="http://www.opengis.net/ows< /a>http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd">
<ows:Exception exceptionCode="NoApplicableCode" locator="mapserv">
<ows:ExceptionText>
msWFSGetFeature(): WFS server error. FLTApplyFilterToLayer() failed msOracleSpatialLayerWhichShapes(): OracleSpatial error. Check your data statement and server logs
</ows:ExceptionText>


The problem might be the decimals?
Here is the request
<wfs:Query typeName="feature:SMDVDP_STAT_METE" srsName="EPSG:32198">
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>LONG_STAT</ogc:PropertyName>
<ogc:Literal>-61,8031</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

 

thomas bonfort <thomas.bonfort <at> gmail.com>

2015-05-13 05:40

 


A
Steve.Toutant <at> inspq.qc.ca
cc
MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>
Objet
Re: [mapserver-users] Mapserver 7+oracle - wfs getFeature with filter on numeric field










can you try the same request without the "matchCase" part and report
back please?

On 12 May 2015 at 18:11,  <Steve.Toutant <at> inspq.qc.ca> wrote:
> I have a problem using a FILTER in a wfs getFeature request on an oracle DB
> with MS7
> When I launch a getFeature request with a Filter on a numeric field it
> doesn't work,
> <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo
> matchCase="false"><ogc:PropertyName>LONG_STAT</ogc:PropertyName><ogc:Literal>-61</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>
> here is the error we get in the browser
> <ows:Exception exceptionCode="NoApplicableCode" locator="mapserv">
>    <ows:ExceptionText>msWFSGetFeature(): WFS server error.
> FLTApplyFilterToLayer() failed
> msOracleSpatialLayerWhichShapes(): OracleSpatial error. Check your data
> statement and server logs</ows:ExceptionText>
>
> from mapserver logs
> [Tue May 12 11:59:10 2015].177992 msOracleSpatialLayerTranslateFilter.
> String:  ([LONG_STAT] =*-61)
>
> LONG_STAT is a NUMBER in the DB
> DescribefeatureType returns
>           <element name="NO_STAT_CLIM" minOccurs="0" type="string"/>
>          <element name="NO_STAT_FADQ" minOccurs="0" type="string"/>
>          <element name="NOM_STAT" minOccurs="0" type="string"/>
>          <element name="LATI_STAT" minOccurs="0" type="string"/>
>          <element name="LONG_STAT" minOccurs="0" type="string"/>
>          <element name="ALTI_STAT" minOccurs="0" type="string"/>
>
> I tried to add "gml_types" "auto" in the mapfile, but it still returns
> string as data type
> I tried "gml_LONG_STAT_type" = "Integer" in the mapfile, describeFeatureType
> returns "<element name="LONG_STAT" minOccurs="0" type="double"/> " but I
> still get an error in getFeature
>
> I'm using CONNECTIONTYPE oraclespatial in the mapfile
>
> I can provide more information....
>
> Is it a known issue or can I do something about that?
>
> Thank you!
> _______________________________________________
> 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

Re: [EXTERNAL] Re: Mapserver 7+oracle - wfs getFeature with filter on numeric field

Steve,

Rerun this with DEBUG 3 on the LAYER and the generated SQL will show up in your error logs. Then it should show why the generated sql is not valid.

Mike

-- 
Michael Smith
Remote Sensing/GIS Center
US Army Corps of Engineers

From: "Steve.Toutant <at> inspq.qc.ca" <Steve.Toutant <at> inspq.qc.ca>
Date: Tuesday, May 19, 2015 at 9:37 AM
To: "Rahkonen Jukka (MML)" <jukka.rahkonen <at> maanmittauslaitos.fi>
Cc: MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>, Michael Smith <michael.smith <at> erdc.dren.mil>
Subject: Re: [mapserver-users] [EXTERNAL] Re: Mapserver 7+oracle - wfs getFeature with filter on numeric field

Thank you all for this discussion.
We had different problems in our use case coming from gdal, mapserv, oracle, ......
I don't know how gdal should manage this comma issue, but I would like to clarify our problem with mapserv and see if something must be done.

Resume
- We use MS7.1 with oraclespatial connection
- gml_type = auto, which returns <element name="LONG_STAT" minOccurs="0" type="double"/>
- matchCase =true
- LONG_STAT = -61,8031

The problem is
<ogc:PropertyIsEqualTo matchCase="true"><ogc:PropertyName>LONG_STAT</ogc:PropertyName><ogc:Literal>-61,8031</ogc:Literal></ogc:PropertyIsEqualTo>, crash with this error
 <ows:Exception exceptionCode="NoApplicableCode" locator="mapserv">
    <ows:ExceptionText>msWFSGetFeature(): WFS server error. FLTApplyFilterToLayer() failed
msOracleSpatialLayerWhichShapes(): OracleSpatial error. Check your data statement and server logs</ows:ExceptionText>
  </ows:Exception>

But, using LIKE it Works ...Probably because it "convert" the value as a string
<ogc:PropertyIsLike matchCase="true" wildCard="*" singleChar="." escapeChar="!"><ogc:PropertyName>LONG_STAT</ogc:PropertyName><ogc:Literal>*-61,8031*</ogc:Literal></ogc:PropertyIsLike>

But why ogc:PropertyIsEqualTo is crashing?




"Rahkonen Jukka (MML)" <jukka.rahkonen <at> maanmittauslaitos.fi>

2015-05-15 10:05

A
"Steve.Toutant <at> inspq.qc.ca" <Steve.Toutant <at> inspq.qc.ca>, "Smith, Michael ERDC-RDE-CRREL-NH" <Michael.Smith <at> erdc.dren.mil>
cc
MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>
Objet
Re: [mapserver-users] [EXTERNAL] Re: Mapserver 7+oracle - wfs getFeature with filter on numeric field







Hi,
 
I think that the real trouble is that with certain database and client settings the numerical data that is stored into Oracle is not interpreted correctly and correct place to fix the issue is somewhere very close to Oracle. Not in making GML parser to accept commas or to make WFS string comparisons to work correctly with numerical data in Oracle.
 
GDAL had similar troubles for sure with Finnish, Italian and French locales and probably with all the other locales using comma as decimal separator as well. In practice it meant for me that GDAL truncated decimal numbers “1234,56” at comma “1234”. For many years I used some workarounds but after this GDAL fix it has not been necessary any more:
http://trac.osgeo.org/gdal/ticket/5709
 
I suggest to study the patch “'OCI: force NLS_NUMERIC_CHARACTERS to ". " (patch by giorgiomugnaini, #5709)'” and consider if it could be applied to the native Oracle driver in Mapserver. I guess and hope that Mapserver would recognize the datatype correctly if the Oracle layer is configured to read Oracle through OGR and GDAL 2.0 is in use.
 
Perhaps setting environment "ALTER SESSION SET NLS_NUMERIC_CHARACTERS = '. '" locally before starting Mapserver would be enough but I do not know how and where to set it.
 
-Jukka Rahkonen-
 
 
Steve.Toutant wrote:
 
Is there a documentation that says that it is not?
Folks from gdal list also think that it is not supported...I guess you are right. But as I said on the gdal list, many countries are using a comma as a decimal separator....what other people on the planet do?
Anyway the comma is another problem that I try to manage later......

For now, We have an application that generate and launch spatial queries on WFS, matchCase=false by default. Before modifying the code I want to understand what is going on....
It seems,when using numeric value, that matchCase as no impact in PostGIS, but it is important in oracle to be set to true

gml_type = auto, returns double in postgis and oracle, so that is fine
A WFS getFeature with the operator PropertyIsEqualTo AND matchCase=false
using this value -64.225
PostGis: it works
Oracle (from mike's test): it fails...matchCase must be set to true

A WFS getFeature with the operator PropertyIsEqualTo AND matchCase=false
using this value -64,225
PotsGis: not tested
Oracle: it fails...matchCase must be set to true

Is there a reason why, with oracle, matchCase should be set to true when using numeric value, or that could be fixed?
Regards
Steve


"Smith, Michael ERDC-RDE-CRREL-NH" <Michael.Smith <at> erdc.dren.mil>

2015-05-14 09:17


A
"Steve.Toutant <at> inspq.qc.ca" <Steve.Toutant <at> inspq.qc.ca>
cc
MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>, thomas bonfort <thomas.bonfort <at> gmail.com>
Objet
Re: [EXTERNAL] Re: [mapserver-users] Mapserver 7+oracle - wfs getFeature with filter on numeric field

 








Its not clear to me that commas as the decimal separator is supported in XML/GML. I can't find any documentation to indicate that it is. Can you point some out to me?

In any event, I didn't test with comma decimal separators.

Mike

 
----
Michael Smith
US Army Corps
Remote Sensing GIS/Center
michael.smith <at> usace.army.mil


From: "Steve.Toutant <at> inspq.qc.ca" <Steve.Toutant <at> inspq.qc.ca>
Date: Thursday, May 14, 2015 at 8:54 AM
To: Michael Smith <michael.smith <at> erdc.dren.mil>
Cc: MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>, thomas bonfort <thomas.bonfort <at> gmail.com>
Subject: Re: [EXTERNAL] Re: [mapserver-users] Mapserver 7+oracle - wfs getFeature with filter on numeric field

Thanks Mike for having a look at it.
Your decimals are separated by a comma or a dot?

 

"Smith, Michael ERDC-RDE-CRREL-NH" <Michael.Smith <at> erdc.dren.mil>

2015-05-13 18:53

 


A
"Steve.Toutant <at> inspq.qc.ca" <Steve.Toutant <at> inspq.qc.ca>, thomas bonfort <thomas.bonfort <at> gmail.com>
cc
MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>
Objet
Re: [EXTERNAL] Re: [mapserver-users] Mapserver 7+oracle - wfs getFeature with filter on numeric field

 









Steve,

I tested this out with 7.1 with numeric type fields and it works for me as long as I don't use matchCase="false". That seems to kick it in to a string comparison. matchCase="true" and just PropertyIsEqualTo work fine.

In our metadata we use "gml_types"   "auto" when the database knows the types and explicit declarations (eg "gml_attributename_type"   "integer") when it doesn't work.

The key is that the field type has to report as a numeric type or the backend treats it as a string comparison.

Mike
----
Michael Smith
US Army Corps
Remote Sensing GIS/Center
michael.smith <at> usace.army.mil


From: "Steve.Toutant <at> inspq.qc.ca" <Steve.Toutant <at> inspq.qc.ca>
Date: Wednesday, May 13, 2015 at 10:35 AM
To: thomas bonfort <thomas.bonfort <at> gmail.com>
Cc: MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>
Subject: [EXTERNAL] Re: [mapserver-users] Mapserver 7+oracle - wfs getFeature with filter on numeric field
Resent-From: Michael Smith <michael.smith <at> usace.army.mil>

Precision: we are using MS7.1
Removing matchcase part makes oracle, and postgis, crash.
I have this error:

<ows:ExceptionReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows" version="1.1.0" language="en-US"xsi:schemaLocation="http://www.opengis.net/ows< /a>http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd">
<ows:Exception exceptionCode="NoApplicableCode" locator="mapserv">
<ows:ExceptionText>
msWFSGetFeature(): WFS server error. FLTApplyFilterToLayer() failed msOracleSpatialLayerWhichShapes(): OracleSpatial error. Check your data statement and server logs
</ows:ExceptionText>


The problem might be the decimals?
Here is the request
<wfs:Query typeName="feature:SMDVDP_STAT_METE" srsName="EPSG:32198">
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>LONG_STAT</ogc:PropertyName>
<ogc:Literal>-61,8031</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

 

thomas bonfort <thomas.bonfort <at> gmail.com>

2015-05-13 05:40

 


A
Steve.Toutant <at> inspq.qc.ca
cc
MapserverList OSGEO <mapserver-users <at> lists.osgeo.org>
Objet
Re: [mapserver-users] Mapserver 7+oracle - wfs getFeature with filter on numeric field











can you try the same request without the "matchCase" part and report
back please?

On 12 May 2015 at 18:11,  <Steve.Toutant <at> inspq.qc.ca> wrote:
> I have a problem using a FILTER in a wfs getFeature request on an oracle DB
> with MS7
> When I launch a getFeature request with a Filter on a numeric field it
> doesn't work,
> <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo
> matchCase="false"><ogc:PropertyName>LONG_STAT</ogc:PropertyName><ogc:Literal>-61</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>
> here is the error we get in the browser
> <ows:Exception exceptionCode="NoApplicableCode" locator="mapserv">
>    <ows:ExceptionText>msWFSGetFeature(): WFS server error.
> FLTApplyFilterToLayer() failed
> msOracleSpatialLayerWhichShapes(): OracleSpatial error. Check your data
> statement and server logs</ows:ExceptionText>
>
> from mapserver logs
> [Tue May 12 11:59:10 2015].177992 msOracleSpatialLayerTranslateFilter.
> String:  ([LONG_STAT] =*-61)
>
> LONG_STAT is a NUMBER in the DB
> DescribefeatureType returns
>           <element name="NO_STAT_CLIM" minOccurs="0" type="string"/>
>          <element name="NO_STAT_FADQ" minOccurs="0" type="string"/>
>          <element name="NOM_STAT" minOccurs="0" type="string"/>
>          <element name="LATI_STAT" minOccurs="0" type="string"/>
>          <element name="LONG_STAT" minOccurs="0" type="string"/>
>          <element name="ALTI_STAT" minOccurs="0" type="string"/>
>
> I tried to add "gml_types" "auto" in the mapfile, but it still returns
> string as data type
> I tried "gml_LONG_STAT_type" = "Integer" in the mapfile, describeFeatureType
> returns "<element name="LONG_STAT" minOccurs="0" type="double"/> " but I
> still get an error in getFeature
>
> I'm using CONNECTIONTYPE oraclespatial in the mapfile
>
> I can provide more information....
>
> Is it a known issue or can I do something about that?
>
> Thank you!
> _______________________________________________
> 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

Re: [EXTERNAL] Re: Mapserver 7+oracle - wfs getFeature with filter on numeric field

It looks like whats happening is that’s being converted into 3 Tokens and the oracle driver converts it into a number + comma + number. 

The tokenizer is not treating that value as a single value. 

Mike
-- 
Michael Smith
Remote Sensing/GIS Center
US Army Corps of Engineers
_______________________________________________
mapserver-users mailing list
mapserver-users <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [EXTERNAL] Re: Mapserver 7+oracle - wfs getFeature with filter on numeric field

Steve,

Rerun this with DEBUG 3 on the LAYER and the generated SQL will show up in your error logs. Then it should show why the generated sql is not valid.

Mike

-- 
Michael Smith
Remote Sensing/GIS Center
US Army Corps of Engineers

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

Gmane