[mapserver-users] problems with KML output in context of WFS GetFeature

2014-09-24 Thread Peter Freimuth
Hi Mapserver Users,

We have a problem with creating KML output from a PostGIS db in context of a 
GetFeature request version=1.1.0 outputformat=kml.

The problem is that not all attributes are exported and that the values are 
shifted, means the mapping between value ad attribute name is wrong.

This is the request:

http://localhost/cgi-bin/catalog_view.fcgi?typename=coveragepolssearchid=6ca8dd30-43b8-11e4-9804-00163e437838SERVICE=WFSVERSION=1.1.0REQUEST=GetFeatureSRS=EPSG:4326outputformat=kml

This is the mapserv config:
!-- MapServer version 6.4.1 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ 
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=ICONV 
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT 
SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS 
INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE --

This is the outputformat declaration from the mapfile:
OUTPUTFORMAT
NAME kml
DRIVER OGR/KML
MIMETYPE application/vnd.google-earth.kml.xml
FORMATOPTION STORAGE=memory
FORMATOPTION FORM=SIMPLE
FORMATOPTION FILENAME=catalog_search_result.kml
END

This is the layer from the mapfile:

##
# This layer serves a WMS representation of the coverage polygons and a WFS 
for the related metadata

##
LAYER
NAME coveragepols
TYPE POLYGON
STATUS ON
DEBUG 5
UNITS meters #dd
SIZEUNITS PIXELS
TOLERANCE 3
TOLERANCEUNITS PIXELS
MINSCALE 1000
MAXSCALE 1000
LABELITEM label
LABELMAXSCALEDENOM 140
PROCESSING CLOSE_CONNECTION=DEFER
CONNECTIONTYPE POSTGIS
CONNECTIONuser= password= dbname= host='localhost' 
port=5432
DATA coverage_poly FROM (SELECT product_identifier, 
product_identifier||'_'||cast(acquisition_date as date)::text as label,
 imagetake_cat_id as it_cat_id, 
tile_id, spacecraft_id, cloud_cover, black_fill, acquisition_date,
 image_path, id as image_id, 
search_request_id as search_id,
 tileid_stack_order, roll_angle as 
view_angle, metadata_url,
 
st_asewkt(st_transform(footprint,3785)::geometry) as footprint,
 st_transform(coveragepoly,3785) as 
coverage_poly
 FROM catalog_search_view.view_service
 WHERE search_request_id='%searchid%' AND 
is_visible=TRUE
 ORDER BY product_identifier, tile_id, 
tileid_stack_order ASC, acquisition_date ASC, cloud_cover ASC, black_fill ASC
 ) foo USING UNIQUE image_id USING SRID=3785
PROJECTION
init=epsg:3785 #Google Projection ( new code )
#init=epsg:4326
END
VALIDATION
'searchid' 
'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
'default_searchid' '5b7257a0-d9df-11e3-b7e2-b4b52fd4696c'
END
METADATA
ows_title Coverage Polygons
ows_extent -20037508.34 -20037508.34 20037508.34 20037508.34
#ows_extent -180 -89 180 89
wms_srs EPSG:3857 EPSG:3785 EPSG:900913 EPSG:4326 #output
wfs_getfeature_formatlist  geojson,shapezip,csv
wfs_featureid image_id
wfs_getfeature_formatlist  geojson,shapezip,csv,kml 
wfs_geomtype  Polygon
gml_include_items all
gml_exclude_items 
gml_types auto
END
CLASS
NAME Coverage Polygons
#STYLE
#   COLOR 231 182 21
#END
STYLE
OUTLINECOLOR 10 255 0
WIDTH 2
END
LABEL
...
END
END
END


This is the resulting KML:

?xml version=1.0 encoding=utf-8 ?
kml xmlns=http://www.opengis.net/kml/2.2;
DocumentFoldernamecoveragepols/name
  Placemark
name8971800/name
description8971800_2012-04-01/description

StyleLineStylecolorffff/color/LineStylePolyStylefill0/fill/PolyStyle/Style
ExtendedDataSchemaData schemaUrl=#coveragepols
SimpleData 
name=product_identifier8971799/SimpleData
SimpleData name=label2131328/SimpleData
SimpleData name=it_cat_id0/SimpleData
SimpleData name=tile_id2/SimpleData
SimpleData name=spacecraft_id70/SimpleData
  

[mapserver-users] searching for a solution to render polygons crossing the antimeridan

2014-09-01 Thread Peter Freimuth
Hi,
i think this problem was solved already thousand times but i could not find a 
solution via google.

We have polygons in a postgis 2.1 db describing the satellite images which 
sometimes cross the antimeridan. These polygons shall be rendered to a map via 
WMS calls using google Mercator in the map client (or any other projection 
supported by the WMS). The problem is that the polygons are drawn incorrect 
(see attached image which is the outcome of the following call
http://db5.devel.intern/cgi-bin/catalog_view.fcgi?SERVICE=WMSVERSION=1.1.1REQUEST=getmaplayers=coveragepols_testbbox=19068286.820724,-2282715.4123002,20749901.442696,-1809417.3332432srs=epsg:3785format=image/pngwidth=800height=800)

Any hint on documentation or how to overcome this problem is very welcome!
Kind regards,
Peter


These are the details: umn ms 6.4.1
## layer defintion
LAYER
NAME coveragepols_test
TYPE POLYGON
STATUS ON
DEBUG 5
UNITS dd
SIZEUNITS PIXELS
TOLERANCE 3
TOLERANCEUNITS PIXELS
PROCESSING CLOSE_CONNECTION=DEFER
CONNECTIONTYPE POSTGIS
CONNECTIONuser=... password= dbname=... host='localhost' port=5432
DATA coverage_poly FROM (SELECT id as image_id, coveragepoly as 
coverage_poly
 FROM 
public.view_test
   ) foo USING 
UNIQUE image_id USING SRID=4326
PROJECTION
init=epsg:4326
END
METADATA
ows_title Coverage Polygons
#ows_extent -20037508.34 -20037508.34 20037508.34 20037508.34
ows_extent -180 -89 180 89
wms_srs EPSG:3875 EPSG:900913 EPSG:4326 #output
END
CLASS
NAME Coverage Polygons
#STYLE
#   COLOR 231 182 21
#END
STYLE
OUTLINECOLOR 10 255 0
WIDTH 2
   END
END
END




##used data
CREATE TABLE view_test
(
  id bigserial NOT NULL,
  catalog_id integer,
  dataset_id integer,
  image_path character varying(256) NOT NULL,
  coveragepoly geometry(MultiPolygon,4326),
  CONSTRAINT view_test_pkey PRIMARY KEY (id)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE view_test
  OWNER TO searchdb_admin;

INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)
VALUES (15829509, 2061925, '', st_multi(st_geomfromtext('POLYGON((180.655999799 
-15.8486300543,180.606999598 -16.0696710923,180.558000402 
-16.2907050895,180.509000201 -16.5117270167,180.459000201 -16.7327328505,180.41 
-16.9537185677,180.36 -17.1746801448,180.310999799 -17.3956135586,180.260999799 
-17.6165178033,180.210999799 -17.8373888554,180.160999799 
-18.0582267149,180.110999799 -18.2790293703,180.06 -18.4997958157,180.01 
-18.7205260511,179.991351841 -18.8027016697,180.235999799 
-18.8380677932,180.478000402 -18.8720267552,180.716999598 
-18.9047223899,180.735999799 -18.8224783746,180.785 
-18.6015670891,180.834000201 -18.3806216053,180.883000402 
-18.1596439348,180.931999598 -17.9386350835,180.980999799 -17.7175950513,181.03 
-17.4965258499,181.079000201 -17.2754304969,181.128000402 
-17.054309998,181.175999799 -16.8331663649,181.225 -16.6120056327,181.273000402 
-16.3908308187,181.321999598 -16.1696449407,181.37 -15.9484540334,181.134000201 
-15.9164302957,180.896999598 -15.8832025749,180.655999799 
-15.8486300543))',4326)));
INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)
VALUES (15836184, 2063096, '', st_multi(st_geomfromtext('POLYGON((179.545984711 
-15.9171514786,179.495243412 -16.1403429893,179.30698 
-16.3635103601,179.39354657 -16.5866535908,179.342587005 
-16.8097726816,179.291548984 -17.0328726614,179.240427479 
-17.2559535305,179.189217461 -17.4790142828,179.137916918 
-17.7020488835,179.086521827 -17.9250553209,179.035031181 
-18.1480315832,178.983387648 -18.3712140414,179.243388654 
-18.4105864011,179.497604104 -18.4480185073,179.746907061 
-18.4837567894,179.797483404 -18.2603590827,179.847922953 
-18.0371695836,179.898278012 -17.8139509153,179.948551599 
-17.5907060954,179.998746731 -17.3674381412,180.049000201 
-17.1441520821,180.099000201 -16.9208519413,180.149000201 
-16.6975347013,180.199000201 -16.4741983504,180.249000201 
-16.2508398713,180.298000402 -16.0274612754,180.053000402 
-15.9924049487,179.802257091 -15.9557151479,179.545984711 
-15.9171514786))',4326)));
INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)
VALUES (17349264, 2322838, '', st_multi(st_geomfromtext('POLYGON((179.512290179 
72.1542419267,179.144996874 71.9140629718,178.786510145 
71.6732398732,178.436519681 71.431805025,178.09473374 
71.1897945653,177.760579284 70.9470277758,178.409691839 
70.8557411573,179.049974648 70.7633884077,179.683210657 70.6697257057,180.037 
70.9090975825,180.398 71.1476343103,180.768 71.3855111027,181.146 
71.6226895184,181.534 

[mapserver-users] wcs 1.0.0 bbox problem

2014-01-28 Thread Peter Freimuth
Hi,
executing the following request
https://devcloud.blackbridge.com/wcs/PlenumsoftDemo?SERVICE=WCSVERSION=1.0.0REQUEST=GetCoverageCOVERAGE=testdata_rawFORMAT=GEOTIFF_INT16RESX=5RESY=5RESPONSE_CRS=EPSG:32616CRS=EPSG:4326TIME=2012-04-05

results in

?xml version='1.0' encoding=ISO-8859-1 ?
xmlns=http://www.opengis.net/ogc; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=http://www.opengis.net/ogc 
http://schemas.opengeospatial.net/wcs/1.0.0/OGC-exception.xsd;
msWCSGetCoverage(): WCS server error. Requested BBOX (-2.5,-2.5,2.5,2.5) is 
outside requested coverage BBOX (210500,2230500,261500,2281500)
msProjectRect(): Projection library error. All points failed to reproject.
msProjectPoint(): Projection library error. proj says: latitude or longitude 
exceeded limits

The corresponding layer d3efinition is:

MAP
...
LAYER
# this is the tileindex that aggregates the single image products together and 
makes them accessible by date and extend
NAME data_raw_idx
STATUS ON

DEBUG 5
TYPE POLYGON
DATA 
/mnt/mapserver/mapserver_wms/Raster/Plenumosft_RE_Sample_forWCS/plenumsoft_demo_data
PROJECTION
init=epsg:32616
END
VALIDATION
# 'productid' '^([0-9])$'
END
#FILTER ( '[productid]'='%productid%')
METADATA
#'productid_validation_pattern' '^([0-9])$'
#'default_productid' '1234567'
#disable explicitly everything that shall not be supported for this Layer
wms_enable_request !GetCapabilities !GetMap !GetLegendgraphic
wcs_enable_request !GetCapabilities !GetCoverage !DescribeCoverage
wfs_enable_request !GetCapabilities !GetFeature !DescribeFeatureType
END
END
LAYER
# this layer serves the 16bit raw data
NAME testdata_raw
STATUS ON

DUMP TRUE
DEBUG 5
TYPE RASTER ### required
PROJECTION
init=epsg:32616
END
OFFSITE 0 0 0 
UNITS meters
TILEINDEX data_raw_idx
TILEITEM location
#MASK mask2
METADATA
wcs_title 5 band 16bit RE Testdata with time support
wcs_extent 210500.0 2230500.0 261500.0 2281500.0 # shall be set dynamically 
by the wrapper script on mapObj base
wcs_srs EPSG:4326 EPSG:900913 EPSG:3857 EPSG:32615 EPSG:32616 EPSG:32617
wcs_label 5 band 16bit RE Testdata ### required
wcs_rangeset_axes bands
wcs_rangeset_name Bands ### required to support DescribeCoverage request
wcs_rangeset_label RE Radiometric Bands ### required to support 
DescribeCoverage request
wcs_rangeset_nullvalue 0

#wcs_size 15000 15000 #if we have a global ows_extent set in web-metadata 
and a wcs_resolution this gets calculated by mapserver
wcs_resolution 5.0 5.0
wcs_bandcount 5
wcs_band_names Blue Green Red Rededge Nir
wcs_imagemode INT16
wcs_formats GEOTIFF_INT16 AAIGRID
wcs_native_format image/tiff
wcs_nativeformat GTiff
wcs_enable_request *
wcs_timeposition 2011-01-04,2011-04-20,2012-04-05 #this might get set by 
the mapscript wrapper accodingly to the dates avaialable for the service and is 
mandatory to allow temporal subsettings
wcs_timeextent 2011-01-04/2012-04-05 # shall be set dynamically by the 
wrapper script on mapObj base
wcs_timeitem acquidate
#disable explicitly everything that shall not be supported for this Layer
wms_enable_request !GetCapabilities !GetMap !GetLegendgraphic
wfs_enable_request !GetCapabilities !GetFeature !DescribeFeatureType
END
CLASS
NAME 5 Band (16bit) RE Imagedata
KEYIMAGE drgs_keyimage.png
END
END
...
END

If i use CRS=EPSG:32616 which is the epsg code of the layer itself, everything 
works fine. I would expect that mapserver would reproject the wcs_extent or 
layer_extent or map_extent to the given CRS and use that BBOX by default.

related to:
https://github.com/mapserver/mapserver/issues/4853

-- 
Peter Freimuth 

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

[mapserver-users] using MASK in context of WCS 1.0.0 GetCoverage

2013-09-06 Thread Peter Freimuth

Hi,
i try to use a MASK layer to clip a WCS layer (5 bands a 16bit) in a 
GetCoverage request. It works fine when i use it in context of WMS 
GetMap requests. But the GetCoverage requests just ignores the MASK and 
i get my result unclipped. I would expect that the requested Geotiff 
contains NoData values where the mask was applied but it does'nt.

Any idea why this is not working as expected? requested outputformat is
OUTPUTFORMAT
NAME GEOTIFF_INT16
DRIVER GDAL/GTiff
IMAGEMODE INT16
EXTENSION tif
FORMATOPTION COMPRESS=DEFLATE
FORMATOPTION ZLEVEL=8
FORMATOPTION TILED=YES
FORMATOPTION PREDICTOR=2
FORMATOPTION NULLVALUE=0
END

Thanks for any hint on that topic.

I am using Mapserver 6.4beta2 with latest GDAL from trunk.

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


Re: [mapserver-users] wcs 1..0.0 getcapabilities problem in mapserver 6.4dev and 6.2.x

2013-09-04 Thread Peter Freimuth

Hi Even,
thanks for the tip. Actually this solved the problem. I did not found an 
example which makes clear for what this metadata element is used and how 
this url should look like but at least the warning from the capabilities 
doc is gone.

Best regards,
Peter
On 29/08/2013 1:38 PM, Even Rouault wrote:

Le jeudi 29 août 2013 18:56:48, Peter Freimuth a écrit :

Hi,
i ran into s small problem with setting up a WCS service on umn
mapserver 6.2 and newer.
When requesting the capabilities for VERSION=1.0.0 i get the following
Warning printed to the Capabilities Doc:

Any idea what is missing. The fact that the missing mandatory metadata
accesses a null string point to a bug in the code otherwise it should
tell which parameter is missing.

Yes, the call to msOWSPrintURLType() in msWCSGetCapabilities_Service in
mapwcs.c pass tag_name == NULL, hence the (null) in the warning. Looking at
the conditions that trigger the warning, I believe the reason for the warning
is that you need to define the ows_metadatalink_href metadata item.


Thanks for any hint on this topic.
Kind regards,
Peter


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

[mapserver-users] wcs 1..0.0 getcapabilities problem in mapserver 6.4dev and 6.2.x

2013-08-29 Thread Peter Freimuth

Hi,
i ran into s small problem with setting up a WCS service on umn 
mapserver 6.2 and newer.
When requesting the capabilities for VERSION=1.0.0 i get the following 
Warning printed to the Capabilities Doc:


?xml version='1.0' encoding=ISO-8859-1 standalone=no ?
WCS_Capabilities
   version=1.0.0
   updateSequence=0
   xmlns=http://www.opengis.net/wcs;
   xmlns:xlink=http://www.w3.org/1999/xlink;
   xmlns:gml=http://www.opengis.net/gml;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=http://www.opengis.net/wcs 
http://schemas.opengeospatial.net/wcs/1.0.0/wcsCapabilities.xsd;
Service
!-- WARNING: Some mandatory elements for '(null)' are missing in this context. 
--
  descriptionThis service serves RE L3A image products with different acquisition dates and 
supports filtering by using the OGC#39;time#39;  parameter and 
the#39;imageidentifier#39;  parameter to address single images./description
  nameMapServer WCS/name
  labelRE 5Band LI_USA-MT OWS Servis/label
  keywords
keywordwcs/keyword
keyword  wms/keyword
keyword  wfs/keyword
keyword  living image/keyword
  /keywords
responsibleParty
...

In all other Version like 1.1.x or 2.0.0 everything is fine and i also have no 
problem with WMS or WFS capabilities.

this is the WEB section of the corresponding mapfile:
WEB
IMAGEPATH //image_path
METADATA
ows_title   RE 5 Band Imagedata Service
#ows_onlineresource  
http://devcloud.blackbridge.com/ows/LI_USA-MT.cgi?; ### recommended
ows_onlineresource  http://***/LI_USA-MT.cgi?; ### recommended
ows_description This service serves images registered in the OWS 
streaming platform
ows_abstract This service serves images registered in the OWS 
streaming platform
ows_srs EPSG:4326 EPSG:900913 EPSG:3857 EPSG:32662
#necessary to get the WCS virtual dataset metadata thing working
ows_extent -116.364631680367 44.1932837062986 
-103.698350095065 49.1892799088128
ows_schemas_location http://schemas.opengeospatial.net;
ows_feesnone
ows_accessconstraintsnone
ows_keywordlist  wcs, wms, wfs, living image
ows_metadatalink_typeTC211
ows_metadatalink_format  text/plain
ows_addresstype  postal
ows_address  fgdfgdgs.
ows_city fdgfgdf
ows_stateorprovince  dgdfg
ows_postcode dgdfg
ows_country  dgdg
ows_contactelectronicmailaddress ***
ows_contactperson ***
ows_contactorganization   ***
ows_contactposition   ows manager
ows_role  ows manager
ows_contactvoicetelephone 453453453
ows_contactfacsimiletelephone 345345345
ows_contactinstructions send us an email
ows_service_onlineresource http://*/cgi-bin/LI_USA-MT.cgi?;
ows_hoursofservice 8-17 MCT
ows_http_max_age   100
#ows_updatesequence 

wcs_enable_request GetCapabilities GetCoverage DescribeCoverage
wcs_descriptionThis service serves RE L3A image products 
with different acquisition dates and supports filtering by using the OGC 'time' parameter and the 
'imageidentifier' parameter to address single images.
wcs_abstractThis service serves RE L3A image products 
with different acquisition dates and supports filtering by using the OGC 'time' parameter and the 
'imageidentifier' parameter to address single images.
wcs_extent -116.364631680367 44.1932837062986 
-103.698350095065 49.1892799088128
wcs_labelRE 5Band LI_USA-MT OWS Servis ### required

wms_enable_request GetCapabilities GetMap GetLegendGraphic
wms_extent -116.364631680367 44.1932837062986 
-103.698350095065 49.1892799088128
wms_feature_info_mime_type application/json
wms_bbox_extended   true

wfs_enable_request GetCapabilities GetFeature 
DescribeFeatureType
wfs_extent  -116.364631680367 44.1932837062986 
-103.698350095065 49.1892799088128
wfs_description   This WFS service serves as a catalog service to 
find out which image products are available in the the service for further usage. ## 
Recommended
wfs_abstract   This WFS service serves as a catalog service to 
find out which image products are available in the the service for further usage. ## 
Recommended
wfs_srs   EPSG:4326 EPSG:4269 EPSG:3978 EPSG:3857 EPSG:900913 
EPSG:32662 #output for WFS data for WFS 1.0.0
wfs_maxfeatures  1

[mapserver-users] Fwd: cgi variable substituition in DATA statement

2013-08-28 Thread Peter Freimuth
Hi everybody,
thanks for all the hints and solutions. After switching to a shell script 
wrapper everything works perfectly. I needed to adapt my reg expressions to get 
it work by removing the ^ at the beginning and the $ at the end. 
Thanks again for the great support. I know why the umm mapserver is one of the 
best software projects in the OSGEO environment. Functionality is great and 
stable and support through dev and user list is always great.
Best,
Peter
-- 
Peter Freimuth 

Begin forwarded message:

 From: thomas bonfort thomas.bonf...@gmail.com
 Subject: Re: [mapserver-users] cgi variable substituition in DATA statement
 Date: 27 August, 2013 3:04:15 AM MDT
 To: Peter Freimuth freimut...@gmail.com
 Cc: MapserverList OSGEO mapserver-users@lists.osgeo.org
 
 Peter,
 I've updated the documentation to make this issue clearer. Feel free
 to amend if you see anything more is needed.
 
 https://github.com/mapserver/docs/commit/ff28660f9b3e25539921d0c39e2a47597d81ebd7
 
 --
 thomas
 
 On 26 August 2013 18:41, Peter Freimuth freimut...@gmail.com wrote:
 Hi Thomas,
 this is the wrapper script which is used:
 Somewhere in the documentation it says that this should do the same than
 using the standard cgi way so i expected it would also handle the variable
 substitution in the same way.
 
 import mapscript
 req = mapscript.OWSRequest()
 req.loadParams()
 map = mapscript.mapObj(r'/***/OwsDataStreamingTest/LI_USA-MT.map')
 map.OWSDispatch(req)
 exit()
 
 So if i switch to:
 
 #!/bin/sh
 MAPSERV=/usr/lib/cgi-bin/mapserv
 MS_MAPFILE=/***/OwsDataSteamingTest/LI_USA-MT.map exec ${MAPSERV}
 
 everything works fine.
 
 But if i try to run this as fcgi to make use of keeping the db connection
 and GDAL_CACHEMAX  i get an error that map param is not set.
 
 Which mechanismn should be used in context of fcgi to make the map param in
 the URL unnecessary?
 
 Thanks,
 Peter
 
 
 On 23/08/2013 12:32 AM, thomas bonfort wrote:
 
 yes, that's it. the substitutions only work for the mapserver CGI, not
 mapscripts. if you're using mapscript, you can manipulate your mapfile
 directly.
 
 --
 thomas
 
 On 23 August 2013 04:41, Peter Freimuth freimut...@gmail.com wrote:
 
 Hi,
 i will do so on Monday. Is it possible that the fact that we use a tiny
 map
 script wrapper to avoid the map file in the url have something to do with
 it.
 By the way i tried the leaving away of the single '  '  already but it
 just
 fails again because the parameter name doesn't get replaced. Thanks for
 all
 of your hints.
 Just to complete the circumstances. The map file uses the include
 mechanism
 to get the layer definitions and the layer which needs the substitutions
 is
 only referenced by a raster layer as an tile index. Don't know if this
 have
 something to do with it. If i use static values everything is working
 fine.
 
 Kind regards,
 --
 Peter Freimuth
 
 
 On 2013-08-22, at 3:17 AM, thomas bonfort thomas.bonf...@gmail.com
 wrote:
 
 Peter,
 can you email me your full mapfile, with the snippets you provided I
 can't see anything wrong and would therefore need to see any
 side-effects from the rest of the mapfile, and/or run it through a
 debugger to see where it's failing.
 
 --
 thomas
 
 On 21 August 2013 01:26, Peter Freimuth freimut...@gmail.com wrote:
 
 Hi,
 i am trying to get the dynamic variable substitution work on Mapserver
 6.3dev but somehow it does'nt work as it worked before and as documented.
 When i execute
 
 http://10.10.4.18/cgi-bin/LI_USA-MT.cgi?SERVICE=WMSVERSION=1.3.0REQUEST=GetMapBBOX=48.046271,-115.929840,48.198407,-115.666914CRS=EPSG:4326WIDTH=1647HEIGHT=953LAYERS=data_viewSTYLES=FORMAT=image/pngDPI=96TRANSPARENT=TRUESTARTDATE=2011-01-01ENDDATE=2013-09-01
 
 or
 
 
 http://10.10.4.18/cgi-bin/LI_USA-MT.cgi?SERVICE=WMSVERSION=1.3.0REQUEST=GetMapBBOX=48.046271,-115.929840,48.198407,-115.666914CRS=EPSG:4326WIDTH=1647HEIGHT=953LAYERS=data_viewSTYLES=FORMAT=image/pngDPI=96TRANSPARENT=TRUE
 
 I get an error in
 msDrawMap(): Image handling error. Failed to draw layer named
 'data_view'.
 msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:
 invalid input syntax for type date: %STARTDATE%
 LINE 8: ... (((acquisition_date = date_trunc('day',date
 '%STARTDAT...
 ^
 So the substitution does not happen or the default is not applied.
 Any hint on what i am doing wrong would be great.
 
 See below the components from the mapfile:
 
 MAP
 .
#
# Start of web interface definition
#
DATAPATTERN '^[a-zA-Z0-9\-\_\,]+$'
 
WEB
IMAGEPATH
 /mnt/mapserver/mapserver_wms/geocloud_config/image_path
METADATA
.
'PRODUCTID_validation_pattern'  '^[a-zA-Z0-9\-\_\,]+$'
'default_PRODUCTID'  '1234567'
'CONTRACTIDS_validation_pattern'  '^[a-zA-Z0-9\-\_\,]+$'
'default_CONTRACT_IDS'  ''
'STARTDATE_validation_pattern'
 '^([0-9]{4})-([0-9]{2})-([0-9]{2

Re: [mapserver-users] cgi variable substituition in DATA statement

2013-08-26 Thread Peter Freimuth

Hi Thomas,
this is the wrapper script which is used:
Somewhere in the documentation it says that this should do the same than 
using the standard cgi way so i expected it would also handle the 
variable substitution in the same way.


import mapscript
req = mapscript.OWSRequest()
req.loadParams()
map = mapscript.mapObj(r'/***/OwsDataStreamingTest/LI_USA-MT.map')
map.OWSDispatch(req)
exit()

So if i switch to:

#!/bin/sh
MAPSERV=/usr/lib/cgi-bin/mapserv
MS_MAPFILE=/***/OwsDataSteamingTest/LI_USA-MT.map exec ${MAPSERV}

everything works fine.

But if i try to run this as fcgi to make use of keeping the db 
connection and GDAL_CACHEMAX  i get an error that map param is not set.


Which mechanismn should be used in context of fcgi to make the map param 
in the URL unnecessary?


Thanks,
Peter

On 23/08/2013 12:32 AM, thomas bonfort wrote:

yes, that's it. the substitutions only work for the mapserver CGI, not
mapscripts. if you're using mapscript, you can manipulate your mapfile
directly.

--
thomas

On 23 August 2013 04:41, Peter Freimuth freimut...@gmail.com wrote:

Hi,
i will do so on Monday. Is it possible that the fact that we use a tiny map
script wrapper to avoid the map file in the url have something to do with
it.
By the way i tried the leaving away of the single '  '  already but it just
fails again because the parameter name doesn't get replaced. Thanks for all
of your hints.
Just to complete the circumstances. The map file uses the include mechanism
to get the layer definitions and the layer which needs the substitutions is
only referenced by a raster layer as an tile index. Don't know if this have
something to do with it. If i use static values everything is working fine.

Kind regards,
--
Peter Freimuth


On 2013-08-22, at 3:17 AM, thomas bonfort thomas.bonf...@gmail.com wrote:

Peter,
can you email me your full mapfile, with the snippets you provided I
can't see anything wrong and would therefore need to see any
side-effects from the rest of the mapfile, and/or run it through a
debugger to see where it's failing.

--
thomas

On 21 August 2013 01:26, Peter Freimuth freimut...@gmail.com wrote:

Hi,
i am trying to get the dynamic variable substitution work on Mapserver
6.3dev but somehow it does'nt work as it worked before and as documented.
When i execute
http://10.10.4.18/cgi-bin/LI_USA-MT.cgi?SERVICE=WMSVERSION=1.3.0REQUEST=GetMapBBOX=48.046271,-115.929840,48.198407,-115.666914CRS=EPSG:4326WIDTH=1647HEIGHT=953LAYERS=data_viewSTYLES=FORMAT=image/pngDPI=96TRANSPARENT=TRUESTARTDATE=2011-01-01ENDDATE=2013-09-01

or

http://10.10.4.18/cgi-bin/LI_USA-MT.cgi?SERVICE=WMSVERSION=1.3.0REQUEST=GetMapBBOX=48.046271,-115.929840,48.198407,-115.666914CRS=EPSG:4326WIDTH=1647HEIGHT=953LAYERS=data_viewSTYLES=FORMAT=image/pngDPI=96TRANSPARENT=TRUE

I get an error in
msDrawMap(): Image handling error. Failed to draw layer named 'data_view'.
msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:
invalid input syntax for type date: %STARTDATE%
LINE 8: ... (((acquisition_date = date_trunc('day',date '%STARTDAT...
 ^
So the substitution does not happen or the default is not applied.
Any hint on what i am doing wrong would be great.

See below the components from the mapfile:

MAP
.
#
# Start of web interface definition
#
DATAPATTERN '^[a-zA-Z0-9\-\_\,]+$'

WEB
IMAGEPATH /mnt/mapserver/mapserver_wms/geocloud_config/image_path
METADATA
.
'PRODUCTID_validation_pattern'  '^[a-zA-Z0-9\-\_\,]+$'
'default_PRODUCTID'  '1234567'
'CONTRACTIDS_validation_pattern'  '^[a-zA-Z0-9\-\_\,]+$'
'default_CONTRACT_IDS'  ''
'STARTDATE_validation_pattern'
'^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
'default_STARTDATE'  '2011-01-01'
'ENDDATE_validation_pattern'
'^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
'default_END_DATE'  '2013-09-01'
END
VALIDATION
 'PRODUCTID'  '^[a-zA-Z0-9\-\_\,]+$'
 'CONTRACTIDS' '^[a-zA-Z0-9\-\_\,]+$'
 'STARTDATE'  '^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
 'ENDDATE'  '^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
END
END
.
LAYER
# this is the tileindex that aggregates the single image products
together and makes them accessible for the RASTER LAYER data_view and
data_raw for rendering
NAME data_idx
STATUS ON
DEBUG 5
UNITS dd
TYPE POLYGON
EXTENT -116.364631680367 44.1932837062986 -103.698350095065
49.1892799088128
PROCESSING CLOSE_CONNECTION=DEFER
CONNECTIONTYPE POSTGIS
CONNECTION user=* password=* dbname=* host='*'
port=5432
DATA wkb_geom FROM (SELECT t1.* FROM (SELECT re3aip.cat_id as
archived_in_archiving_identifier, ico.image_id, ico.acquisition_date,
re3aip.tile_id,
ico.product_provider_image_identifier, re3aip.ohs_order_id

Re: [mapserver-users] cgi variable substituition in DATA statement

2013-08-22 Thread Peter Freimuth
Hi, 
i will do so on Monday. Is it possible that the fact that we use a tiny map 
script wrapper to avoid the map file in the url have something to do with it. 
By the way i tried the leaving away of the single '  '  already but it just 
fails again because the parameter name doesn't get replaced. Thanks for all of 
your hints.
Just to complete the circumstances. The map file uses the include mechanism to 
get the layer definitions and the layer which needs the substitutions is only 
referenced by a raster layer as an tile index. Don't know if this have 
something to do with it. If i use static values everything is working fine.

Kind regards,
-- 
Peter Freimuth 


On 2013-08-22, at 3:17 AM, thomas bonfort thomas.bonf...@gmail.com wrote:

 Peter,
 can you email me your full mapfile, with the snippets you provided I
 can't see anything wrong and would therefore need to see any
 side-effects from the rest of the mapfile, and/or run it through a
 debugger to see where it's failing.
 
 --
 thomas
 
 On 21 August 2013 01:26, Peter Freimuth freimut...@gmail.com wrote:
 Hi,
 i am trying to get the dynamic variable substitution work on Mapserver
 6.3dev but somehow it does'nt work as it worked before and as documented.
 When i execute
 http://10.10.4.18/cgi-bin/LI_USA-MT.cgi?SERVICE=WMSVERSION=1.3.0REQUEST=GetMapBBOX=48.046271,-115.929840,48.198407,-115.666914CRS=EPSG:4326WIDTH=1647HEIGHT=953LAYERS=data_viewSTYLES=FORMAT=image/pngDPI=96TRANSPARENT=TRUESTARTDATE=2011-01-01ENDDATE=2013-09-01
 
 or
 
 http://10.10.4.18/cgi-bin/LI_USA-MT.cgi?SERVICE=WMSVERSION=1.3.0REQUEST=GetMapBBOX=48.046271,-115.929840,48.198407,-115.666914CRS=EPSG:4326WIDTH=1647HEIGHT=953LAYERS=data_viewSTYLES=FORMAT=image/pngDPI=96TRANSPARENT=TRUE
 
 I get an error in
 msDrawMap(): Image handling error. Failed to draw layer named 'data_view'.
 msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:
 invalid input syntax for type date: %STARTDATE%
 LINE 8: ... (((acquisition_date = date_trunc('day',date '%STARTDAT...
 ^
 So the substitution does not happen or the default is not applied.
 Any hint on what i am doing wrong would be great.
 
 See below the components from the mapfile:
 
 MAP
 .
#
# Start of web interface definition
#
DATAPATTERN '^[a-zA-Z0-9\-\_\,]+$'
 
WEB
IMAGEPATH /mnt/mapserver/mapserver_wms/geocloud_config/image_path
METADATA
.
'PRODUCTID_validation_pattern'  '^[a-zA-Z0-9\-\_\,]+$'
'default_PRODUCTID'  '1234567'
'CONTRACTIDS_validation_pattern'  '^[a-zA-Z0-9\-\_\,]+$'
'default_CONTRACT_IDS'  ''
'STARTDATE_validation_pattern'
 '^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
'default_STARTDATE'  '2011-01-01'
'ENDDATE_validation_pattern'
 '^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
'default_END_DATE'  '2013-09-01'
END
VALIDATION
 'PRODUCTID'  '^[a-zA-Z0-9\-\_\,]+$'
 'CONTRACTIDS' '^[a-zA-Z0-9\-\_\,]+$'
 'STARTDATE'  '^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
 'ENDDATE'  '^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
END
END
 .
LAYER
# this is the tileindex that aggregates the single image products
 together and makes them accessible for the RASTER LAYER data_view and
 data_raw for rendering
NAME data_idx
STATUS ON
DEBUG 5
UNITS dd
TYPE POLYGON
EXTENT -116.364631680367 44.1932837062986 -103.698350095065
 49.1892799088128
PROCESSING CLOSE_CONNECTION=DEFER
CONNECTIONTYPE POSTGIS
CONNECTION user=* password=* dbname=* host='*'
 port=5432
DATA wkb_geom FROM (SELECT t1.* FROM (SELECT re3aip.cat_id as
 archived_in_archiving_identifier, ico.image_id, ico.acquisition_date,
 re3aip.tile_id,
 ico.product_provider_image_identifier, re3aip.ohs_order_id,
 re3aip.imagetake_cat_id, ico.epsg_code,
 re3aip.ohs_contract_id,  ico.service_name,
 ico.footprint_poly::geometry as wkb_geom, ico.image_location,
 ico.vrt_location
 FROM ows.imagepool_catalogue_ows ico
 JOIN ows.re_l3a_imagepool re3aip ON (re3aip.image_id=ico.image_id)
 WHERE ico.service_name in ('LI_USA-MT') AND
 (((acquisition_date = date_trunc('day',date '%STARTDATE%') AND
 acquisition_date  date_trunc('day',date '%ENDDATE%') + interval '1 day')))
 AND
 re3aip.ohs_contract_id in ('%CONTRACTID%')
 ) t1
 LEFT OUTER JOIN
 (SELECT ico.image_id, ico.acquisition_date, re3aip.tile_id
 FROM ows.imagepool_catalogue_ows ico
 JOIN ows.re_l3a_imagepool re3aip ON (re3aip.image_id=ico.image_id)
 WHERE ico.service_name in ('LI_USA-MT') AND
(((acquisition_date = date_trunc('day',date
 '%STARTDATE%') AND
 acquisition_date  date_trunc('day',date '%ENDDATE%') + interval '1 day')))
 AND
 re3aip.ohs_contract_id in ('%CONTRACTID%')
   ) t2

Re: [mapserver-users] cgi variable substituition in DATA statement

2013-08-21 Thread Peter Freimuth

Hi Thomas,
thanks for the hints. I compiled 6.4beta2 this morning and applied the 
proposed changes but the behaviour keeps the same.

The substitution is just not done.
I changed the  VALIDATION block on map and layer level to below and also 
using now DATAPATTERN '.*' on map level.

   VALIDATION
#'PRODUCTID' '^[a-zA-Z0-9\-\_\,]+$'
#'CONTRACTIDS' '^[a-zA-Z0-9\-\_\,]+$'
#'STARTDATE' '^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
#'ENDDATE' '^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
'PRODUCTID' '.*'
'CONTRACTIDS' '.*'
'STARTDATE' '.*'
'ENDDATE' '.*'
'default_PRODUCTID' '1234567'
'default_CONTRACTIDS' 'GDNAMLI-USA-MT'
'default_STARTDATE' '2011-01-01'
'default_ENDDATE' '2013-09-01'
   END
It seems that the mechanismn is not working at all and i cannot find 
anything in the logs even with debug level 5.

Any further idea?
Thanks,
Peter

On 20/08/2013 5:35 PM, thomas bonfort wrote:

try setting your VALIDATIONs to '.*' to see if your problem lies in
your regex or elsewhere. For 6.3/4 You can also remove your
xxx_validation_pattern metadata entries, and should move the
default_xxx ones into the VALIDATION block.

--
thomas

On 21 August 2013 01:26, Peter Freimuth freimut...@gmail.com wrote:

Hi,
i am trying to get the dynamic variable substitution work on Mapserver
6.3dev but somehow it does'nt work as it worked before and as documented.
When i execute
http://10.10.4.18/cgi-bin/LI_USA-MT.cgi?SERVICE=WMSVERSION=1.3.0REQUEST=GetMapBBOX=48.046271,-115.929840,48.198407,-115.666914CRS=EPSG:4326WIDTH=1647HEIGHT=953LAYERS=data_viewSTYLES=FORMAT=image/pngDPI=96TRANSPARENT=TRUESTARTDATE=2011-01-01ENDDATE=2013-09-01

or

http://10.10.4.18/cgi-bin/LI_USA-MT.cgi?SERVICE=WMSVERSION=1.3.0REQUEST=GetMapBBOX=48.046271,-115.929840,48.198407,-115.666914CRS=EPSG:4326WIDTH=1647HEIGHT=953LAYERS=data_viewSTYLES=FORMAT=image/pngDPI=96TRANSPARENT=TRUE

I get an error in
  msDrawMap(): Image handling error. Failed to draw layer named 'data_view'.
msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:
invalid input syntax for type date: %STARTDATE%
LINE 8: ... (((acquisition_date = date_trunc('day',date '%STARTDAT...
  ^
So the substitution does not happen or the default is not applied.
Any hint on what i am doing wrong would be great.

See below the components from the mapfile:

MAP
.
 #
 # Start of web interface definition
 #
 DATAPATTERN '^[a-zA-Z0-9\-\_\,]+$'

 WEB
 IMAGEPATH /mnt/mapserver/mapserver_wms/geocloud_config/image_path
 METADATA
 .
 'PRODUCTID_validation_pattern'  '^[a-zA-Z0-9\-\_\,]+$'
 'default_PRODUCTID'  '1234567'
 'CONTRACTIDS_validation_pattern'  '^[a-zA-Z0-9\-\_\,]+$'
 'default_CONTRACT_IDS'  ''
 'STARTDATE_validation_pattern'
'^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
 'default_STARTDATE'  '2011-01-01'
 'ENDDATE_validation_pattern'
'^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
 'default_END_DATE'  '2013-09-01'
 END
 VALIDATION
  'PRODUCTID'  '^[a-zA-Z0-9\-\_\,]+$'
  'CONTRACTIDS' '^[a-zA-Z0-9\-\_\,]+$'
  'STARTDATE'  '^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
  'ENDDATE'  '^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
 END
 END
.
 LAYER
 # this is the tileindex that aggregates the single image products
together and makes them accessible for the RASTER LAYER data_view and
data_raw for rendering
 NAME data_idx
 STATUS ON
 DEBUG 5
 UNITS dd
 TYPE POLYGON
 EXTENT -116.364631680367 44.1932837062986 -103.698350095065
49.1892799088128
 PROCESSING CLOSE_CONNECTION=DEFER
 CONNECTIONTYPE POSTGIS
 CONNECTION user=* password=* dbname=* host='*'
port=5432
 DATA wkb_geom FROM (SELECT t1.* FROM (SELECT re3aip.cat_id as
archived_in_archiving_identifier, ico.image_id, ico.acquisition_date,
re3aip.tile_id,
ico.product_provider_image_identifier, re3aip.ohs_order_id,
re3aip.imagetake_cat_id, ico.epsg_code,
re3aip.ohs_contract_id,  ico.service_name,
ico.footprint_poly::geometry as wkb_geom, ico.image_location,
ico.vrt_location
FROM ows.imagepool_catalogue_ows ico
JOIN ows.re_l3a_imagepool re3aip ON (re3aip.image_id=ico.image_id)
WHERE ico.service_name in ('LI_USA-MT') AND
(((acquisition_date = date_trunc('day',date '%STARTDATE%') AND
acquisition_date  date_trunc('day',date '%ENDDATE%') + interval '1 day')))
AND
re3aip.ohs_contract_id in ('%CONTRACTID%')
) t1
LEFT OUTER JOIN
(SELECT ico.image_id, ico.acquisition_date, re3aip.tile_id
FROM ows.imagepool_catalogue_ows ico
JOIN ows.re_l3a_imagepool re3aip ON (re3aip.image_id=ico.image_id)
WHERE ico.service_name in ('LI_USA-MT') AND
 (((acquisition_date = date_trunc('day',date
'%STARTDATE

[mapserver-users] cgi variable substituition in DATA statement

2013-08-20 Thread Peter Freimuth

Hi,
i am trying to get the dynamic variable substitution work on Mapserver 
6.3dev but somehow it does'nt work as it worked before and as documented.

When i execute
http://10.10.4.18/cgi-bin/LI_USA-MT.cgi?SERVICE=WMSVERSION=1.3.0REQUEST=GetMapBBOX=48.046271,-115.929840,48.198407,-115.666914CRS=EPSG:4326WIDTH=1647HEIGHT=953LAYERS=data_viewSTYLES=FORMAT=image/pngDPI=96TRANSPARENT=TRUESTARTDATE=2011-01-01ENDDATE=2013-09-01

or

http://10.10.4.18/cgi-bin/LI_USA-MT.cgi?SERVICE=WMSVERSION=1.3.0REQUEST=GetMapBBOX=48.046271,-115.929840,48.198407,-115.666914CRS=EPSG:4326WIDTH=1647HEIGHT=953LAYERS=data_viewSTYLES=FORMAT=image/pngDPI=96TRANSPARENT=TRUE

I get an error in
 msDrawMap(): Image handling error. Failed to draw layer named 'data_view'.
msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:  
invalid input syntax for type date: %STARTDATE%

LINE 8: ... (((acquisition_date = date_trunc('day',date '%STARTDAT...
 ^
So the substitution does not happen or the default is not applied.
Any hint on what i am doing wrong would be great.

See below the components from the mapfile:

MAP
.
#
# Start of web interface definition
#
DATAPATTERN '^[a-zA-Z0-9\-\_\,]+$'

WEB
IMAGEPATH /mnt/mapserver/mapserver_wms/geocloud_config/image_path
METADATA
.
'PRODUCTID_validation_pattern'  '^[a-zA-Z0-9\-\_\,]+$'
'default_PRODUCTID'  '1234567'
'CONTRACTIDS_validation_pattern'  '^[a-zA-Z0-9\-\_\,]+$'
'default_CONTRACT_IDS'  ''
'STARTDATE_validation_pattern' 
'^([0-9]{4})-([0-9]{2})-([0-9]{2})$'

'default_STARTDATE'  '2011-01-01'
'ENDDATE_validation_pattern' 
'^([0-9]{4})-([0-9]{2})-([0-9]{2})$'

'default_END_DATE'  '2013-09-01'
END
VALIDATION
 'PRODUCTID'  '^[a-zA-Z0-9\-\_\,]+$'
 'CONTRACTIDS' '^[a-zA-Z0-9\-\_\,]+$'
 'STARTDATE'  '^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
 'ENDDATE'  '^([0-9]{4})-([0-9]{2})-([0-9]{2})$'
END
END
.
LAYER
# this is the tileindex that aggregates the single image 
products together and makes them accessible for the RASTER LAYER 
data_view and data_raw for rendering

NAME data_idx
STATUS ON
DEBUG 5
UNITS dd
TYPE POLYGON
EXTENT -116.364631680367 44.1932837062986 -103.698350095065 
49.1892799088128

PROCESSING CLOSE_CONNECTION=DEFER
CONNECTIONTYPE POSTGIS
CONNECTION user=* password=* dbname=* host='*' 
port=5432
DATA wkb_geom FROM (SELECT t1.* FROM (SELECT re3aip.cat_id as 
archived_in_archiving_identifier, ico.image_id, ico.acquisition_date, 
re3aip.tile_id,
ico.product_provider_image_identifier, re3aip.ohs_order_id, 
re3aip.imagetake_cat_id, ico.epsg_code,

re3aip.ohs_contract_id,  ico.service_name,
ico.footprint_poly::geometry as wkb_geom, ico.image_location, 
ico.vrt_location

FROM ows.imagepool_catalogue_ows ico
JOIN ows.re_l3a_imagepool re3aip ON (re3aip.image_id=ico.image_id)
WHERE ico.service_name in ('LI_USA-MT') AND
(((acquisition_date = date_trunc('day',date '%STARTDATE%') AND
acquisition_date  date_trunc('day',date '%ENDDATE%') + interval '1 
day'))) AND

re3aip.ohs_contract_id in ('%CONTRACTID%')
) t1
LEFT OUTER JOIN
(SELECT ico.image_id, ico.acquisition_date, re3aip.tile_id
FROM ows.imagepool_catalogue_ows ico
JOIN ows.re_l3a_imagepool re3aip ON (re3aip.image_id=ico.image_id)
WHERE ico.service_name in ('LI_USA-MT') AND
(((acquisition_date = 
date_trunc('day',date '%STARTDATE%') AND
acquisition_date  date_trunc('day',date '%ENDDATE%') + interval '1 
day'))) AND

re3aip.ohs_contract_id in ('%CONTRACTID%')
   ) t2
  ON 
t1.tile_id = t2.tile_id AND

((t1.acquisition_date  t2.acquisition_date) OR
(t1.acquisition_date = t2.acquisition_date AND t1.image_id  t2.image_id))
WHERE t2.tile_id is NULL
ORDER BY t1.ohs_contract_id, t1.tile_id
) foo USING UNIQUE image_id 
USING SRID=4326

#FILTER ( '[product_provider_image_identifier]'='%PRODUCTID%')
PROJECTION
init=epsg:4326
END
METADATA
ows_title Data Index
ows_extent  -116.364631680367 44.1932837062986 
-103.698350095065 49.1892799088128

#'PRODUCTID_validation_pattern'  '^[a-zA-Z0-9\-\_\,]+$'
#'default_PRODUCTID'  '1234567'
'CONTRACTIDS_validation_pattern'  '^[a-zA-Z0-9\-\_\,]+$'
'default_CONTRACTIDS'  ''
'STARTDATE_validation_pattern' 
'^([0-9]{4})-([0-9]{2})-([0-9]{2})$'

'default_STARTDATE'  '2011-01-01'
'ENDDATE_validation_pattern' 
'^([0-9]{4})-([0-9]{2})-([0-9]{2})$'


[mapserver-users] wfs getfeature returns invalid xml when using gml_constants

2013-04-20 Thread Peter Freimuth
Hi Mapserver users,
maybe somebody can help me to get my WFS working:

!-- MapServer version 6.2.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ 
SUPPORTS=GD SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS 
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 --

ubuntu 12.04 LTS

This is the Layer definition from the map file:

LAYER
 ...
   METADATA
   wfs_title Image Catalog
   ows_extent  211500 2231500 261500 2281500
   wfs_srs EPSG:4326 EPSG:3857 EPSG:32615 EPSG:32616 EPSG:32617
   wfs_featureid id ## REQUIRED since 4.10
   gml_include_items all
   gml_exclude_items 
   wfs_enable_request  *
   wfs_getfeature_formatlist  GEOJSON,SHAPEZIP,CSV
   gml_constants dataaccessbaseurl,datapreviewbaseurl
   gml_dataaccessbaseurl_type Character
   gml_dataaccessbaseurl_value 
http://10.10.4.41/cgi-bin/test.cgi?SERVICE=WCSREQUEST=GetCoverageIDENTIFIER=testdata_rawVERSION=1.1.0;
   gml_datapreviewbaseurl_type Character
   gml_datapreviewbaseurl_value 
http://10.10.4.41/cgi-bin/test.cgi?SERVICE=WMSREQUEST=GetMapLAYERS=testdata_viewVERSION=1.3.0;
   gml_types auto
   wfs_geomtype  Polygon
   END
  …
END

When i execute a GetFeature request Firefox shows the following error:

http://10.10.4.41/cgi-bin/PlenumWCS.cgi?SERVICE=WFSVERSION=1.1.0REQUEST=getfeatureTYPENAME=catalogMAXFEATURES=100

XML Parsing Error: not well-formed
Location: 
http://10.10.4.41/cgi-bin/test.cgi?SERVICE=WFSVERSION=1.1.0REQUEST=getfeatureTYPENAME=catalogMAXFEATURES=100
Line Number 35, Column 102: 
ms:dataaccessbaseurlhttp://10.10.4.41/cgi-bin/test.cgi?SERVICE=WCSREQUEST=GetCoverageIDENTIFIER=testdata_rawVERSION=1.1.0/ms:dataaccessbaseurl


The XML doc seems to be ok when i check the page source.

Any idea how this can be resolved. I would expect that the character field can 
handle also a url string.

Thanks for any hint to resolve the issue.
Kind regards,
Peter

-- 
Peter Freimuth 



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


Re: [mapserver-users] wfs getfeature returns invalid xml when using gml_constants

2013-04-20 Thread Peter Freimuth
Hi Thomas,
thanks for the hint. Actually this solved the problem. 
Kind regards,
Peter


On 2013-04-20, at 5:28 AM, Thomas Gratier osgeo.mailingl...@gmail.com wrote:

 Hello,
 
 Only a clue but because it's  XML, you have to escape your ampersands: so  
 become amp;
 and for a full example
 
  
 http://10.10.4.41/cgi-bin/test.cgi?SERVICE=WCSREQUEST=GetCoverageIDENTIFIER=testdata_rawVERSION=1.1.0;
 become
  
 http://10.10.4.41/cgi-bin/test.cgi?SERVICE=WCSamp;REQUEST=GetCoverageamp;IDENTIFIER=testdata_rawamp;VERSION=1.1.0;
 
 You can also try replacing  with hexadecimal notation #038;
 
 Regards
 
 Thomas Gratier

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


[mapserver-users] wfs getfeature returns invalid xml when using gml_constants

2013-04-19 Thread Peter Freimuth
Hi Mapserver users,
maybe somebody can help me to get my WFS working:

!-- MapServer version 6.2.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ 
SUPPORTS=GD SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS 
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 --

ubuntu 12.04 LTS

This is the Layer definition from the map file:

LAYER
 ...
   METADATA
   wfs_title Image Catalog
   ows_extent  211500 2231500 261500 2281500
   wfs_srs EPSG:4326 EPSG:3857 EPSG:32615 EPSG:32616 EPSG:32617
   wfs_featureid id ## REQUIRED since 4.10
   gml_include_items all
   gml_exclude_items 
   wfs_enable_request  *
   wfs_getfeature_formatlist  GEOJSON,SHAPEZIP,CSV
   gml_constants dataaccessbaseurl,datapreviewbaseurl
   gml_dataaccessbaseurl_type Character
   gml_dataaccessbaseurl_value 
http://10.10.4.41/cgi-bin/test.cgi?SERVICE=WCSREQUEST=GetCoverageIDENTIFIER=testdata_rawVERSION=1.1.0;
   gml_datapreviewbaseurl_type Character
   gml_datapreviewbaseurl_value 
http://10.10.4.41/cgi-bin/test.cgi?SERVICE=WMSREQUEST=GetMapLAYERS=testdata_viewVERSION=1.3.0;
   gml_types auto
   wfs_geomtype  Polygon
   END
  …
END

When i execute a GetFeature request Firefox shows the following error:

http://10.10.4.41/cgi-bin/PlenumWCS.cgi?SERVICE=WFSVERSION=1.1.0REQUEST=getfeatureTYPENAME=catalogMAXFEATURES=100

XML Parsing Error: not well-formed
Location: 
http://10.10.4.41/cgi-bin/test.cgi?SERVICE=WFSVERSION=1.1.0REQUEST=getfeatureTYPENAME=catalogMAXFEATURES=100
Line Number 35, Column 102: 
ms:dataaccessbaseurlhttp://10.10.4.41/cgi-bin/test.cgi?SERVICE=WCSREQUEST=GetCoverageIDENTIFIER=testdata_rawVERSION=1.1.0/ms:dataaccessbaseurl


The XML doc seems to be ok when i check the page source.

Any idea how this can be resolved. I would expect that the character field can 
handle also a url string.

Thanks for any hint to resolve the issue.
Kind regards,
Peter

-- 
Peter Freimuth 

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


[mapserver-users] experience with jp2000 libraries

2012-03-10 Thread Peter Freimuth
Hi Mapserver Community,
i have to evaluate the different options for using JP2000 with mapserver
6.x. I have to create a fast WMS that streams 350-400GB of RGB satellite
data (~1000 350MB uncompressed GeoTiffs images) and for this i have to
evaluate options to reduce the filesize on the storage system to
minimize the IO for mapserver to read the data from the storage system.
JP2000 seems to be a good option but i would like to know if it makes
sense to purchase a Kakadu license or if the JasPer based solutions
offers similar results. LZW is somehow not working. Files are getting
bigger than in uncompressed mode. Any idea why this happens?
Any info is highly appreciated!!

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


[mapserver-users] which jp2000 is the best for rgb images

2012-03-01 Thread Peter Freimuth
Hi Mapserver Community,
which jp2000 lib is the best (good compression and fast when decoded)
when used by gdal / mapserver to stream rgb satellite data via a WMS. I
have 16TB of satellite data that shall go into a fast WMS. JP2000 seems
to be an interesting format to store the data on the storage system.

Kind regards,
Peter

-- 

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


Re: [mapserver-users] [Fwd: mapserver - postgis bug]

2009-10-13 Thread Peter Freimuth
P Kishor schrieb:
 On Mon, Oct 12, 2009 at 3:00 PM, Peter Freimuth pfreim...@arcor.de wrote:
   
 
My Mapserver Configuration
 owsu...@map2:~ /srv/www/cgi-bin/mapserv -v
 MapServer version 5.4.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
 OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV 
 SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER 
 SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=THREADS 
 SUPPORTS=GEOS INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=MYGIS INPUT=SHAPEFILE

 
The Mapfile with the 4 WMS-Time layer
 MAP
 ...

 #---
# Index and Raster Layer for all requested service_products
# duplicate the template below and modify the Product Shortname in the 
 sql query and rename the layer itself

 #---
LAYER
NAME service_product_gc_idx
STATUS OFF
#DEBUG ON
TYPE POLYGON
PROCESSING CLOSE_CONNECTION=DEFER
CONNECTIONTYPE POSTGIS
CONNECTION user=ows_user password=xxx dbname=ows_customer_nnn 
 host=db2 port=5432
DATA wkb_geom FROM (SELECT * FROM 
 ows_customer.tileindex_service_products tsp JOIN ows_customer.analysis_units 
 au ON (au.unit_id=tsp.unit_id) JOIN ows_customer.service_product_types spt 
 ON (tsp.product_type_id=spt.product_type_id) WHERE spt.name = 'GC' ) foo 
 USING UNIQUE service_product_id USING SRID=3785
PROJECTION
init=epsg:3785
END
METADATA
ows_title service_product_gc_idx
wms_srs   EPSG:3785 EPSG:4269 EPSG:4326 EPSG:32610 EPSG:32611 
 EPSG:32612 EPSG:32613 EPSG:32614 EPSG:26710 EPSG:26711 EPSG:26712 EPSG:26713 
 EPSG:26714 EPSG:900913 #output
#ows_extent 38 523 53 539
END
END
# Raster Layer
LAYER
NAME serv_prod_gc20090415
#GROUP service_products
TYPE RASTER
STATUS ON
#DEBUG ON
#TRANSPARENCY 70
OFFSITE 255 255 255
TILEITEM location_path #location_path is a column in above 
 referenced POSTGIS table tileindex_service_products that stores the 
 filepath to each image
TILEINDEX service_product_gc_idx
PROJECTION
init=epsg:3785
END
METADATA
ows_title Groundcover Map - April 2009
#ows_group_title Service Products WS 2009
wms_srs   EPSG:3785 EPSG:4269 EPSG:4326 EPSG:32610 EPSG:32611 
 EPSG:32612 EPSG:32613 EPSG:32614 EPSG:26710 EPSG:26711 EPSG:26712 EPSG:26713 
 EPSG:26714 EPSG:900913 #output
#ows_extent 38 523 53 539
ows_timeextent 2009-04-15/2009-12-15
ows_timeitem product_date #yearmoda is our date column in 
 shape of type date
ows_timedefault 2009-04-15
END
CLASS
NAME GCMap
KEYIMAGE /srv/www/htdocs/nnn/GroundCover.png
END
END
LAYER
NAME serv_prod_gc20090515
#GROUP service_products
TYPE RASTER
STATUS ON
#DEBUG ON
#TRANSPARENCY 70
OFFSITE 255 255 255
TILEITEM location_path #location_path is a column in above 
 referenced POSTGIS table tileindex_service_products that stores the 
 filepath to each image
TILEINDEX service_product_gc_idx
PROJECTION
init=epsg:3785
END
METADATA
ows_title Groundcover Map - May 2009
wms_srs   EPSG:3785 EPSG:4269 EPSG:4326 EPSG:32610 EPSG:32611 
 EPSG:32612 EPSG:32613 EPSG:32614 EPSG:26710 EPSG:26711 EPSG:26712 EPSG:26713 
 EPSG:26714 EPSG:900913 #output
#ows_extent 38 523 53 539
ows_timeextent 2009-04-15/2009-12-15
ows_timeitem product_date #yearmoda is our date column in 
 shape of type date
ows_timedefault 2009-05-15
END
CLASS
NAME GCMap
KEYIMAGE /srv/www/htdocs/nnn/GroundCover.png
END
END
LAYER
NAME serv_prod_gc20090615
#GROUP service_products
TYPE RASTER
STATUS ON
#DEBUG ON
#TRANSPARENCY 70
OFFSITE 255 255 255
TILEITEM location_path #location_path is a column in above 
 referenced POSTGIS table tileindex_service_products that stores the 
 filepath to each image
TILEINDEX service_product_gc_idx
PROJECTION
init=epsg:3785
END
METADATA
ows_title Groundcover Map - June 2009
wms_srs   EPSG:3785 EPSG:4269 EPSG:4326 EPSG:32610 EPSG:32611 
 EPSG:32612 EPSG:32613 EPSG:32614 EPSG:26710 EPSG:26711 EPSG:26712 EPSG:26713 
 EPSG:26714 EPSG:900913 #output
#ows_extent 38 523 53 539
ows_timeextent 2009-04

[mapserver-users] [Fwd: mapserver - postgis bug]

2009-10-12 Thread Peter Freimuth

-- 
Peter Freimuth  Muskauer Str. 11   10997 Berlin
Location:http://www.berlinonline.de/citymap/map.asp?start.x=5plz=10997str=Muskauer+Str.+11grid=dedatlas10

Tel:+49(0)30-69816610  Mobil:+49(0)175-8434074  Firma:+49(0)3381-8904327

mailto:pfreim...@arcor.de  
skype:pfreimuth
msn:peter_freim...@hotmail.com

---BeginMessage---
owsu...@map2:~ /srv/www/cgi-bin/mapserv -v
MapServer version 5.4.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV 
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT 
SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=THREADS SUPPORTS=GEOS 
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=MYGIS INPUT=SHAPEFILE

MAP
...

#---
# Index and Raster Layer for all requested service_products
# duplicate the template below and modify the Product Shortname in the sql 
query and rename the layer itself

#---
LAYER
NAME service_product_gc_idx
STATUS OFF
#DEBUG ON
TYPE POLYGON
PROCESSING CLOSE_CONNECTION=DEFER
CONNECTIONTYPE POSTGIS  
CONNECTION user=ows_user password=xxx dbname=ows_customer_nnn host=db2 
port=5432
DATA wkb_geom FROM (SELECT * FROM 
ows_customer.tileindex_service_products tsp JOIN ows_customer.analysis_units au 
ON (au.unit_id=tsp.unit_id) JOIN ows_customer.service_product_types spt ON 
(tsp.product_type_id=spt.product_type_id) WHERE spt.name = 'GC' ) foo USING 
UNIQUE service_product_id USING SRID=3785
PROJECTION
init=epsg:3785
END
METADATA
ows_title service_product_gc_idx
wms_srs   EPSG:3785 EPSG:4269 EPSG:4326 EPSG:32610 EPSG:32611 
EPSG:32612 EPSG:32613 EPSG:32614 EPSG:26710 EPSG:26711 EPSG:26712 EPSG:26713 
EPSG:26714 EPSG:900913 #output
#ows_extent 38 523 53 539
END
END
# Raster Layer
LAYER
NAME serv_prod_gc20090415
#GROUP service_products
TYPE RASTER
STATUS ON
#DEBUG ON
#TRANSPARENCY 70
OFFSITE 255 255 255
TILEITEM location_path #location_path is a column in above referenced 
POSTGIS table tileindex_service_products that stores the filepath to each 
image
TILEINDEX service_product_gc_idx 
PROJECTION
init=epsg:3785
END
METADATA
ows_title Groundcover Map - April 2009
#ows_group_title Service Products WS 2009
wms_srs   EPSG:3785 EPSG:4269 EPSG:4326 EPSG:32610 EPSG:32611 
EPSG:32612 EPSG:32613 EPSG:32614 EPSG:26710 EPSG:26711 EPSG:26712 EPSG:26713 
EPSG:26714 EPSG:900913 #output
#ows_extent 38 523 53 539
ows_timeextent 2009-04-15/2009-12-15
ows_timeitem product_date #yearmoda is our date column in shape 
of type date
ows_timedefault 2009-04-15
END
CLASS
NAME GCMap
KEYIMAGE /srv/www/htdocs/nnn/GroundCover.png
END
END
LAYER
NAME serv_prod_gc20090515
#GROUP service_products
TYPE RASTER
STATUS ON
#DEBUG ON
#TRANSPARENCY 70
OFFSITE 255 255 255
TILEITEM location_path #location_path is a column in above referenced 
POSTGIS table tileindex_service_products that stores the filepath to each 
image
TILEINDEX service_product_gc_idx 
PROJECTION
init=epsg:3785
END
METADATA
ows_title Groundcover Map - May 2009
wms_srs   EPSG:3785 EPSG:4269 EPSG:4326 EPSG:32610 EPSG:32611 
EPSG:32612 EPSG:32613 EPSG:32614 EPSG:26710 EPSG:26711 EPSG:26712 EPSG:26713 
EPSG:26714 EPSG:900913 #output
#ows_extent 38 523 53 539
ows_timeextent 2009-04-15/2009-12-15
ows_timeitem product_date #yearmoda is our date column in shape 
of type date
ows_timedefault 2009-05-15
END
CLASS
NAME GCMap
KEYIMAGE /srv/www/htdocs/nnn/GroundCover.png
END
END
LAYER
NAME serv_prod_gc20090615
#GROUP service_products
TYPE RASTER
STATUS ON
#DEBUG ON
#TRANSPARENCY 70
OFFSITE 255 255 255
TILEITEM location_path #location_path is a column in above referenced 
POSTGIS table tileindex_service_products that stores the filepath to each 
image
TILEINDEX service_product_gc_idx 
PROJECTION
init=epsg:3785
END