From gamejihou at hotmail.com Sat Jan 3 06:08:57 2015 From: gamejihou at hotmail.com (Gery .) Date: Sat, 3 Jan 2015 09:08:57 -0500 Subject: [mapserver-users] compiling error core.c in mapcache with cygwin References: Message-ID: Hello, When installing mapcache in cygwin, `make` produced: /opt/mapcache/mapcache-rel-1-2-1/lib/core.c: In function ?mapcache_prefetch_tiles?: /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:81:3: error: unknown type name ?apr_thread_t? apr_thread_t **threads; ^ /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:82:3: error: unknown type name ?apr_threadattr_t? apr_threadattr_t *thread_attrs; ^ /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:83:7: warning: unused variable ?nthreads? [-Wunused-variable] int nthreads; ^ /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:82:21: warning: unused variable ?thread_attrs? [-Wunused-variable] apr_threadattr_t *thread_attrs; ^ /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:81:18: warning: unused variable ?threads? [-Wunused-variable] apr_thread_t **threads; ^ I searched for some hints about this error but didn't find anything. Looking for `apr_thread_t` and cygwin, I found some pages pointing to an error with apache, but not really sure if apache has something to do here. thanks for any hints on this, Gery From andy at squeakycode.net Sat Jan 3 06:57:49 2015 From: andy at squeakycode.net (Andy Colson) Date: Sat, 03 Jan 2015 08:57:49 -0600 Subject: [mapserver-users] compiling error core.c in mapcache with cygwin In-Reply-To: References: Message-ID: <54A8036D.6090609@squeakycode.net> On 01/03/2015 08:08 AM, Gery . wrote: > Hello, > > When installing mapcache in cygwin, `make` produced: > > /opt/mapcache/mapcache-rel-1-2-1/lib/core.c: In function ?mapcache_prefetch_tiles?: > /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:81:3: error: unknown type name ?apr_thread_t? > apr_thread_t **threads; > ^ > /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:82:3: error: unknown type name ?apr_threadattr_t? > apr_threadattr_t *thread_attrs; > ^ > /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:83:7: warning: unused variable ?nthreads? [-Wunused-variable] > int nthreads; > ^ > /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:82:21: warning: unused variable ?thread_attrs? [-Wunused-variable] > apr_threadattr_t *thread_attrs; > ^ > /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:81:18: warning: unused variable ?threads? [-Wunused-variable] > apr_thread_t **threads; > ^ > > I searched for some hints about this error but didn't find anything. Looking for `apr_thread_t` and cygwin, I found some pages pointing to an error with apache, but not really sure if apache has something to do here. > > thanks for any hints on this, > > Gery You need the Apache Portable Runtime library. Its a generic lib, not the webserver. This gives an overview of all the area's it covers: http://apr.apache.org/docs/apr/1.4/modules.html -Andy From bob.basques at ci.stpaul.mn.us Mon Jan 5 08:55:41 2015 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Mon, 5 Jan 2015 16:55:41 +0000 Subject: [mapserver-users] ColorRange Legends. Message-ID: All, Is there any progress on generating a legend icon for color ranges? I'm using colorrange to color in a GPS trail based on age. I would like to generate a legend icon for the coloring. A bit of a complication is that I'm doing a double transistion, one class for green --> orange, and then a class for orange --> red. I could make two different legend items for these if need be though. I get the NAME value to pop out, but no Icon for the color values. Thanks Bobb -------------- next part -------------- An HTML attachment was scrubbed... URL: From woodbri at swoodbridge.com Mon Jan 5 15:36:01 2015 From: woodbri at swoodbridge.com (Stephen Woodbridge) Date: Mon, 05 Jan 2015 18:36:01 -0500 Subject: [mapserver-users] mapcache compile issue on cygwin posted on stackoverflow Message-ID: <54AB1FE1.4030109@swoodbridge.com> I saw this issue come up on stackoverflow: http://stackoverflow.com/questions/27755442/compiling-error-core-c-in-mapcache-with-cygwin/27760401 Anyone have any other ideas? -Steve W From mark.kelly228 at googlemail.com Tue Jan 6 04:10:23 2015 From: mark.kelly228 at googlemail.com (mark kellermann) Date: Tue, 6 Jan 2015 13:10:23 +0100 Subject: [mapserver-users] Beschriftung Objekte mit gleicher Lage In-Reply-To: References: <0eed7315b3894f08b64e23e68924c849@SRV-EX2013.Mittenwalde.local> <9fb8b9636c1849fc9299154117efaf10@SRV-EX2013.Mittenwalde.local> Message-ID: Hallo, ich m?chte Punkte (Schilder) beschriften mit Ihrer Nummer. An manchen Standorten (Masten) h?ngen teilweise vier Schilder. Wenn ich die Schilder Beschriftung erzwinge (FORCE TRUE), liegt die Beschriftung ?bereinander! Wie kann ich dies ?ndern, dass man die Beschriftung aller Punkte lesen kann? MfG Mark Kellermann -------------- next part -------------- An HTML attachment was scrubbed... URL: From jt at mapmedia.de Tue Jan 6 04:49:42 2015 From: jt at mapmedia.de (=?windows-1252?Q?J=F6rg_Thomsen?=) Date: Tue, 06 Jan 2015 13:49:42 +0100 Subject: [mapserver-users] Beschriftung Objekte mit gleicher Lage In-Reply-To: References: <0eed7315b3894f08b64e23e68924c849@SRV-EX2013.Mittenwalde.local> <9fb8b9636c1849fc9299154117efaf10@SRV-EX2013.Mittenwalde.local> Message-ID: <54ABD9E6.5050906@mapmedia.de> hello and a happy new year! here you can find a multilabel-example: http://mapserver.org/development/announce/6-2.html#complex-multi-label-symbol-symbology https://github.com/mapserver/msautotest/blob/branch-6-2/renderers/multilabel.map If you don't want a fixed position of the labels you can collect the attributes / labels in one text-line and use a wrap-character: CLASS NAME "blah" TEXT ([schild1]![schild12]![schild3]) LABEL WRAP "!" TYPE truetype FONT 'verdana' .... END END both will cause blank lines. To avoid them, my only idea is to use a view if your data is in a database. You'll have to use conidtions like SELECT schild1 || schild2 FROM (SELECT CASE WHEN schild1 NOT NULL THEN schild1 || "!" ELSE "" END AS schild1, CASE WHEN schild2 NOT NULL THEN schild2 || "!" ELSE "" END AS schild2 FROM table) J?rg Am 06.01.2015 um 13:10 schrieb mark kellermann: > > Hallo, > > ich m?chte Punkte (Schilder) beschriften mit Ihrer Nummer. > An manchen Standorten (Masten) h?ngen teilweise vier Schilder. > Wenn ich die Schilder Beschriftung erzwinge (FORCE TRUE), liegt die > Beschriftung ?bereinander! > > Wie kann ich dies ?ndern, dass man die Beschriftung aller Punkte lesen kann? > > MfG > Mark Kellermann > > > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > From bhudspeth at edac.unm.edu Tue Jan 6 06:58:31 2015 From: bhudspeth at edac.unm.edu (Bill Hudspeth) Date: Tue, 6 Jan 2015 07:58:31 -0700 (MST) Subject: [mapserver-users] Return pixel values from raster layers served by mapserver Message-ID: <2147079035.16668525.1420556311003.JavaMail.zimbra@edac.unm.edu> Hello, I previously wrote about this issue, but have not found a solution yet. I am running Mapserver 6.4.1, and am using Postgres/Postgis to display a time series of geotiff images. I would like to know the best way for a user to submit a given x,y coordinate pair and return the pixel value for a given image. Is this possible using only the mapserver api? or must I absolutely use mapscript? Currently, I use a PostgreSQL/PostGIS time-enabled table to store the information about the location of the geotiffs and the timestamp associated with them: pm25_monthly=# \d pm25_monthly_global Table "public.pm25_monthly_global" Column | Type | Modifiers ----------+-----------------------------+----------------------------------------------- oid | integer | default nextval('pm25_monthly_seq'::regclass) rundate | timestamp with time zone | datetime | timestamp with time zone | location | text | timezone | timestamp without time zone | the_geom | geometry(MultiPolygon,4326) | Indexes: "pm25_monthly_global_oid_key" UNIQUE CONSTRAINT, btree (oid) The 'location' field simply gives the full path to the relevant geotiff on the file system. And, I define the index in the mapfile: #**********LAYER - TILE INDEX FOR PM2.5 RASTERS (Time sensitive)**** LAYER STATUS ON NAME "pm25_time_index" TYPE POLYGON DATA "the_geom from pm25_monthly_global using unique oid using SRID=4326" METADATA "ows_title" "PM25 TIME INDEX" "ows_srs" "EPSG:4326" "ows_extent" "-180 -90 180 90" #[minx][miny][maxx][maxy] "wms_timeformat" "YYYY-MM-DDTHH:MM:SS" "wms_timeextent" "2011-01-01T00:00:00/2012-12-01T00:00:00" "wms_timeitem" "timezone" "wms_timedefault" "2011-01-01T00:00:00" wcs_resolution '0:10 0:10' END #CONNECTION "user=wilbur dbname=pm25_monthly host=localhost password=iiiiiiiiii" #CONNECTIONTYPE postgis CONNECTIONTYPE POSTGIS CONNECTION "host=127.0.0.1 dbname=pm25_monthly user=wilbur password=EUR2_live port=5432" DATA "the_geom from pm25_monthly_global using unique oid using srid=4326" END #*******LAYER - MONTHLY PM2.5 (Time Sensitive)********************************* LAYER NAME 'pm25_monthly' TYPE RASTER STATUS ON DEBUG OFF DUMP TRUE #TRANSPARENCY 50 #FILTER "" METADATA "ows_keywordlist" 'PM2.5 (ug/m3), Global' #wms_keywordlist (Keywordlist) "ows_description" "Global monthly mean PM 2.5 (ug/m3)concentration" "ows_name" "Global monthly mean PM2.5 - Concentration Values (ug/m3)" "ows_label" "Global PM 2.5 (ug/m3)" "ows_srs" "EPSG:4326 EPSG:900913" "ows_extent" "-180 -90 180 90" #[minx][miny][maxx][maxy] "ows_formats" "GEOTIFF" "ows_nativeformat" "8-bit GeoTIF" "ows_timeitem" "timezone" "wms_onlineresource" "http://localhost/cgi-bin/mapserv?map=/var/www/pm25_mapserver/public_html/pm25_ogc_services.map" "wms_abstract" 'Global monthly mean PM 2.5 (ug/m3)concentration' #wms_abstract(Abstract) "wms_opaque" '0' #wms_opaque(layer) "wms_title" "Global monthly mean PM 2.5 (ug/m3)concentration" "ows_timeformat" "YYYY-MM-DDTHH:MM:SSZ" "ows_timeextent" "2011-01-01T00:00:00Z/2012-12-01T00:00:00Z" "ows_timedefault" "2011-01-01T00:00:00Z" "wms_enable_request" "*" "wcs_resolution" "0:10 0:10" "wcs_bandcount" "1" "wcs_size" "3600 1800" layer_name pm25_monthly END #METADATA PROJECTION "init=epsg:4326" #WGS84 Decimal Degrees END #PROJECTION TILEITEM "location" TILEINDEX "pm25_time_index" END #LAYER Thanks From Steve.Lime at state.mn.us Tue Jan 6 07:44:38 2015 From: Steve.Lime at state.mn.us (Lime, Steve D (MNIT)) Date: Tue, 6 Jan 2015 15:44:38 +0000 Subject: [mapserver-users] Return pixel values from raster layers served by mapserver In-Reply-To: <2147079035.16668525.1420556311003.JavaMail.zimbra@edac.unm.edu> References: <2147079035.16668525.1420556311003.JavaMail.zimbra@edac.unm.edu> Message-ID: Ok, so this just a PostGIS-based tiled layer to access GeoTIFF's. You should just be able to do a normal MapServer query. e.g. http://your.server/cgi-bin/mapserv?map=your.map&mapxy=x+y&qlayer=pm25_monthly&mode=query You'd need to set a TEMPLATE for the pm25_monthly layer. Have you tried that? WMS should work then too but it's simpler to debug using a basic MapServer query. Steve -----Original Message----- From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Bill Hudspeth Sent: Tuesday, January 06, 2015 8:59 AM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Return pixel values from raster layers served by mapserver Hello, I previously wrote about this issue, but have not found a solution yet. I am running Mapserver 6.4.1, and am using Postgres/Postgis to display a time series of geotiff images. I would like to know the best way for a user to submit a given x,y coordinate pair and return the pixel value for a given image. Is this possible using only the mapserver api? or must I absolutely use mapscript? Currently, I use a PostgreSQL/PostGIS time-enabled table to store the information about the location of the geotiffs and the timestamp associated with them: pm25_monthly=# \d pm25_monthly_global Table "public.pm25_monthly_global" Column | Type | Modifiers ----------+-----------------------------+------------------------------- ----------+-----------------------------+---------------- oid | integer | default nextval('pm25_monthly_seq'::regclass) rundate | timestamp with time zone | datetime | timestamp with time zone | location | text | timezone | timestamp without time zone | the_geom | geometry(MultiPolygon,4326) | Indexes: "pm25_monthly_global_oid_key" UNIQUE CONSTRAINT, btree (oid) The 'location' field simply gives the full path to the relevant geotiff on the file system. And, I define the index in the mapfile: #**********LAYER - TILE INDEX FOR PM2.5 RASTERS (Time sensitive)**** LAYER STATUS ON NAME "pm25_time_index" TYPE POLYGON DATA "the_geom from pm25_monthly_global using unique oid using SRID=4326" METADATA "ows_title" "PM25 TIME INDEX" "ows_srs" "EPSG:4326" "ows_extent" "-180 -90 180 90" #[minx][miny][maxx][maxy] "wms_timeformat" "YYYY-MM-DDTHH:MM:SS" "wms_timeextent" "2011-01-01T00:00:00/2012-12-01T00:00:00" "wms_timeitem" "timezone" "wms_timedefault" "2011-01-01T00:00:00" wcs_resolution '0:10 0:10' END #CONNECTION "user=wilbur dbname=pm25_monthly host=localhost password=iiiiiiiiii" #CONNECTIONTYPE postgis CONNECTIONTYPE POSTGIS CONNECTION "host=127.0.0.1 dbname=pm25_monthly user=wilbur password=EUR2_live port=5432" DATA "the_geom from pm25_monthly_global using unique oid using srid=4326" END #*******LAYER - MONTHLY PM2.5 (Time Sensitive)********************************* LAYER NAME 'pm25_monthly' TYPE RASTER STATUS ON DEBUG OFF DUMP TRUE #TRANSPARENCY 50 #FILTER "" METADATA "ows_keywordlist" 'PM2.5 (ug/m3), Global' #wms_keywordlist (Keywordlist) "ows_description" "Global monthly mean PM 2.5 (ug/m3)concentration" "ows_name" "Global monthly mean PM2.5 - Concentration Values (ug/m3)" "ows_label" "Global PM 2.5 (ug/m3)" "ows_srs" "EPSG:4326 EPSG:900913" "ows_extent" "-180 -90 180 90" #[minx][miny][maxx][maxy] "ows_formats" "GEOTIFF" "ows_nativeformat" "8-bit GeoTIF" "ows_timeitem" "timezone" "wms_onlineresource" "http://localhost/cgi-bin/mapserv?map=/var/www/pm25_mapserver/public_html/pm25_ogc_services.map" "wms_abstract" 'Global monthly mean PM 2.5 (ug/m3)concentration' #wms_abstract(Abstract) "wms_opaque" '0' #wms_opaque(layer) "wms_title" "Global monthly mean PM 2.5 (ug/m3)concentration" "ows_timeformat" "YYYY-MM-DDTHH:MM:SSZ" "ows_timeextent" "2011-01-01T00:00:00Z/2012-12-01T00:00:00Z" "ows_timedefault" "2011-01-01T00:00:00Z" "wms_enable_request" "*" "wcs_resolution" "0:10 0:10" "wcs_bandcount" "1" "wcs_size" "3600 1800" layer_name pm25_monthly END #METADATA PROJECTION "init=epsg:4326" #WGS84 Decimal Degrees END #PROJECTION TILEITEM "location" TILEINDEX "pm25_time_index" END #LAYER Thanks _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users From bhudspeth at edac.unm.edu Tue Jan 6 08:01:34 2015 From: bhudspeth at edac.unm.edu (William Hudspeth) Date: Tue, 06 Jan 2015 09:01:34 -0700 Subject: [mapserver-users] Return pixel values from raster layers served by mapserver In-Reply-To: References: <2147079035.16668525.1420556311003.JavaMail.zimbra@edac.unm.edu> Message-ID: <54AC06DE.7080802@edac.unm.edu> I have not yet tried a TEMPLATE....ideally, I am looking for a method to script a series of calls to mapserver to return a list of pixel values for a time series of rasters for a given geographic coordinate. In this case, imagine a time series of air pollution rasters where I want to collect a sequence of values for a given city or location. I want to be able to use these data points to build a time series graph....Any ideas would be appreciated... Thanks! On 01/06/2015 08:44 AM, Lime, Steve D (MNIT) wrote: > Ok, so this just a PostGIS-based tiled layer to access GeoTIFF's. You should just be able to do a normal MapServer query. > > e.g. http://your.server/cgi-bin/mapserv?map=your.map&mapxy=x+y&qlayer=pm25_monthly&mode=query > > You'd need to set a TEMPLATE for the pm25_monthly layer. Have you tried that? WMS should work then too but it's simpler to debug using a basic MapServer query. > > Steve > > -----Original Message----- > From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Bill Hudspeth > Sent: Tuesday, January 06, 2015 8:59 AM > To: mapserver-users at lists.osgeo.org > Subject: [mapserver-users] Return pixel values from raster layers served by mapserver > > Hello, > > I previously wrote about this issue, but have not found a solution yet. I am running Mapserver 6.4.1, and am using Postgres/Postgis to display a time series of geotiff images. I would like to know the best way for a user to submit a given x,y coordinate pair and return the pixel value for a given image. Is this possible using only the mapserver api? or must I absolutely use mapscript? > > Currently, I use a PostgreSQL/PostGIS time-enabled table to store the information about the location of the geotiffs and the timestamp associated with them: > > pm25_monthly=# \d pm25_monthly_global > > Table > "public.pm25_monthly_global" > > Column | Type | > Modifiers > > ----------+-----------------------------+------------------------------- > ----------+-----------------------------+---------------- > > oid | integer | default nextval('pm25_monthly_seq'::regclass) > rundate | timestamp with time zone | > datetime | timestamp with time zone | > location | text | > timezone | timestamp without time zone | > the_geom | geometry(MultiPolygon,4326) | > > Indexes: > "pm25_monthly_global_oid_key" > UNIQUE CONSTRAINT, btree (oid) > > The 'location' field simply gives the full path to the relevant geotiff on the file system. And, I define the index in the mapfile: > > #**********LAYER - TILE INDEX FOR PM2.5 RASTERS (Time sensitive)**** LAYER > STATUS ON > NAME "pm25_time_index" > TYPE POLYGON > DATA "the_geom from pm25_monthly_global using unique oid using SRID=4326" > METADATA > "ows_title" "PM25 TIME INDEX" > "ows_srs" "EPSG:4326" > "ows_extent" "-180 -90 180 90" #[minx][miny][maxx][maxy] > "wms_timeformat" "YYYY-MM-DDTHH:MM:SS" > "wms_timeextent" "2011-01-01T00:00:00/2012-12-01T00:00:00" > "wms_timeitem" "timezone" > "wms_timedefault" "2011-01-01T00:00:00" > wcs_resolution '0:10 0:10' > END > > #CONNECTION "user=wilbur dbname=pm25_monthly host=localhost password=iiiiiiiiii" > #CONNECTIONTYPE postgis > CONNECTIONTYPE POSTGIS > CONNECTION "host=127.0.0.1 dbname=pm25_monthly user=wilbur password=EUR2_live port=5432" > > DATA "the_geom from pm25_monthly_global using unique oid using srid=4326" > END > > #*******LAYER - MONTHLY PM2.5 (Time Sensitive)********************************* > > LAYER > NAME 'pm25_monthly' > TYPE RASTER > STATUS ON > DEBUG OFF > DUMP TRUE > #TRANSPARENCY 50 > #FILTER "" > > METADATA > "ows_keywordlist" 'PM2.5 (ug/m3), Global' #wms_keywordlist (Keywordlist) > "ows_description" "Global monthly mean PM 2.5 (ug/m3)concentration" > "ows_name" "Global monthly mean PM2.5 - Concentration Values (ug/m3)" > "ows_label" "Global PM 2.5 (ug/m3)" > "ows_srs" "EPSG:4326 EPSG:900913" > "ows_extent" "-180 -90 180 90" #[minx][miny][maxx][maxy] > "ows_formats" "GEOTIFF" > "ows_nativeformat" "8-bit GeoTIF" > "ows_timeitem" "timezone" > "wms_onlineresource" "http://localhost/cgi-bin/mapserv?map=/var/www/pm25_mapserver/public_html/pm25_ogc_services.map" > "wms_abstract" 'Global monthly mean PM 2.5 (ug/m3)concentration' #wms_abstract(Abstract) > "wms_opaque" '0' #wms_opaque(layer) > "wms_title" "Global monthly mean PM 2.5 (ug/m3)concentration" > "ows_timeformat" "YYYY-MM-DDTHH:MM:SSZ" > "ows_timeextent" "2011-01-01T00:00:00Z/2012-12-01T00:00:00Z" > "ows_timedefault" "2011-01-01T00:00:00Z" > "wms_enable_request" "*" > "wcs_resolution" "0:10 0:10" > "wcs_bandcount" "1" > "wcs_size" "3600 1800" > layer_name pm25_monthly > > END #METADATA > PROJECTION > "init=epsg:4326" #WGS84 Decimal Degrees > END #PROJECTION > > TILEITEM "location" > TILEINDEX "pm25_time_index" > > END #LAYER > > > > Thanks > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users From Steve.Lime at state.mn.us Tue Jan 6 08:37:51 2015 From: Steve.Lime at state.mn.us (Lime, Steve D (MNIT)) Date: Tue, 6 Jan 2015 16:37:51 +0000 Subject: [mapserver-users] Return pixel values from raster layers served by mapserver In-Reply-To: <54AC06DE.7080802@edac.unm.edu> References: <2147079035.16668525.1420556311003.JavaMail.zimbra@edac.unm.edu> <54AC06DE.7080802@edac.unm.edu> Message-ID: If you want to use one x/y to query multiple rasters, that should be doable in straight MapServer although I guess it depends on how things are organized. I don't know how things work from a query perspective if you use your tile index as just a spatial index and not a temporal index. I'd get the one layer version working then expand it - make sure the PG tileindex works as expected with a query. -----Original Message----- From: William Hudspeth [mailto:bhudspeth at edac.unm.edu] Sent: Tuesday, January 06, 2015 10:02 AM To: Lime, Steve D (MNIT); mapserver-users at lists.osgeo.org Subject: Re: [mapserver-users] Return pixel values from raster layers served by mapserver I have not yet tried a TEMPLATE....ideally, I am looking for a method to script a series of calls to mapserver to return a list of pixel values for a time series of rasters for a given geographic coordinate. In this case, imagine a time series of air pollution rasters where I want to collect a sequence of values for a given city or location. I want to be able to use these data points to build a time series graph....Any ideas would be appreciated... Thanks! On 01/06/2015 08:44 AM, Lime, Steve D (MNIT) wrote: > Ok, so this just a PostGIS-based tiled layer to access GeoTIFF's. You should just be able to do a normal MapServer query. > > e.g. > http://your.server/cgi-bin/mapserv?map=your.map&mapxy=x+y&qlayer=pm25_ > monthly&mode=query > > You'd need to set a TEMPLATE for the pm25_monthly layer. Have you tried that? WMS should work then too but it's simpler to debug using a basic MapServer query. > > Steve > > -----Original Message----- > From: mapserver-users-bounces at lists.osgeo.org > [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Bill > Hudspeth > Sent: Tuesday, January 06, 2015 8:59 AM > To: mapserver-users at lists.osgeo.org > Subject: [mapserver-users] Return pixel values from raster layers > served by mapserver > > Hello, > > I previously wrote about this issue, but have not found a solution yet. I am running Mapserver 6.4.1, and am using Postgres/Postgis to display a time series of geotiff images. I would like to know the best way for a user to submit a given x,y coordinate pair and return the pixel value for a given image. Is this possible using only the mapserver api? or must I absolutely use mapscript? > > Currently, I use a PostgreSQL/PostGIS time-enabled table to store the information about the location of the geotiffs and the timestamp associated with them: > > pm25_monthly=# \d pm25_monthly_global > > Table > "public.pm25_monthly_global" > > Column | Type | > Modifiers > > ----------+-----------------------------+----------------------------- > ----------+-----------------------------+-- > ----------+-----------------------------+---------------- > > oid | integer | default nextval('pm25_monthly_seq'::regclass) > rundate | timestamp with time zone | > datetime | timestamp with time zone | > location | text | > timezone | timestamp without time zone | > the_geom | geometry(MultiPolygon,4326) | > > Indexes: > "pm25_monthly_global_oid_key" > UNIQUE CONSTRAINT, btree (oid) > > The 'location' field simply gives the full path to the relevant geotiff on the file system. And, I define the index in the mapfile: > > #**********LAYER - TILE INDEX FOR PM2.5 RASTERS (Time sensitive)**** LAYER > STATUS ON > NAME "pm25_time_index" > TYPE POLYGON > DATA "the_geom from pm25_monthly_global using unique oid using SRID=4326" > METADATA > "ows_title" "PM25 TIME INDEX" > "ows_srs" "EPSG:4326" > "ows_extent" "-180 -90 180 90" #[minx][miny][maxx][maxy] > "wms_timeformat" "YYYY-MM-DDTHH:MM:SS" > "wms_timeextent" "2011-01-01T00:00:00/2012-12-01T00:00:00" > "wms_timeitem" "timezone" > "wms_timedefault" "2011-01-01T00:00:00" > wcs_resolution '0:10 0:10' > END > > #CONNECTION "user=wilbur dbname=pm25_monthly host=localhost password=iiiiiiiiii" > #CONNECTIONTYPE postgis > CONNECTIONTYPE POSTGIS > CONNECTION "host=127.0.0.1 dbname=pm25_monthly user=wilbur password=EUR2_live port=5432" > > DATA "the_geom from pm25_monthly_global using unique oid using srid=4326" > END > > #*******LAYER - MONTHLY PM2.5 (Time > Sensitive)********************************* > > LAYER > NAME 'pm25_monthly' > TYPE RASTER > STATUS ON > DEBUG OFF > DUMP TRUE > #TRANSPARENCY 50 > #FILTER "" > > METADATA > "ows_keywordlist" 'PM2.5 (ug/m3), Global' #wms_keywordlist (Keywordlist) > "ows_description" "Global monthly mean PM 2.5 (ug/m3)concentration" > "ows_name" "Global monthly mean PM2.5 - Concentration Values (ug/m3)" > "ows_label" "Global PM 2.5 (ug/m3)" > "ows_srs" "EPSG:4326 EPSG:900913" > "ows_extent" "-180 -90 180 90" #[minx][miny][maxx][maxy] > "ows_formats" "GEOTIFF" > "ows_nativeformat" "8-bit GeoTIF" > "ows_timeitem" "timezone" > "wms_onlineresource" "http://localhost/cgi-bin/mapserv?map=/var/www/pm25_mapserver/public_html/pm25_ogc_services.map" > "wms_abstract" 'Global monthly mean PM 2.5 (ug/m3)concentration' #wms_abstract(Abstract) > "wms_opaque" '0' #wms_opaque(layer) > "wms_title" "Global monthly mean PM 2.5 (ug/m3)concentration" > "ows_timeformat" "YYYY-MM-DDTHH:MM:SSZ" > "ows_timeextent" "2011-01-01T00:00:00Z/2012-12-01T00:00:00Z" > "ows_timedefault" "2011-01-01T00:00:00Z" > "wms_enable_request" "*" > "wcs_resolution" "0:10 0:10" > "wcs_bandcount" "1" > "wcs_size" "3600 1800" > layer_name pm25_monthly > > END #METADATA > PROJECTION > "init=epsg:4326" #WGS84 Decimal Degrees > END #PROJECTION > > TILEITEM "location" > TILEINDEX "pm25_time_index" > > END #LAYER > > > > Thanks > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users From bhudspeth at edac.unm.edu Tue Jan 6 09:09:44 2015 From: bhudspeth at edac.unm.edu (William Hudspeth) Date: Tue, 06 Jan 2015 10:09:44 -0700 Subject: [mapserver-users] Return pixel values from raster layers served by mapserver In-Reply-To: References: <2147079035.16668525.1420556311003.JavaMail.zimbra@edac.unm.edu> <54AC06DE.7080802@edac.unm.edu> Message-ID: <54AC16D8.5050305@edac.unm.edu> I guess I am a little unclear as to how to proceed. The PG temporal index already works for WMS calls. I can pass a time stamp in the URL request, and I get the correct image. Do I still need a template for returning the x/y query? Or is there another way to return the values via a script that sequentially runs through a list of times? On 01/06/2015 09:37 AM, Lime, Steve D (MNIT) wrote: > If you want to use one x/y to query multiple rasters, that should be doable in straight MapServer although I guess it depends on how things are organized. I don't know how things work from a query perspective if you use your tile index as just a spatial index and not a temporal index. I'd get the one layer version working then expand it - make sure the PG tileindex works as expected with a query. > > -----Original Message----- > From: William Hudspeth [mailto:bhudspeth at edac.unm.edu] > Sent: Tuesday, January 06, 2015 10:02 AM > To: Lime, Steve D (MNIT); mapserver-users at lists.osgeo.org > Subject: Re: [mapserver-users] Return pixel values from raster layers served by mapserver > > I have not yet tried a TEMPLATE....ideally, I am looking for a method to script a series of calls to mapserver to return a list of pixel values for a time series of rasters for a given geographic coordinate. In this case, imagine a time series of air pollution rasters where I want to collect a sequence of values for a given city or location. I want to be able to use these data points to build a time series graph....Any ideas would be appreciated... > > Thanks! > > > > On 01/06/2015 08:44 AM, Lime, Steve D (MNIT) wrote: >> Ok, so this just a PostGIS-based tiled layer to access GeoTIFF's. You should just be able to do a normal MapServer query. >> >> e.g. >> http://your.server/cgi-bin/mapserv?map=your.map&mapxy=x+y&qlayer=pm25_ >> monthly&mode=query >> >> You'd need to set a TEMPLATE for the pm25_monthly layer. Have you tried that? WMS should work then too but it's simpler to debug using a basic MapServer query. >> >> Steve >> >> -----Original Message----- >> From: mapserver-users-bounces at lists.osgeo.org >> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Bill >> Hudspeth >> Sent: Tuesday, January 06, 2015 8:59 AM >> To: mapserver-users at lists.osgeo.org >> Subject: [mapserver-users] Return pixel values from raster layers >> served by mapserver >> >> Hello, >> >> I previously wrote about this issue, but have not found a solution yet. I am running Mapserver 6.4.1, and am using Postgres/Postgis to display a time series of geotiff images. I would like to know the best way for a user to submit a given x,y coordinate pair and return the pixel value for a given image. Is this possible using only the mapserver api? or must I absolutely use mapscript? >> >> Currently, I use a PostgreSQL/PostGIS time-enabled table to store the information about the location of the geotiffs and the timestamp associated with them: >> >> pm25_monthly=# \d pm25_monthly_global >> >> Table >> "public.pm25_monthly_global" >> >> Column | Type | >> Modifiers >> >> ----------+-----------------------------+----------------------------- >> ----------+-----------------------------+-- >> ----------+-----------------------------+---------------- >> >> oid | integer | default nextval('pm25_monthly_seq'::regclass) >> rundate | timestamp with time zone | >> datetime | timestamp with time zone | >> location | text | >> timezone | timestamp without time zone | >> the_geom | geometry(MultiPolygon,4326) | >> >> Indexes: >> "pm25_monthly_global_oid_key" >> UNIQUE CONSTRAINT, btree (oid) >> >> The 'location' field simply gives the full path to the relevant geotiff on the file system. And, I define the index in the mapfile: >> >> #**********LAYER - TILE INDEX FOR PM2.5 RASTERS (Time sensitive)**** LAYER >> STATUS ON >> NAME "pm25_time_index" >> TYPE POLYGON >> DATA "the_geom from pm25_monthly_global using unique oid using SRID=4326" >> METADATA >> "ows_title" "PM25 TIME INDEX" >> "ows_srs" "EPSG:4326" >> "ows_extent" "-180 -90 180 90" #[minx][miny][maxx][maxy] >> "wms_timeformat" "YYYY-MM-DDTHH:MM:SS" >> "wms_timeextent" "2011-01-01T00:00:00/2012-12-01T00:00:00" >> "wms_timeitem" "timezone" >> "wms_timedefault" "2011-01-01T00:00:00" >> wcs_resolution '0:10 0:10' >> END >> >> #CONNECTION "user=wilbur dbname=pm25_monthly host=localhost password=iiiiiiiiii" >> #CONNECTIONTYPE postgis >> CONNECTIONTYPE POSTGIS >> CONNECTION "host=127.0.0.1 dbname=pm25_monthly user=wilbur password=EUR2_live port=5432" >> >> DATA "the_geom from pm25_monthly_global using unique oid using srid=4326" >> END >> >> #*******LAYER - MONTHLY PM2.5 (Time >> Sensitive)********************************* >> >> LAYER >> NAME 'pm25_monthly' >> TYPE RASTER >> STATUS ON >> DEBUG OFF >> DUMP TRUE >> #TRANSPARENCY 50 >> #FILTER "" >> >> METADATA >> "ows_keywordlist" 'PM2.5 (ug/m3), Global' #wms_keywordlist (Keywordlist) >> "ows_description" "Global monthly mean PM 2.5 (ug/m3)concentration" >> "ows_name" "Global monthly mean PM2.5 - Concentration Values (ug/m3)" >> "ows_label" "Global PM 2.5 (ug/m3)" >> "ows_srs" "EPSG:4326 EPSG:900913" >> "ows_extent" "-180 -90 180 90" #[minx][miny][maxx][maxy] >> "ows_formats" "GEOTIFF" >> "ows_nativeformat" "8-bit GeoTIF" >> "ows_timeitem" "timezone" >> "wms_onlineresource" "http://localhost/cgi-bin/mapserv?map=/var/www/pm25_mapserver/public_html/pm25_ogc_services.map" >> "wms_abstract" 'Global monthly mean PM 2.5 (ug/m3)concentration' #wms_abstract(Abstract) >> "wms_opaque" '0' #wms_opaque(layer) >> "wms_title" "Global monthly mean PM 2.5 (ug/m3)concentration" >> "ows_timeformat" "YYYY-MM-DDTHH:MM:SSZ" >> "ows_timeextent" "2011-01-01T00:00:00Z/2012-12-01T00:00:00Z" >> "ows_timedefault" "2011-01-01T00:00:00Z" >> "wms_enable_request" "*" >> "wcs_resolution" "0:10 0:10" >> "wcs_bandcount" "1" >> "wcs_size" "3600 1800" >> layer_name pm25_monthly >> >> END #METADATA >> PROJECTION >> "init=epsg:4326" #WGS84 Decimal Degrees >> END #PROJECTION >> >> TILEITEM "location" >> TILEINDEX "pm25_time_index" >> >> END #LAYER >> >> >> >> Thanks >> _______________________________________________ >> mapserver-users mailing list >> mapserver-users at lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/mapserver-users From aperi2007 at gmail.com Tue Jan 6 11:00:32 2015 From: aperi2007 at gmail.com (Andrea Peri) Date: Tue, 6 Jan 2015 20:00:32 +0100 Subject: [mapserver-users] Return pixel values from raster layers served by mapserver In-Reply-To: <2147079035.16668525.1420556311003.JavaMail.zimbra@edac.unm.edu> References: <2147079035.16668525.1420556311003.JavaMail.zimbra@edac.unm.edu> Message-ID: Hi, I guess you could get it as a normally GetFeatureInfo request. We use it usually to retrive the quote from a raster DEM. You should set a template and do a request GetFeatureInfo with output format = text/html. In the template you should retrieve : the RGB values separatelly for R,G and B or for a raster DEM the quote value. AFAIK The only relevant difference difference is the input format. Infct we use the spatialite using the OGR. But I guess it should work also with postgis provider. regards, A. 2015-01-06 15:58 GMT+01:00 Bill Hudspeth : > Hello, > > I previously wrote about this issue, but have not found a solution yet. I am running Mapserver 6.4.1, and am using Postgres/Postgis to display a time series of geotiff images. I would like to know the best way for a user to submit a given x,y coordinate pair and return the pixel value for a given image. Is this possible using only the mapserver api? or must I absolutely use mapscript? > > Currently, I use a PostgreSQL/PostGIS time-enabled table to store the information about the location of the geotiffs and the timestamp associated with them: > > pm25_monthly=# \d pm25_monthly_global > > Table > "public.pm25_monthly_global" > > Column | Type | > Modifiers > > ----------+-----------------------------+----------------------------------------------- > > oid | integer | default nextval('pm25_monthly_seq'::regclass) > rundate | timestamp with time zone | > datetime | timestamp with time zone | > location | text | > timezone | timestamp without time zone | > the_geom | geometry(MultiPolygon,4326) | > > Indexes: > "pm25_monthly_global_oid_key" > UNIQUE CONSTRAINT, btree (oid) > > The 'location' field simply gives the full path to the relevant geotiff on the file system. And, I define the index in the mapfile: > > #**********LAYER - TILE INDEX FOR PM2.5 RASTERS > (Time sensitive)**** > LAYER > STATUS ON > NAME "pm25_time_index" > TYPE POLYGON > DATA "the_geom from pm25_monthly_global using unique oid using SRID=4326" > METADATA > "ows_title" "PM25 TIME INDEX" > "ows_srs" "EPSG:4326" > "ows_extent" "-180 -90 180 90" #[minx][miny][maxx][maxy] > "wms_timeformat" "YYYY-MM-DDTHH:MM:SS" > "wms_timeextent" "2011-01-01T00:00:00/2012-12-01T00:00:00" > "wms_timeitem" "timezone" > "wms_timedefault" "2011-01-01T00:00:00" > wcs_resolution '0:10 0:10' > END > > #CONNECTION "user=wilbur dbname=pm25_monthly host=localhost password=iiiiiiiiii" > #CONNECTIONTYPE postgis > CONNECTIONTYPE POSTGIS > CONNECTION "host=127.0.0.1 dbname=pm25_monthly user=wilbur password=EUR2_live port=5432" > > DATA "the_geom from pm25_monthly_global using unique oid using srid=4326" > END > > #*******LAYER - MONTHLY PM2.5 (Time Sensitive)********************************* > > LAYER > NAME 'pm25_monthly' > TYPE RASTER > STATUS ON > DEBUG OFF > DUMP TRUE > #TRANSPARENCY 50 > #FILTER "" > > METADATA > "ows_keywordlist" 'PM2.5 (ug/m3), Global' #wms_keywordlist (Keywordlist) > "ows_description" "Global monthly mean PM 2.5 (ug/m3)concentration" > "ows_name" "Global monthly mean PM2.5 - Concentration Values (ug/m3)" > "ows_label" "Global PM 2.5 (ug/m3)" > "ows_srs" "EPSG:4326 EPSG:900913" > "ows_extent" "-180 -90 180 90" #[minx][miny][maxx][maxy] > "ows_formats" "GEOTIFF" > "ows_nativeformat" "8-bit GeoTIF" > "ows_timeitem" "timezone" > "wms_onlineresource" "http://localhost/cgi-bin/mapserv?map=/var/www/pm25_mapserver/public_html/pm25_ogc_services.map" > "wms_abstract" 'Global monthly mean PM 2.5 (ug/m3)concentration' #wms_abstract(Abstract) > "wms_opaque" '0' #wms_opaque(layer) > "wms_title" "Global monthly mean PM 2.5 (ug/m3)concentration" > "ows_timeformat" "YYYY-MM-DDTHH:MM:SSZ" > "ows_timeextent" "2011-01-01T00:00:00Z/2012-12-01T00:00:00Z" > "ows_timedefault" "2011-01-01T00:00:00Z" > "wms_enable_request" "*" > "wcs_resolution" "0:10 0:10" > "wcs_bandcount" "1" > "wcs_size" "3600 1800" > layer_name pm25_monthly > > END #METADATA > PROJECTION > "init=epsg:4326" #WGS84 Decimal Degrees > END #PROJECTION > > TILEITEM "location" > TILEINDEX "pm25_time_index" > > END #LAYER > > > > Thanks > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users -- ----------------- Andrea Peri . . . . . . . . . qwerty ????? ----------------- From andy at squeakycode.net Tue Jan 6 12:04:20 2015 From: andy at squeakycode.net (Andy Colson) Date: Tue, 06 Jan 2015 14:04:20 -0600 Subject: [mapserver-users] mapcache compile issue on cygwin posted on stackoverflow In-Reply-To: <54AB1FE1.4030109@swoodbridge.com> References: <54AB1FE1.4030109@swoodbridge.com> Message-ID: <54AC3FC4.1060503@squeakycode.net> On 1/5/2015 5:36 PM, Stephen Woodbridge wrote: > I saw this issue come up on stackoverflow: > http://stackoverflow.com/questions/27755442/compiling-error-core-c-in-mapcache-with-cygwin/27760401 > > > Anyone have any other ideas? > > -Steve W > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users Yea, if he didnt have apr installed, I'd expect to see "cannot find header" errors. So if it found the headers .. why wouldn't the header contain apr_thread_t? Wrong version maybe? The mapcache page doesnt say anything about cygwin. They say it compiles with visual studio though. -Andy From gamejihou at hotmail.com Wed Jan 7 05:59:04 2015 From: gamejihou at hotmail.com (Gery) Date: Wed, 7 Jan 2015 05:59:04 -0800 (PST) Subject: [mapserver-users] compiling error core.c in mapcache with cygwin In-Reply-To: <54A8036D.6090609@squeakycode.net> References: <54A8036D.6090609@squeakycode.net> Message-ID: <1420639144277-5180356.post@n6.nabble.com> Andy Colson wrote > You need the Apache Portable Runtime library. Its a generic lib, not the > webserver.This gives an overview of all the area's it > covers:http://apr.apache.org/docs/apr/1.4/modules.html Thanks Andy for the reply, I do have apr, no idea if it's the generic lib or webserver one but they are 1.4 version:Gery at gery /opt/mapcache/mapcache-rel-1-2-1/build$ cygcheck -c | grep aprapr1 1.4.8-1 OKaprutil1 1.5.4-1 OKlibapr1 1.4.8-1 OKlibapr1-debuginfo 1.4.8-1 OKlibapr1-devel 1.4.8-1 OKlibaprutil1 1.5.4-1 OKlibaprutil1-debuginfo 1.5.4-1 OKlibaprutil1-devel 1.5.4-1 OKBased on Stephen's answer (http://stackoverflow.com/questions/27755442/compiling-error-core-c-in-mapcache-with-cygwin), I should compile mapcache only as cgi (ie., no apache module), so I used:cmake .. -DCMAKE_LEGACY_CYGWIN_WIN32=0 -DWITH_SQLITE=0 -DWITH_MAPSERVER=1 -DMAPSERVER_LIBRARY="/opt/mapserver/mapserver-6.4.1/build/libmapserver.dll.a" -DCMAKE_PREFIX_PATH="/opt/mapserver/mapserver-6.4.1;" -DWITH_APACHE=0but I get the same error pointing to core.c. I used mapserver flags to use cgi as explained by Pablo's post (http://lists.osgeo.org/pipermail/mapserver-users/2013-September/075296.html).So, after cmake I get:Gery at gery /opt/mapcache/mapcache-rel-1-2-1/build$ cmake .. -DCMAKE_LEGACY_CYGWIN_WIN32=0 -DWITH_SQLITE=0 -DWITH_MAPSERVER=1 -DMAPSERVER_LIBRARY="/opt/mapserver/mapserver-6.4.1/build/libmapserver.dll.a" -DCMAKE_PREFIX_PATH="/opt/mapserver/mapserver-6.4.1;" -DWITH_APACHE=0-- The C compiler identification is GNU 4.8.3-- The CXX compiler identification is GNU 4.8.3-- Check for working C compiler: /usr/bin/gcc.exe-- Check for working C compiler: /usr/bin/gcc.exe -- works-- Detecting C compiler ABI info-- Detecting C compiler ABI info - done-- Check for working CXX compiler: /usr/bin/c++.exe-- Check for working CXX compiler: /usr/bin/c++.exe -- works-- Detecting CXX compiler ABI info-- Detecting CXX compiler ABI info - done-- Looking for strncasecmp-- Looking for strncasecmp - found-- Looking for symlink-- Looking for symlink - found-- Found ZLIB: /usr/lib/libz.dll.a (found version "1.2.8")-- Found PNG: /usr/lib/libpng.dll.a (found version "1.5.18")-- Found JPEG: /usr/lib/libjpeg.dll.a-- Found CURL: /usr/lib/libcurl.dll.a (found version "7.38.0")-- Found APR: /usr/lib/libapr-1.dll.a-- Found APU: /usr/lib/libaprutil-1.dll.a-- Found PkgConfig: /usr/bin/pkg-config.exe (found version "0.28")-- checking for module 'pixman'-- package 'pixman' not found-- checking for module 'pixman-1'-- found pixman-1, version 0.32.4-- Found PIXMAN: /usr/lib/libpixman-1.dll.a-- Found MAPSERVER: /opt/mapserver/mapserver-6.4.1/build/libmapserver.dll.a-- * Configured options for the mapcache library-- * Mandatory components-- * png: /usr/lib/libpng.dll.a-- * jpeg: /usr/lib/libjpeg.dll.a-- * Curl: /usr/lib/libcurl.dll.a-- * Apr: /usr/lib/libapr-1.dll.a-- * Optional components-- * PIXMAN: /usr/lib/libpixman-1.dll.a-- * SQLITE: disabled-- * Berkeley DB: disabled-- * Memcache: disabled-- * TIFF: disabled-- * GeoTIFF: disabled-- * Experimental TIFF write support: disabled-- * PCRE: disabled-- * Experimental mapserver support: /opt/mapserver/mapserver-6.4.1/build/libmapserver.dll.a-- Found GDAL: /usr/local/lib/libgdal.dll.a-- Found GEOS: /usr/local/lib/libgeos_c.dll.a-- * Seeder Configuration Options:-- * GEOS: /usr/local/lib/libgeos_c.dll.a-- * OGR: /usr/local/lib/libgdal.dll.a-- Found FCGI: /usr/lib/libfcgi.dll.a-- * CGI Configuration Options:-- * FastCGI: /usr/lib/libfcgi.dll.a-- * Apache Module support status: DISABLED-- Configuring done-- Generating done-- Build files have been written to: /opt/mapcache/mapcache-rel-1-2-1/buildand after make I get:Gery at gery /opt/mapcache/mapcache-rel-1-2-1/build$ makeScanning dependencies of target mapcache[ 2%] Building C object CMakeFiles/mapcache.dir/lib/axisorder.c.o[ 5%] Building C object CMakeFiles/mapcache.dir/lib/buffer.c.o[ 7%] Building C object CMakeFiles/mapcache.dir/lib/cache_bdb.c.o[ 10%] Building C object CMakeFiles/mapcache.dir/lib/cache_disk.c.o[ 12%] Building C object CMakeFiles/mapcache.dir/lib/cache_memcache.c.o[ 15%] Building C object CMakeFiles/mapcache.dir/lib/cache_sqlite.c.o[ 17%] Building C object CMakeFiles/mapcache.dir/lib/cache_tiff.c.o[ 20%] Building C object CMakeFiles/mapcache.dir/lib/cache_tokyocabinet.c.o[ 22%] Building C object CMakeFiles/mapcache.dir/lib/configuration.c.o[ 25%] Building C object CMakeFiles/mapcache.dir/lib/configuration_xml.c.o[ 27%] Building C object CMakeFiles/mapcache.dir/lib/core.c.o/opt/mapcache/mapcache-rel-1-2-1/lib/core.c: In function ?mapcache_prefetch_tiles?:/opt/mapcache/mapcache-rel-1-2-1/lib/core.c:81:3: error: unknown type name ?apr_thread_t? apr_thread_t **threads; ^/opt/mapcache/mapcache-rel-1-2-1/lib/core.c:82:3: error: unknown type name ?apr_threadattr_t? apr_threadattr_t *thread_attrs; ^/opt/mapcache/mapcache-rel-1-2-1/lib/core.c:83:7: warning: unused variable ?nthreads? [-Wunused-variable] int nthreads; ^/opt/mapcache/mapcache-rel-1-2-1/lib/core.c:82:21: warning: unused variable ?thread_attrs? [-Wunused-variable] apr_threadattr_t *thread_attrs; ^/opt/mapcache/mapcache-rel-1-2-1/lib/core.c:81:18: warning: unused variable ?threads? [-Wunused-variable] apr_thread_t **threads; ^CMakeFiles/mapcache.dir/build.make:287: recipe for target 'CMakeFiles/mapcache.dir/lib/core.c.o' failedmake[2]: *** [CMakeFiles/mapcache.dir/lib/core.c.o] Error 1CMakeFiles/Makefile2:63: recipe for target 'CMakeFiles/mapcache.dir/all' failedmake[1]: *** [CMakeFiles/mapcache.dir/all] Error 2Makefile:116: recipe for target 'all' failedmake: *** [all] Error 2How could I know if my apr packages are causing the problem? is there a way to test that without installing a newer apache version?Gery -- View this message in context: http://osgeo-org.1560.x6.nabble.com/compiling-error-core-c-in-mapcache-with-cygwin-tp5179881p5180356.html Sent from the Mapserver - User mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gamejihou at hotmail.com Wed Jan 7 06:18:54 2015 From: gamejihou at hotmail.com (Gery) Date: Wed, 7 Jan 2015 06:18:54 -0800 (PST) Subject: [mapserver-users] mapcache compile issue on cygwin posted on stackoverflow In-Reply-To: <54AC3FC4.1060503@squeakycode.net> References: <54AB1FE1.4030109@swoodbridge.com> <54AC3FC4.1060503@squeakycode.net> Message-ID: <1420640334084-5180358.post@n6.nabble.com> Hi Stephen and Andy, thanks for your inputs on this subject, I put a detailed answer in my post here, please take a look there for further discussion. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/mapcache-compile-issue-on-cygwin-posted-on-stackoverflow-tp5180132p5180358.html Sent from the Mapserver - User mailing list archive at Nabble.com. From geo.graefin at web.de Wed Jan 7 07:33:33 2015 From: geo.graefin at web.de (geo.graefin at web.de) Date: Wed, 7 Jan 2015 16:33:33 +0100 Subject: [mapserver-users] map file with connection to postgis Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: unterkunft.map Type: application/octet-stream Size: 3478 bytes Desc: not available URL: From jt at mapmedia.de Wed Jan 7 07:44:39 2015 From: jt at mapmedia.de (=?UTF-8?B?SsO2cmcgVGhvbXNlbg==?=) Date: Wed, 07 Jan 2015 16:44:39 +0100 Subject: [mapserver-users] map file with connection to postgis In-Reply-To: References: Message-ID: <54AD5467.1040405@mapmedia.de> Hi, Am 07.01.2015 um 16:33 schrieb geo.graefin at web.de: > When I leave out "schema=public" in the string of "DATA" in my map file > then i get the following message: > > ?PNG > ? > IHDR ?? ???? wmF? ?PLTE ?z=? ?tRNS @??f ?IDATx???1? ???Om > ?? > ???? ??1?! IEND?B`? looks like this is a png-image. Have you tried to open this file with an image-viewer? J?rg From geo.graefin at web.de Wed Jan 7 08:27:12 2015 From: geo.graefin at web.de (geo.graefin at web.de) Date: Wed, 7 Jan 2015 17:27:12 +0100 Subject: [mapserver-users] map file with connection to postgis In-Reply-To: <54AD5467.1040405@mapmedia.de> References: , <54AD5467.1040405@mapmedia.de> Message-ID: An HTML attachment was scrubbed... URL: From Steve.Lime at state.mn.us Wed Jan 7 08:40:05 2015 From: Steve.Lime at state.mn.us (Lime, Steve D (MNIT)) Date: Wed, 7 Jan 2015 16:40:05 +0000 Subject: [mapserver-users] map file with connection to postgis In-Reply-To: References: , <54AD5467.1040405@mapmedia.de> Message-ID: If you get an image then at least no error is being generated. Are you sure the layer you?re trying to view is on? There?s a switch in shp2img to turn on a layer or you can set STATUS DEFAULT in the layer definition. Steve From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of geo.graefin at web.de Sent: Wednesday, January 07, 2015 10:27 AM To: jt at mapmedia.de; mapserver-users at lists.osgeo.org Subject: Re: [mapserver-users] map file with connection to postgis Hello J?rg, I get an empty picture when I create a png with the tool shp2img. Thanks for helping! Gesendet: Mittwoch, 07. Januar 2015 um 16:44 Uhr Von: "J?rg Thomsen" > An: mapserver-users at lists.osgeo.org Betreff: Re: [mapserver-users] map file with connection to postgis Hi, Am 07.01.2015 um 16:33 schrieb geo.graefin at web.de: > When I leave out "schema=public" in the string of "DATA" in my map file > then i get the following message: > > ?PNG > ? > IHDR ?? ???? wmF? ?PLTE ?z=? ?tRNS @??f ?IDATx???1? ???Om > ?? > ???? ??1?! IEND?B`? looks like this is a png-image. Have you tried to open this file with an image-viewer? J?rg _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From geo.graefin at web.de Wed Jan 7 08:52:50 2015 From: geo.graefin at web.de (geo.graefin at web.de) Date: Wed, 7 Jan 2015 17:52:50 +0100 Subject: [mapserver-users] map file with connection to postgis In-Reply-To: References: , <54AD5467.1040405@mapmedia.de> , Message-ID: An HTML attachment was scrubbed... URL: From jmckenna at gatewaygeomatics.com Wed Jan 7 08:54:12 2015 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Wed, 07 Jan 2015 12:54:12 -0400 Subject: [mapserver-users] map file with connection to postgis In-Reply-To: References: , <54AD5467.1040405@mapmedia.de> Message-ID: <54AD64B4.9060705@gatewaygeomatics.com> It could also be your extents: - remove all layers from your mapfile, except for the PG one - remove all projection blocks from your mapfile - connect through ogrinfo commandline to that layer ogrinfo PG:"host=127.0.0.1 user=postgres password=postgres dbname=test port=5432" - use the ogrinfo command with the layername and the -summary switch to get the PG layer's extents ogrinfo PG:"host=127.0.0.1 user=postgres password=postgres dbname=test port=5432" yourPGlayername -summary - use that extent for the EXTENT parameter in your mapfile - re-test with shp2img command shp2img -m postgis.map -o ttt.png -map_debug 3 -jeff -- Jeff McKenna MapServer Consulting and Training Services http://www.gatewaygeomatics.com/ On 2015-01-07 12:40 PM, Lime, Steve D (MNIT) wrote: > If you get an image then at least no error is being generated. Are you > sure the layer you?re trying to view is on? There?s a switch in shp2img > to turn on a layer or you can set STATUS DEFAULT in the layer definition. > > Steve > > *From:*mapserver-users-bounces at lists.osgeo.org > [mailto:mapserver-users-bounces at lists.osgeo.org] *On Behalf Of > *geo.graefin at web.de > *Sent:* Wednesday, January 07, 2015 10:27 AM > *To:* jt at mapmedia.de; mapserver-users at lists.osgeo.org > *Subject:* Re: [mapserver-users] map file with connection to postgis > > Hello J?rg, > > I get an empty picture when I create a png with the tool shp2img. > > Thanks for helping! > > *Gesendet:* Mittwoch, 07. Januar 2015 um 16:44 Uhr > *Von:* "J?rg Thomsen" > > *An:* mapserver-users at lists.osgeo.org > > *Betreff:* Re: [mapserver-users] map file with connection to postgis > > Hi, > > Am 07.01.2015 um 16:33 schrieb geo.graefin at web.de > : >> When I leave out "schema=public" in the string of "DATA" in my map file >> then i get the following message: >> >> ?PNG >>? >> IHDR??????wmF??PLTE ?z=??tRNS @??f ?IDATx???1????Om >> ?? >> ???? ??1?! IEND?B`? > > looks like this is a png-image. Have you tried to open this file with an > image-viewer? > > J?rg From geo.graefin at web.de Wed Jan 7 11:55:58 2015 From: geo.graefin at web.de (geo.graefin at web.de) Date: Wed, 7 Jan 2015 20:55:58 +0100 Subject: [mapserver-users] map file with connection to postgis In-Reply-To: <54AD64B4.9060705@gatewaygeomatics.com> References: =?UTF-8?Q?, =20<54AD5467.1040405@mapmedia.de>=09=20, =20<54AD64B4.9060705@gatewaygeomatics.com>?= Message-ID: An HTML attachment was scrubbed... URL: From sig at themis.nc Wed Jan 7 18:46:11 2015 From: sig at themis.nc (Heyser Sylvain) Date: Thu, 08 Jan 2015 13:46:11 +1100 Subject: [mapserver-users] How can I read Z coordinates in a shape file ? Message-ID: <54ADEF73.6050201@themis.nc> Dear Mapserver community, I try to read the value of the Z coordinate in an Esri Shape file without success. I want to get the Z values through an url request (WFS) like this : http://my_server_ip/cgi-bin/mapserv?map=/var/www/data/mapfile.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRS=EPSG:3163&BBOX=458692.315380274,394716.36951207,460607.98862158,395413.707691068&TYPENAME=Piste But I only get output data without Z values. 459689.471118,394821.251944 459699.341118,394828.476944459699.341118,394821.251944 459693.717118,394828.476944 459689.471118,394825.098944 1 The OGRINFO of the data is : Layer name: PISTAERO_line Geometry: 3D Line String Feature Count: 2 Extent: (459349.927521, 394583.151000) - (460037.901778, 395483.896917) Layer SRS WKT: (unknown) PISTAER_ID: Integer (5.0) I have configure my map file as follow : MAP NAME DACDEV_map STATUS ON SIZE 900 700 EXTENT 150000 150000 650000 650000 UNITS METERS SHAPEPATH "shape" IMAGECOLOR 255 255 0 SYMBOLSET "symbols-dac.sym" PROJECTION 'init=epsg:3163' END CONFIG 'MS_ERRORFILE' '/var/www/tmp/ms_error.log' OUTPUTFORMAT NAME "OGRGML" DRIVER "OGR/GML" FORMATOPTION "STORAGE=filesystem" FORMATOPTION "FORM=multipart" FORMATOPTION "FILENAME=/var/www/tmp/result.gml" END WEB TEMPLATE "template.html" IMAGEPATH "/var/www/tmp/" IMAGEURL "/tmp/" METADATA 'wms_title' 'DAC_DATA' 'wms_srs' 'EPSG:3163' 'wfs_title' 'DEMO' 'wfs_olineressource' 'http://192.168.10.108/cgi-bin/mapserv?' 'wfs_srs' 'EPSG:3163' 'wfs_enable_request' '*' END END LAYER NAME "Piste" DEBUG 5 METADATA 'wfs_title' 'Piste' 'wfs_srs' 'EPSG:3163' 'gml_featureid' 'PISTAER_ID' 'gml_include_items' 'all' 'wfs_enable_request' '*' 'wms_enable_request' '*' 'ows_geomtype' 'LineString25D' 'wfs_geomtype' 'LineString25D' 'wfs_getfeature_formatlist' 'OGRGML' END CONNECTION "PISTAERO_line.shp" CONNECTIONTYPE OGR DATA 'PISTAERO_line' STATUS ON DUMP true TYPE LINE25D CLASS NAME "line_color" COLOR 255 215 0 END END END I don't understand why the /var/www/tmp/result.gml file is never created. It looks like that the OGRGML OUTPUTFORMAT is not used by mapserv. Kind regards, Sylvain From jukka.rahkonen at maanmittauslaitos.fi Thu Jan 8 02:26:55 2015 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Thu, 8 Jan 2015 10:26:55 +0000 Subject: [mapserver-users] How can I read Z coordinates in a shape file ? Message-ID: <552b277527004458a1a643bc0b6e0f85@C119S212VM022.msvyvi.vaha.local> Hi, I would first check that your Mapserver is compiled with Z/M coordinate support which is required by reading the document http://mapserver.org/output/ogr_output.html . However, I have never played with 25D/3D geometries with Mapserver and I have no idea how to check if the Z_M support is compiled in. Perhaps there would be something about that in the comment line of GetCapabilities which typically shows something like "MapServer version 6.4.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ ..." Excerpt from the WFS server manual: ows/wfs_geomtype (Optional) Set the geometry type of OGR layers created from this MapServer LAYER. One of "Point", "LineString", "Polygon", "MultiPoint", "MultiLineString", "MultiPolygon", "GeometryCollection", "Geometry", or "None". Most are fairly obvious, but "Geometry" can be used to represent a mix of geometry types, and "None" is sometimes suitable for layers without geometry. Note that layers which are a mix of polygon and multipolygon would normally have to be described as "Geometry". To produce 2.5D output append "25D" to the geometry type (ie. "Polygon25D"). Note that Z values are only carried by MapServer if built with USE_POINT_Z_M support. I would guess that it is OK in your case because you must have read the documentation well before getting as far as you are now. My next guess is that perhaps 'wfs_getfeature_formatlist' 'OGRGML' does not remove the default outputformat which is mandated by the WFS standard and which is GML2 for WFS version 1.0.0. In that case, if you are lucky, the problem may be solved by asking Mapserver explicitly use your tailored outputformat by adding &OUTPUTFORMAT=OGRGML. If Mapserver behaves as it should you can check the GetCapabilities document and read the list of available formats from the ResultFormat section. For example this server supports only the default GML2 http://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities. Despite being the last thing on my short list reading carefully the GetCapabilities document is actually the thing that should always be done first if there are some troubles with WMS/WFS/WCS services. -Jukka Rahkonen- Heyser Sylvain wrote: > Dear Mapserver community, > I try to read the value of the Z coordinate in an Esri Shape file without success. > I want to get the Z values through an url request (WFS) like this : http://my_server_ip/cgi-bin/mapserv?map=/var/www/data/mapfile.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRS=EPSG:3163&BBOX=458692.315380274,394716.36951207,460607.98862158,395413.707691068&TYPENAME=Piste > But I only get output data without Z values. 459689.471118,394821.251944 459699.341118,394828.476944459699.341118,394821.251944 459693.717118,394828.476944 459689.471118,394825.098944 1 > The OGRINFO of the data is : Layer name: PISTAERO_line Geometry: 3D Line String Feature Count: 2 Extent: (459349.927521, 394583.151000) - (460037.901778, 395483.896917) Layer SRS WKT: (unknown) PISTAER_ID: Integer (5.0) I have configure my map file as follow : MAP NAME DACDEV_map STATUS ON SIZE 900 700 EXTENT 150000 150000 650000 650000 UNITS METERS SHAPEPATH "shape" IMAGECOLOR 255 255 0 SYMBOLSET "symbols-dac.sym" PROJECTION 'init=epsg:3163' END CONFIG 'MS_ERRORFILE' '/var/www/tmp/ms_error.log' OUTPUTFORMAT NAME "OGRGML" DRIVER "OGR/GML" FORMATOPTION "STORAGE=filesystem" FORMATOPTION "FORM=multipart" FORMATOPTION "FILENAME=/var/www/tmp/result.gml" END WEB TEMPLATE "template.html" IMAGEPATH "/var/www/tmp/" IMAGEURL "/tmp/" METADATA 'wms_title' 'DAC_DATA' 'wms_srs' 'EPSG:3163' 'wfs_title' 'DEMO' 'wfs_olineressource' 'http://192.168.10.108/cgi-bin/mapserv?' 'wfs_srs' 'EPSG:3163' 'wfs_enable_request' '*' END END LAYER NAME "Piste" DEBUG 5 METADATA 'wfs_title' 'Piste' 'wfs_srs' 'EPSG:3163' 'gml_featureid' 'PISTAER_ID' 'gml_include_items' 'all' 'wfs_enable_request' '*' 'wms_enable_request' '*' 'ows_geomtype' 'LineString25D' 'wfs_geomtype' 'LineString25D' 'wfs_getfeature_formatlist' 'OGRGML' END CONNECTION "PISTAERO_line.shp" CONNECTIONTYPE OGR DATA 'PISTAERO_line' STATUS ON DUMP true TYPE LINE25D CLASS NAME "line_color" COLOR 255 215 0 END END END > I don't understand why the /var/www/tmp/result.gml file is never created. It looks like that the OGRGML OUTPUTFORMAT is not used by mapserv. Kind regards, Sylvain _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users From dietmar.stolz at freenet.de Thu Jan 8 02:40:10 2015 From: dietmar.stolz at freenet.de (Dietmar Stolz) Date: Thu, 08 Jan 2015 11:40:10 +0100 Subject: [mapserver-users] KML output with blank point Message-ID: <54AE5E8A.7040209@freenet.de> Dear list, I still have a problem with kml output. My kml output basically works. Everything works fine with line and polygon type, I get correct kml files. Point layers works also but mapserver generated blank png's. The bitmap exist in the right directory with the right size. The url path in the kml file is right. I can see the kml point layer in the gis, the points have tooltips and are clickable. The bitmaps have 24 bpp. Pixmap or vector layer symbols makes no difference. Debug 5 shows no error and no kml specific information. MapServer version 6.4.1 on windows 7 64 bit ... OUTPUTFORMAT NAME "kml" DRIVER "KML" MIMETYPE "application/vnd.google-earth.kml+xml" IMAGEMODE RGB EXTENSION "kml" FORMATOPTION "STORAGE=memory" FORMATOPTION "FORM=simple" END ... LAYER # DEBUG 5 NAME "point" TYPE POINT DATA "kml_test.shp" METADATA "ows_title" "test" "ows_abstract" "test" "KML_DESCRIPTION" "test" "KML_NAME_ITEM" "TEXT" # "wfs_getfeature_formatlist" "text/csv,gml,geojson,xml,kml" # "KML_OUTPUTASRASTER" "true" END CLASS STYLE SYMBOL "point" SIZE 36 COLOR 255 0 0 OUTLINECOLOR 0 255 0 END END END ... SYMBOL NAME "point" TYPE ELLIPSE POINTS 10 10 END FILLED TRUE END KML-Output: | || || || || || || || OsthessenNetz || || || point || 1 || #LayerFolder_check || || point.0 || #style_symbol_point_3.6_ff0000ff || test || || || 9.73281948,50.58202641 || || || || || ||| Any ideas? Thank you Dietmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From Michael.Smith at erdc.dren.mil Thu Jan 8 04:07:41 2015 From: Michael.Smith at erdc.dren.mil (Smith, Michael ERDC-RDE-CRREL-NH) Date: Thu, 8 Jan 2015 12:07:41 +0000 Subject: [mapserver-users] [EXTERNAL] Re: How can I read Z coordinates in a shape file ? Message-ID: The line in MapServer to show Z_M support is SUPPORTS=POINT_Z_M. Here's an example that shows WFS output with Z Values: http://geo.usace.army.mil/cgi-bin/wms/nldwfs?service=wfs&version=1.1.0&requ est=getfeature&typename=leveesclosurestructureln&maxfeatures=10&outputforma t=gml3d Note that this uses a specific outputformat that is an OGR outputformat with the ows_geomtype in the Layer metadata set to LineString25D. Mike -- Michael Smith US Army Corps Remote Sensing GIS/Center On 1/8/15, 5:26 AM, "Rahkonen Jukka (MML)" wrote: >Hi, > >I would first check that your Mapserver is compiled with Z/M coordinate >support which is required by reading the document >http://mapserver.org/output/ogr_output.html . However, I have never >played with 25D/3D geometries with Mapserver and I have no idea how to >check if the Z_M support is compiled in. Perhaps there would be something >about that in the comment line of GetCapabilities which typically shows >something like "MapServer version 6.4.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG >SUPPORTS=PROJ ..." > >Excerpt from the WFS server manual: > >ows/wfs_geomtype > > (Optional) Set the geometry type of OGR layers created from this >MapServer LAYER. One of "Point", "LineString", "Polygon", "MultiPoint", >"MultiLineString", "MultiPolygon", "GeometryCollection", "Geometry", or >"None". Most are fairly obvious, but "Geometry" can be used to represent >a mix of geometry types, and "None" is sometimes suitable for layers >without geometry. Note that layers which are a mix of polygon and >multipolygon would normally have to be described as "Geometry". To >produce 2.5D output append "25D" to the geometry type (ie. "Polygon25D"). >Note that Z values are only carried by MapServer if built with >USE_POINT_Z_M support. > >I would guess that it is OK in your case because you must have read the >documentation well before getting as far as you are now. >My next guess is that perhaps 'wfs_getfeature_formatlist' 'OGRGML' does >not remove the default outputformat which is mandated by the WFS standard >and which is GML2 for WFS version 1.0.0. In that case, if you are lucky, >the problem may be solved by asking Mapserver explicitly use your >tailored outputformat by adding &OUTPUTFORMAT=OGRGML. If Mapserver >behaves as it should you can check the GetCapabilities document and read >the list of available formats from the ResultFormat section. For example >this server supports only the default GML2 >http://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=Ge >tCapabilities. > >Despite being the last thing on my short list reading carefully the >GetCapabilities document is actually the thing that should always be done >first if there are some troubles with WMS/WFS/WCS services. > > >-Jukka Rahkonen- > > > > >Heyser Sylvain wrote: > >> Dear Mapserver community, > >> I try to read the value of the Z coordinate in an Esri Shape file >>without success. > >> I want to get the Z values through an url request (WFS) like this : >http://my_server_ip/cgi-bin/mapserv?map=/var/www/data/mapfile.map&SERVICE= >WFS&VERSION=1.0.0&REQUEST=GetFeature&SRS=EPSG:3163&BBOX=458692.315380274,3 >94716.36951207,460607.98862158,395413.707691068&TYPENAME=Piste > >> But I only get output data without Z values. >srsName="EPSG:3163">459689.471118,394821.251944 >459699.341118,394828.476944:msGeometry>srsName="EPSG:3163">459699.341118,394821.251944 >459693.717118,394828.476944 459689.471118,394825.098944 >1STAER_ID> > > >> The OGRINFO of the data is : >Layer name: PISTAERO_line >Geometry: 3D Line String >Feature Count: 2 >Extent: (459349.927521, 394583.151000) - (460037.901778, 395483.896917) >Layer SRS WKT: >(unknown) >PISTAER_ID: Integer (5.0) > >I have configure my map file as follow : >MAP > NAME DACDEV_map > STATUS ON > SIZE 900 700 > EXTENT 150000 150000 650000 650000 > UNITS METERS > SHAPEPATH "shape" > IMAGECOLOR 255 255 0 > SYMBOLSET "symbols-dac.sym" > PROJECTION > 'init=epsg:3163' > END > > CONFIG 'MS_ERRORFILE' '/var/www/tmp/ms_error.log' > > OUTPUTFORMAT > NAME "OGRGML" > DRIVER "OGR/GML" > FORMATOPTION "STORAGE=filesystem" > FORMATOPTION "FORM=multipart" > FORMATOPTION "FILENAME=/var/www/tmp/result.gml" > END > > WEB > TEMPLATE "template.html" > IMAGEPATH "/var/www/tmp/" > IMAGEURL "/tmp/" > METADATA > 'wms_title' 'DAC_DATA' > 'wms_srs' 'EPSG:3163' > 'wfs_title' 'DEMO' > 'wfs_olineressource' 'http://192.168.10.108/cgi-bin/mapserv?' > 'wfs_srs' 'EPSG:3163' > 'wfs_enable_request' '*' > END > END > > LAYER > NAME "Piste" > DEBUG 5 > METADATA > 'wfs_title' 'Piste' > 'wfs_srs' 'EPSG:3163' > 'gml_featureid' 'PISTAER_ID' > 'gml_include_items' 'all' > 'wfs_enable_request' '*' > 'wms_enable_request' '*' > 'ows_geomtype' 'LineString25D' > 'wfs_geomtype' 'LineString25D' > 'wfs_getfeature_formatlist' 'OGRGML' > END > CONNECTION "PISTAERO_line.shp" > CONNECTIONTYPE OGR > DATA 'PISTAERO_line' > STATUS ON > DUMP true > TYPE LINE25D > CLASS > NAME "line_color" > COLOR 255 215 0 > END > END >END > >> I don't understand why the /var/www/tmp/result.gml file is never >>created. It looks like that the OGRGML OUTPUTFORMAT is not used by >>mapserv. > >Kind regards, >Sylvain > >_______________________________________________ >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 From Michael.Smith at erdc.dren.mil Thu Jan 8 04:09:44 2015 From: Michael.Smith at erdc.dren.mil (Smith, Michael ERDC-RDE-CRREL-NH) Date: Thu, 8 Jan 2015 12:09:44 +0000 Subject: [mapserver-users] [EXTERNAL] KML output with blank point In-Reply-To: <54AE5E8A.7040209@freenet.de> References: <54AE5E8A.7040209@freenet.de> Message-ID: Dietmar, Make sure your IMAGEURL is set to a Fully Qualified URL. Otherwise mapserver will not set the full URL to your point images. Mike -- Michael Smith US Army Corps Remote Sensing GIS/Center From: Dietmar Stolz > Date: Thursday, January 8, 2015 at 5:40 AM To: "mapserver-users at lists.osgeo.org" > Subject: [EXTERNAL] [mapserver-users] KML output with blank point Resent-From: Michael Smith > Dear list, I still have a problem with kml output. My kml output basically works. Everything works fine with line and polygon type, I get correct kml files. Point layers works also but mapserver generated blank png's. The bitmap exist in the right directory with the right size. The url path in the kml file is right. I can see the kml point layer in the gis, the points have tooltips and are clickable. The bitmaps have 24 bpp. Pixmap or vector layer symbols makes no difference. Debug 5 shows no error and no kml specific information. MapServer version 6.4.1 on windows 7 64 bit ... OUTPUTFORMAT NAME "kml" DRIVER "KML" MIMETYPE "application/vnd.google-earth.kml+xml" IMAGEMODE RGB EXTENSION "kml" FORMATOPTION "STORAGE=memory" FORMATOPTION "FORM=simple" END ... LAYER # DEBUG 5 NAME "point" TYPE POINT DATA "kml_test.shp" METADATA "ows_title" "test" "ows_abstract" "test" "KML_DESCRIPTION" "test" "KML_NAME_ITEM" "TEXT" # "wfs_getfeature_formatlist" "text/csv,gml,geojson,xml,kml" # "KML_OUTPUTASRASTER" "true" END CLASS STYLE SYMBOL "point" SIZE 36 COLOR 255 0 0 OUTLINECOLOR 0 255 0 END END END ... SYMBOL NAME "point" TYPE ELLIPSE POINTS 10 10 END FILLED TRUE END KML-Output: > OsthessenNetz point 1 #LayerFolder_check point.0 #style_symbol_point_3.6_ff0000ff test 9.73281948,50.58202641 Any ideas? Thank you Dietmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From Michael.Smith at erdc.dren.mil Thu Jan 8 05:34:26 2015 From: Michael.Smith at erdc.dren.mil (Smith, Michael ERDC-RDE-CRREL-NH) Date: Thu, 8 Jan 2015 13:34:26 +0000 Subject: [mapserver-users] [EXTERNAL] KML output with blank point In-Reply-To: <54AE8486.3090103@freenet.de> References: <54AE5E8A.7040209@freenet.de> <54AE8486.3090103@freenet.de> Message-ID: Please always reply back to the list so others can benefit. If all your images are empty, then there is something up with your symbol rendering. Do you get valid symbols if you generate an map image without kml output? I've had no problem with vector and bitmap point symbols in KML output. But the images rendered to the tmp directory render correctly so that is where your problem lies. Mike -- Michael Smith US Army Corps Remote Sensing GIS/Center From: Dietmar Stolz > Date: Thursday, January 8, 2015 at 8:22 AM To: Michael Smith > Subject: Re: [EXTERNAL] [mapserver-users] KML output with blank point Thanks Mike, IMAGEURL is ok, the paths is already an absolute: I can fetch the icon via browser. The icon is rendered but the image itself is blank. Dietmar Am 08.01.2015 um 13:09 schrieb Smith, Michael ERDC-RDE-CRREL-NH: Dietmar, Make sure your IMAGEURL is set to a Fully Qualified URL. Otherwise mapserver will not set the full URL to your point images. Mike -- Michael Smith US Army Corps Remote Sensing GIS/Center From: Dietmar Stolz > Date: Thursday, January 8, 2015 at 5:40 AM To: "mapserver-users at lists.osgeo.org" > Subject: [EXTERNAL] [mapserver-users] KML output with blank point Resent-From: Michael Smith > Dear list, I still have a problem with kml output. My kml output basically works. Everything works fine with line and polygon type, I get correct kml files. Point layers works also but mapserver generated blank png's. The bitmap exist in the right directory with the right size. The url path in the kml file is right. I can see the kml point layer in the gis, the points have tooltips and are clickable. The bitmaps have 24 bpp. Pixmap or vector layer symbols makes no difference. Debug 5 shows no error and no kml specific information. MapServer version 6.4.1 on windows 7 64 bit ... OUTPUTFORMAT NAME "kml" DRIVER "KML" MIMETYPE "application/vnd.google-earth.kml+xml" IMAGEMODE RGB EXTENSION "kml" FORMATOPTION "STORAGE=memory" FORMATOPTION "FORM=simple" END ... LAYER # DEBUG 5 NAME "point" TYPE POINT DATA "kml_test.shp" METADATA "ows_title" "test" "ows_abstract" "test" "KML_DESCRIPTION" "test" "KML_NAME_ITEM" "TEXT" # "wfs_getfeature_formatlist" "text/csv,gml,geojson,xml,kml" # "KML_OUTPUTASRASTER" "true" END CLASS STYLE SYMBOL "point" SIZE 36 COLOR 255 0 0 OUTLINECOLOR 0 255 0 END END END ... SYMBOL NAME "point" TYPE ELLIPSE POINTS 10 10 END FILLED TRUE END KML-Output: > OsthessenNetz point 1 #LayerFolder_check point.0 #style_symbol_point_3.6_ff0000ff test 9.73281948,50.58202641 Any ideas? Thank you Dietmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From fricke at gisberater.com Fri Jan 9 02:24:25 2015 From: fricke at gisberater.com (Lars Fricke) Date: Fri, 09 Jan 2015 11:24:25 +0100 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: References: <54A13C3A.5060405@gisberater.com> Message-ID: <54AFAC59.5060604@gisberater.com> Hello, first of all: Thank you for your support! Sorry for the late reply but I unfortunately was ill. @ Steve: I read about templating but also read that it is slower? I do not have a lot of experience in writing templates. Would you mind sharing a JSONP template? @ Even: Thank you for your thoughts. Who would implement that change though? I'm afraid I can't. @ Jeff: I followed those links but I only found threads referring to GeoServer or that were not related to my question. The GDAL page I did study and that's how I managed to set up the GeoJSON service but thats not the same unfortunately as it conflicts with the same origin policy. Best Lars Am 30.12.2014 um 16:24 schrieb Lime, Steve D (MNIT): > You can also use MapServer templates to accomplish this. It's a little more work since you have to write the template but it's quite flexible then. Usually I write the template to produce JSON and then use a simple wrapper template to produce JSONP. For example, jsonp.js looks like (callback is passed in): > > // MapServer Template > [callback]( > [include src="templates/json.js"] > ) > > Output formats look like: > > OUTPUTFORMAT > NAME 'JSON' > DRIVER 'TEMPLATE' > MIMETYPE 'application/json;' > FORMATOPTION 'FILE=templates/json.js' > FORMATOPTION 'ATTACHMENT=service.json' > END > > OUTPUTFORMAT > NAME 'JSONP' > DRIVER 'TEMPLATE' > MIMETYPE 'application/json;' > FORMATOPTION 'FILE=templates/jsonp.js' > FORMATOPTION 'ATTACHMENT=service.json' > END > > Steve > > -----Original Message----- > From:mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Lars Fricke > Sent: Monday, December 29, 2014 5:34 AM > To:mapserver-users at lists.osgeo.org > Subject: [mapserver-users] Setting up a JSONP service > > Dear List, > > I have a WFS service running under MapServer that I would like to operate as JSONP service. I managed to set GEOJSON as output format but I get "Cross-Origin-Request Blocked" if I try to call it with a Javascript client (using Leaflet L.layerJSON. > The question is: Is it possible to set up a JSONP service from Mapserver and if yes, how? My current mapfile looks like this (relevant parts): > > " > # in WEB - METADATA > "wfs_getfeature_formatlist" "geojson,csv,ogrgml" > > OUTPUTFORMAT > NAME "geojson" > DRIVER "OGR/GEOJSON" > MIMETYPE "application/json; subtype=geojson; charset=utf-8" > FORMATOPTION "STORAGE=stream" > FORMATOPTION "FORM=SIMPLE" > FORMATOPTION "LCO:COORDINATE_PRECISION=5" > END > " > If this would already be a correct JSONP service, I have to look on the Leaflet side for the error... > Thanks for your help. > > Cheers > > Lars > _______________________________________________ > 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 > From Andreas.Eichner at sid.sachsen.de Fri Jan 9 06:30:28 2015 From: Andreas.Eichner at sid.sachsen.de (Eichner, Andreas - SID) Date: Fri, 9 Jan 2015 14:30:28 +0000 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <54AFAC59.5060604@gisberater.com> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> Message-ID: <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> Hi, I've attached a quick'n dirty solution (against master). When applied to mapogroutput.c you can set a JSONP formatoption to the callback name: OUTPUTFORMAT NAME 'geojson' DRIVER 'OGR/GEOJSON' MIMETYPE 'application/json; subtype=geojson; charset=utf-8' FORMATOPTION 'STORAGE=stream' FORMATOPTION 'FORM=simple' FORMATOPTION 'LCO:COORDINATE_PRECISION=5' FORMATOPTION 'JSONP=%callback%' END This needs of course a WEB.VALIDATION: WEB ... VALIDATION callback '.*' END END Would be great if you can test if this works (looks good to me). The Devs might have a look if this could be integrated into master until OGR has an appropriate layer creation option (solution described by Even). Greetings > -----Urspr?ngliche Nachricht----- > Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- > bounces at lists.osgeo.org] Im Auftrag von Lars Fricke > Gesendet: Freitag, 9. Januar 2015 11:24 > An: mapserver-users at lists.osgeo.org > Betreff: Re: [mapserver-users] Setting up a JSONP service > > Hello, > > first of all: Thank you for your support! > Sorry for the late reply but I unfortunately was ill. > > @ Steve: > I read about templating but also read that it is slower? > I do not have a lot of experience in writing templates. Would you mind > sharing a JSONP template? > > @ Even: Thank you for your thoughts. Who would implement that change > though? I'm afraid I can't. > > @ Jeff: I followed those links but I only found threads referring to > GeoServer or that were not related to my question. The GDAL page I did > study and that's how I managed to set up the GeoJSON service but thats > not the same unfortunately as it conflicts with the same origin policy. > > Best > > Lars > > Am 30.12.2014 um 16:24 schrieb Lime, Steve D (MNIT): > > You can also use MapServer templates to accomplish this. It's a little > more work since you have to write the template but it's quite flexible > then. Usually I write the template to produce JSON and then use a simple > wrapper template to produce JSONP. For example, jsonp.js looks like > (callback is passed in): > > > > // MapServer Template > > [callback]( > > [include src="templates/json.js"] > > ) > > > > Output formats look like: > > > > OUTPUTFORMAT > > NAME 'JSON' > > DRIVER 'TEMPLATE' > > MIMETYPE 'application/json;' > > FORMATOPTION 'FILE=templates/json.js' > > FORMATOPTION 'ATTACHMENT=service.json' > > END > > > > OUTPUTFORMAT > > NAME 'JSONP' > > DRIVER 'TEMPLATE' > > MIMETYPE 'application/json;' > > FORMATOPTION 'FILE=templates/jsonp.js' > > FORMATOPTION 'ATTACHMENT=service.json' > > END > > > > Steve > > > > -----Original Message----- > > From:mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- > bounces at lists.osgeo.org] On Behalf Of Lars Fricke > > Sent: Monday, December 29, 2014 5:34 AM > > To:mapserver-users at lists.osgeo.org > > Subject: [mapserver-users] Setting up a JSONP service > > > > Dear List, > > > > I have a WFS service running under MapServer that I would like to > operate as JSONP service. I managed to set GEOJSON as output format but I > get "Cross-Origin-Request Blocked" if I try to call it with a Javascript > client (using Leaflet L.layerJSON. > > The question is: Is it possible to set up a JSONP service from Mapserver > and if yes, how? My current mapfile looks like this (relevant parts): > > > > " > > # in WEB - METADATA > > "wfs_getfeature_formatlist" "geojson,csv,ogrgml" > > > > OUTPUTFORMAT > > NAME "geojson" > > DRIVER "OGR/GEOJSON" > > MIMETYPE "application/json; subtype=geojson; charset=utf-8" > > FORMATOPTION "STORAGE=stream" > > FORMATOPTION "FORM=SIMPLE" > > FORMATOPTION "LCO:COORDINATE_PRECISION=5" > > END > > " > > If this would already be a correct JSONP service, I have to look on the > Leaflet side for the error... > > Thanks for your help. > > > > Cheers > > > > Lars > > _______________________________________________ > > mapserver-users mailing list > > mapserver-users at lists.osgeo.org > > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > _______________________________________________ > > mapserver-users mailing list > > mapserver-users at lists.osgeo.org > > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- A non-text attachment was scrubbed... Name: jsonp.diff Type: application/octet-stream Size: 964 bytes Desc: jsonp.diff URL: From arne at tiledmarble.org Sat Jan 10 03:41:50 2015 From: arne at tiledmarble.org (Arne Kepp) Date: Sat, 10 Jan 2015 12:41:50 +0100 Subject: [mapserver-users] Spatial access restriction based on "secret" in URL, WMS Getcapabilities Message-ID: <54B10FFE.9050403@tiledmarble.org> Hi, I would like to restrict different users to different geographic regions based on a secret in the URL they are using to access MapServer. I intend to use an inner join on a table with secrets / polygons, and then use the run-time substitution in MapServer to insert the sanitized secret into the Postgis query. The crux, I think, is that I have to send WMS 1.3.0 GetCapabilities URLs to our users. And I don't think I can make the getcapabilties document include the (variable) secret in the OnlineResource elements ? So I am thinking about writing a wrapper that rewrites the GetCapabilities document on the fly. My question is, is there a better way that I have not thought of? Kind regards, Arne -------------- next part -------------- An HTML attachment was scrubbed... URL: From theduckylittle at gmail.com Sat Jan 10 04:30:03 2015 From: theduckylittle at gmail.com (Dan Little) Date: Sat, 10 Jan 2015 06:30:03 -0600 Subject: [mapserver-users] Spatial access restriction based on "secret" in URL, WMS Getcapabilities In-Reply-To: <54B10FFE.9050403@tiledmarble.org> References: <54B10FFE.9050403@tiledmarble.org> Message-ID: I'd probably do something with a script and some URL rewriting. For example, a URL like... - http://myserver.whee/path/SECRET_CODE/mapserv?[WMS parameters] Then do the following: 1. Low-buck: Use apache rewrite rules to set an environment variable. Then use the environment variable for my substitutions. 2. Using WSGI (I'm a python kind of guy): Parse the URL to get the secret to do the limiting. Really this kind of stuff is always application specific, and you are ultimately the person who needs to maintain it, so stick to what you'll be able to understand 6-months after you've implemented it. :-) On Sat, Jan 10, 2015 at 5:41 AM, Arne Kepp wrote: > Hi, > > I would like to restrict different users to different geographic regions > based on a secret in the URL they are using to access MapServer. > > I intend to use an inner join on a table with secrets / polygons, and then > use the run-time substitution in MapServer to insert the sanitized secret > into the Postgis query. > > The crux, I think, is that I have to send WMS 1.3.0 GetCapabilities URLs to > our users. And I don't think I can make the getcapabilties document include > the (variable) secret in the OnlineResource elements ? > > So I am thinking about writing a wrapper that rewrites the GetCapabilities > document on the fly. My question is, is there a better way that I have not > thought of? > > Kind regards, > Arne > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users From arne at tiledmarble.org Sat Jan 10 04:55:59 2015 From: arne at tiledmarble.org (Arne Kepp) Date: Sat, 10 Jan 2015 13:55:59 +0100 Subject: [mapserver-users] Spatial access restriction based on "secret" in URL, WMS Getcapabilities In-Reply-To: References: <54B10FFE.9050403@tiledmarble.org> Message-ID: <54B1215F.9090109@tiledmarble.org> If I go with environment variables and 1), how do I get SECRET_CODE into the URLs in the GetCapabilities document ? I'm assuming I need to modify wms_onlineresource ? It would be really cool if .map files automatically substituted $variables in general, beyond what [1] covers. -Arne 1: https://trac.osgeo.org/mapserver/wiki/EnvironmentVariables On 10/01/15 13:30 , Dan Little wrote: > I'd probably do something with a script and some URL rewriting. > > For example, a URL like... > - http://myserver.whee/path/SECRET_CODE/mapserv?[WMS parameters] > > Then do the following: > 1. Low-buck: Use apache rewrite rules to set an environment variable. > Then use the environment variable for my substitutions. > 2. Using WSGI (I'm a python kind of guy): Parse the URL to get the > secret to do the limiting. > > Really this kind of stuff is always application specific, and you are > ultimately the person who needs to maintain it, so stick to what > you'll be able to understand 6-months after you've implemented it. :-) > > > On Sat, Jan 10, 2015 at 5:41 AM, Arne Kepp wrote: >> Hi, >> >> I would like to restrict different users to different geographic regions >> based on a secret in the URL they are using to access MapServer. >> >> I intend to use an inner join on a table with secrets / polygons, and then >> use the run-time substitution in MapServer to insert the sanitized secret >> into the Postgis query. >> >> The crux, I think, is that I have to send WMS 1.3.0 GetCapabilities URLs to >> our users. And I don't think I can make the getcapabilties document include >> the (variable) secret in the OnlineResource elements ? >> >> So I am thinking about writing a wrapper that rewrites the GetCapabilities >> document on the fly. My question is, is there a better way that I have not >> thought of? >> >> Kind regards, >> Arne >> >> _______________________________________________ >> mapserver-users mailing list >> mapserver-users at lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/mapserver-users From theduckylittle at gmail.com Sat Jan 10 05:07:41 2015 From: theduckylittle at gmail.com (Dan Little) Date: Sat, 10 Jan 2015 07:07:41 -0600 Subject: [mapserver-users] Spatial access restriction based on "secret" in URL, WMS Getcapabilities In-Reply-To: <54B1215F.9090109@tiledmarble.org> References: <54B10FFE.9050403@tiledmarble.org> <54B1215F.9090109@tiledmarble.org> Message-ID: If you launder everything through a script (in any of your favorite languages) you can capture the output stream before you send it back to the user. When my Mapserver-fu runs out I tend to go with scripting. On Sat, Jan 10, 2015 at 6:55 AM, Arne Kepp wrote: > If I go with environment variables and 1), how do I get SECRET_CODE into the > URLs in the GetCapabilities document ? > > I'm assuming I need to modify wms_onlineresource ? > > > It would be really cool if .map files automatically substituted $variables > in general, beyond what [1] covers. > > -Arne > > 1: https://trac.osgeo.org/mapserver/wiki/EnvironmentVariables > > > > > On 10/01/15 13:30 , Dan Little wrote: >> >> I'd probably do something with a script and some URL rewriting. >> >> For example, a URL like... >> - http://myserver.whee/path/SECRET_CODE/mapserv?[WMS parameters] >> >> Then do the following: >> 1. Low-buck: Use apache rewrite rules to set an environment variable. >> Then use the environment variable for my substitutions. >> 2. Using WSGI (I'm a python kind of guy): Parse the URL to get the >> secret to do the limiting. >> >> Really this kind of stuff is always application specific, and you are >> ultimately the person who needs to maintain it, so stick to what >> you'll be able to understand 6-months after you've implemented it. :-) >> >> >> On Sat, Jan 10, 2015 at 5:41 AM, Arne Kepp wrote: >>> >>> Hi, >>> >>> I would like to restrict different users to different geographic regions >>> based on a secret in the URL they are using to access MapServer. >>> >>> I intend to use an inner join on a table with secrets / polygons, and >>> then >>> use the run-time substitution in MapServer to insert the sanitized secret >>> into the Postgis query. >>> >>> The crux, I think, is that I have to send WMS 1.3.0 GetCapabilities URLs >>> to >>> our users. And I don't think I can make the getcapabilties document >>> include >>> the (variable) secret in the OnlineResource elements ? >>> >>> So I am thinking about writing a wrapper that rewrites the >>> GetCapabilities >>> document on the fly. My question is, is there a better way that I have >>> not >>> thought of? >>> >>> Kind regards, >>> Arne >>> >>> _______________________________________________ >>> mapserver-users mailing list >>> mapserver-users at lists.osgeo.org >>> http://lists.osgeo.org/mailman/listinfo/mapserver-users > > From gamejihou at hotmail.com Sat Jan 10 06:16:54 2015 From: gamejihou at hotmail.com (Gery .) Date: Sat, 10 Jan 2015 14:16:54 +0000 Subject: [mapserver-users] =?utf-8?q?compiling_error_core=2Ec_in_mapcache_?= =?utf-8?q?with_cygwin?= Message-ID: sorry for bumping this one, but any clue about this core.c issue? Sent from Windows Mail -------------- next part -------------- An HTML attachment was scrubbed... URL: From gamejihou at hotmail.com Sat Jan 10 06:23:03 2015 From: gamejihou at hotmail.com (Gery) Date: Sat, 10 Jan 2015 06:23:03 -0800 (PST) Subject: [mapserver-users] compiling error core.c in mapcache with cygwin In-Reply-To: <1420639144277-5180356.post@n6.nabble.com> References: <54A8036D.6090609@squeakycode.net> <1420639144277-5180356.post@n6.nabble.com> Message-ID: <1420899783125-5180931.post@n6.nabble.com> sorry for bumping this post, but any clues about this issue with core.c? any ideas how to solve this core.c error message with the cygwin details I previously posted? It'd be great your support on this, thanks in advance. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/compiling-error-core-c-in-mapcache-with-cygwin-tp5179881p5180931.html Sent from the Mapserver - User mailing list archive at Nabble.com. From ahmettemiz88 at gmail.com Sat Jan 10 08:58:22 2015 From: ahmettemiz88 at gmail.com (Ahmet Temiz) Date: Sat, 10 Jan 2015 18:58:22 +0200 Subject: [mapserver-users] (no subject) Message-ID: hello I just want to test outputformat geojson ? Is there any tool like shp2img to test geojson output ? regards -- Ahmet Temiz Jeoloji M?h. Afet ve Acil Durum Y?netimi Ba?kanl??? Planlama ve Zarar Azaltma Dairesi Ba?kanl??? ________________________ Ahmet Temiz Geological Eng. Information Systems - GIS Group Disaster and Emergency Management of Presidency -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at squeakycode.net Sat Jan 10 10:41:47 2015 From: andy at squeakycode.net (Andy Colson) Date: Sat, 10 Jan 2015 12:41:47 -0600 Subject: [mapserver-users] compiling error core.c in mapcache with cygwin In-Reply-To: <1420899783125-5180931.post@n6.nabble.com> References: <54A8036D.6090609@squeakycode.net> <1420639144277-5180356.post@n6.nabble.com> <1420899783125-5180931.post@n6.nabble.com> Message-ID: <54B1726B.3030403@squeakycode.net> On 01/10/2015 08:23 AM, Gery wrote: > sorry for bumping this post, but any clues about this issue with core.c? any > ideas how to solve this core.c error message with the cygwin details I > previously posted? > > It'd be great your support on this, thanks in advance. > Sorry, no idea. If you wanted to check some things: near the top of core.c, there are probably includes for apr. You could make sure they are actually included for cygwin (ifdef's for example). (It could also be in core.h if there is one) You could also make sure you dont have any duplicate apr headers. Maybe one of your headers has the same name as one of theirs and your's is being included instead of the apr one. Maybe old copies of apr headers lying around? Does cygwin apr even support threads? Maybe a quick test.c that includes apr and tries to use apr_thread_t might help. -Andy From andy at squeakycode.net Sat Jan 10 11:12:42 2015 From: andy at squeakycode.net (Andy Colson) Date: Sat, 10 Jan 2015 13:12:42 -0600 Subject: [mapserver-users] compiling error core.c in mapcache with cygwin In-Reply-To: <54B1726B.3030403@squeakycode.net> References: <54A8036D.6090609@squeakycode.net> <1420639144277-5180356.post@n6.nabble.com> <1420899783125-5180931.post@n6.nabble.com> <54B1726B.3030403@squeakycode.net> Message-ID: <54B179AA.2040004@squeakycode.net> I found a simple c test here: http://dev.ariel-networks.com/apr/apr-tutorial/html/apr-tutorial-16.html links to the test .c here: http://dev.ariel-networks.com/apr/apr-tutorial/sample/thread-sample.c I compiled it with: gcc -Wall $(apr-1-config --cflags --cppflags --includes --link-ld) thread-sample.c and ./a.out ran fine. (I'm on slackware linux though. I don't have a windows box handy) -Andy From thomas.bonfort at gmail.com Sat Jan 10 15:50:53 2015 From: thomas.bonfort at gmail.com (thomas bonfort) Date: Sun, 11 Jan 2015 00:50:53 +0100 Subject: [mapserver-users] compiling error core.c in mapcache with cygwin In-Reply-To: References: Message-ID: What apr version are you using? On Jan 3, 2015 10:15 PM, "Gery ." wrote: > Hello, > > When installing mapcache in cygwin, `make` produced: > > /opt/mapcache/mapcache-rel-1-2-1/lib/core.c: In function > ?mapcache_prefetch_tiles?: > /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:81:3: error: unknown type > name ?apr_thread_t? > apr_thread_t **threads; > ^ > /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:82:3: error: unknown type > name ?apr_threadattr_t? > apr_threadattr_t *thread_attrs; > ^ > /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:83:7: warning: unused > variable ?nthreads? [-Wunused-variable] > int nthreads; > ^ > /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:82:21: warning: unused > variable ?thread_attrs? [-Wunused-variable] > apr_threadattr_t *thread_attrs; > ^ > /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:81:18: warning: unused > variable ?threads? [-Wunused-variable] > apr_thread_t **threads; > ^ > > I searched for some hints about this error but didn't find anything. > Looking for `apr_thread_t` and cygwin, I found some pages pointing to an > error with apache, but not really sure if apache has something to do here. > > thanks for any hints on this, > > Gery > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.bonfort at gmail.com Sat Jan 10 16:02:31 2015 From: thomas.bonfort at gmail.com (thomas bonfort) Date: Sun, 11 Jan 2015 01:02:31 +0100 Subject: [mapserver-users] compiling error core.c in mapcache with cygwin In-Reply-To: References: Message-ID: From http://mail-archives.apache.org/mod_mbox/apr-dev/201209.mbox/%3C4994179EC7ED6843AAB0A30A1639E7F825143612EF at DGEX2V.dg.deltagroup.com%3E it would seem that threads are not supported by Apr on cygwin. Currently mapcache does not support unthreaded environments so there's nothing you can do without hacking the mapcache codebase. I believe the change would not be very extensive as the source WMS fetches only need to be sequentialized instead of parralelized in core.c Thomas. On Jan 11, 2015 7:50 AM, "thomas bonfort" wrote: > What apr version are you using? > On Jan 3, 2015 10:15 PM, "Gery ." wrote: > >> Hello, >> >> When installing mapcache in cygwin, `make` produced: >> >> /opt/mapcache/mapcache-rel-1-2-1/lib/core.c: In function >> ?mapcache_prefetch_tiles?: >> /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:81:3: error: unknown type >> name ?apr_thread_t? >> apr_thread_t **threads; >> ^ >> /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:82:3: error: unknown type >> name ?apr_threadattr_t? >> apr_threadattr_t *thread_attrs; >> ^ >> /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:83:7: warning: unused >> variable ?nthreads? [-Wunused-variable] >> int nthreads; >> ^ >> /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:82:21: warning: unused >> variable ?thread_attrs? [-Wunused-variable] >> apr_threadattr_t *thread_attrs; >> ^ >> /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:81:18: warning: unused >> variable ?threads? [-Wunused-variable] >> apr_thread_t **threads; >> ^ >> >> I searched for some hints about this error but didn't find anything. >> Looking for `apr_thread_t` and cygwin, I found some pages pointing to an >> error with apache, but not really sure if apache has something to do here. >> >> thanks for any hints on this, >> >> Gery >> _______________________________________________ >> mapserver-users mailing list >> mapserver-users at lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/mapserver-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gamejihou at hotmail.com Sun Jan 11 16:46:02 2015 From: gamejihou at hotmail.com (Gery) Date: Sun, 11 Jan 2015 16:46:02 -0800 (PST) Subject: [mapserver-users] compiling error core.c in mapcache with cygwin In-Reply-To: References: Message-ID: Thanks Thomas, I just got an email from the Cygwin mailing list saying that threads were not enabled in the APR library because the unit tests didn't pass with them, so that's the problem as you pointed out. I'd like to hack the mapcache codebase but no idea how to start hacking it to get it working without threads, but if you could give me some hints such as what files are involved (I imagine only core.c), which sections/lines would be involved, sure I could do it, I'd appreciate it. If I get that working, sure other people can test that in Cygwin and your audience will eventually increase :) Gery Sent from my iRon On Jan 10, 2015, at 19:02, "thomas bonfort [via OSGeo.org]" wrote: >From http://mail-archives.apache.org/mod_mbox/apr-dev/201209.mbox/%3C4994179EC7ED6843AAB0A30A1639E7F825143612EF at ...%3E it would seem that threads are not supported by Apr on cygwin. Currently mapcache does not support unthreaded environments so there's nothing you can do without hacking the mapcache codebase. I believe the change would not be very extensive as the source WMS fetches only need to be sequentialized instead of parralelized in core.c Thomas. On Jan 11, 2015 7:50 AM, "thomas bonfort" <[hidden email]> wrote: > What apr version are you using? > On Jan 3, 2015 10:15 PM, "Gery ." <[hidden email]> wrote: >> Hello, >> >> When installing mapcache in cygwin, `make` produced: >> >> /opt/mapcache/mapcache-rel-1-2-1/lib/core.c: In function ?mapcache_prefetch_tiles?: >> /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:81:3: error: unknown type name ?apr_thread_t? >> apr_thread_t **threads; >> ^ >> /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:82:3: error: unknown type name ?apr_threadattr_t? >> apr_threadattr_t *thread_attrs; >> ^ >> /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:83:7: warning: unused variable ?nthreads? [-Wunused-variable] >> int nthreads; >> ^ >> /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:82:21: warning: unused variable ?thread_attrs? [-Wunused-variable] >> apr_threadattr_t *thread_attrs; >> ^ >> /opt/mapcache/mapcache-rel-1-2-1/lib/core.c:81:18: warning: unused variable ?threads? [-Wunused-variable] >> apr_thread_t **threads; >> ^ >> >> I searched for some hints about this error but didn't find anything. Looking for `apr_thread_t` and cygwin, I found some pages pointing to an error with apache, but not really sure if apache has something to do here. >> >> thanks for any hints on this, >> >> Gery >> _______________________________________________ >> mapserver-users mailing list >> [hidden email] >> http://lists.osgeo.org/mailman/listinfo/mapserver-users _______________________________________________ mapserver-users mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/mapserver-users If you reply to this email, your message will be added to the discussion below: http://osgeo-org.1560.x6.nabble.com/compiling-error-core-c-in-mapcache-with-cygwin-tp5179881p5180958.html To unsubscribe from compiling error core.c in mapcache with cygwin, click here. NAML -- View this message in context: http://osgeo-org.1560.x6.nabble.com/compiling-error-core-c-in-mapcache-with-cygwin-tp5179881p5181004.html Sent from the Mapserver - User mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Michael.Smith at erdc.dren.mil Mon Jan 12 05:53:57 2015 From: Michael.Smith at erdc.dren.mil (Smith, Michael ERDC-RDE-CRREL-NH) Date: Mon, 12 Jan 2015 13:53:57 +0000 Subject: [mapserver-users] [EXTERNAL] (no subject) In-Reply-To: References: Message-ID: Ahmet, You can use shp2img to test geojson outputformat. Just use the -i switch to set to your named output format. Mike From: Ahmet Temiz Date: Saturday, January 10, 2015 at 11:58 AM To: mapserver-users Subject: [EXTERNAL] [mapserver-users] (no subject) Resent-From: Michael Smith hello I just want to test outputformat geojson ? Is there any tool like shp2img to test geojson output ? regards -- Ahmet Temiz Jeoloji M?h. Afet ve Acil Durum Y?netimi Ba?kanl??? Planlama ve Zarar Azaltma Dairesi Ba?kanl??? ________________________ Ahmet Temiz Geological Eng. Information Systems - GIS Group Disaster and Emergency Management of Presidency From fricke at gisberater.com Mon Jan 12 23:11:52 2015 From: fricke at gisberater.com (Lars Fricke) Date: Tue, 13 Jan 2015 08:11:52 +0100 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> Message-ID: <54B4C538.5030805@gisberater.com> Hi Andreas, I was on business trip yesterday so I only reply today. I will test this and let you know. I assume I'll have to compile Mapserver including your change. Since so far I used precompiled I guess I'll take some time setting it up to compile. Anyhow I'll keep you posted and thank you very much for your support. Best Lars Am 09.01.2015 um 15:30 schrieb Eichner, Andreas - SID: > Hi, > > I've attached a quick'n dirty solution (against master). When applied to > mapogroutput.c you can set a JSONP formatoption to the callback name: > > OUTPUTFORMAT > NAME 'geojson' > DRIVER 'OGR/GEOJSON' > MIMETYPE 'application/json; subtype=geojson; charset=utf-8' > FORMATOPTION 'STORAGE=stream' > FORMATOPTION 'FORM=simple' > FORMATOPTION 'LCO:COORDINATE_PRECISION=5' > FORMATOPTION 'JSONP=%callback%' > END > > This needs of course a WEB.VALIDATION: > WEB > ... > VALIDATION > callback '.*' > END > END > > Would be great if you can test if this works (looks good to me). The Devs might have a look if this could be integrated into master until OGR has an appropriate layer creation option (solution described by Even). > > Greetings > >> -----Urspr?ngliche Nachricht----- >> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- >> bounces at lists.osgeo.org] Im Auftrag von Lars Fricke >> Gesendet: Freitag, 9. Januar 2015 11:24 >> An: mapserver-users at lists.osgeo.org >> Betreff: Re: [mapserver-users] Setting up a JSONP service >> >> Hello, >> >> first of all: Thank you for your support! >> Sorry for the late reply but I unfortunately was ill. >> >> @ Steve: >> I read about templating but also read that it is slower? >> I do not have a lot of experience in writing templates. Would you mind >> sharing a JSONP template? >> >> @ Even: Thank you for your thoughts. Who would implement that change >> though? I'm afraid I can't. >> >> @ Jeff: I followed those links but I only found threads referring to >> GeoServer or that were not related to my question. The GDAL page I did >> study and that's how I managed to set up the GeoJSON service but thats >> not the same unfortunately as it conflicts with the same origin policy. >> >> Best >> >> Lars >> >> Am 30.12.2014 um 16:24 schrieb Lime, Steve D (MNIT): >>> You can also use MapServer templates to accomplish this. It's a little >> more work since you have to write the template but it's quite flexible >> then. Usually I write the template to produce JSON and then use a simple >> wrapper template to produce JSONP. For example, jsonp.js looks like >> (callback is passed in): >>> // MapServer Template >>> [callback]( >>> [include src="templates/json.js"] >>> ) >>> >>> Output formats look like: >>> >>> OUTPUTFORMAT >>> NAME 'JSON' >>> DRIVER 'TEMPLATE' >>> MIMETYPE 'application/json;' >>> FORMATOPTION 'FILE=templates/json.js' >>> FORMATOPTION 'ATTACHMENT=service.json' >>> END >>> >>> OUTPUTFORMAT >>> NAME 'JSONP' >>> DRIVER 'TEMPLATE' >>> MIMETYPE 'application/json;' >>> FORMATOPTION 'FILE=templates/jsonp.js' >>> FORMATOPTION 'ATTACHMENT=service.json' >>> END >>> >>> Steve >>> >>> -----Original Message----- >>> From:mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- >> bounces at lists.osgeo.org] On Behalf Of Lars Fricke >>> Sent: Monday, December 29, 2014 5:34 AM >>> To:mapserver-users at lists.osgeo.org >>> Subject: [mapserver-users] Setting up a JSONP service >>> >>> Dear List, >>> >>> I have a WFS service running under MapServer that I would like to >> operate as JSONP service. I managed to set GEOJSON as output format but I >> get "Cross-Origin-Request Blocked" if I try to call it with a Javascript >> client (using Leaflet L.layerJSON. >>> The question is: Is it possible to set up a JSONP service from Mapserver >> and if yes, how? My current mapfile looks like this (relevant parts): >>> " >>> # in WEB - METADATA >>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" >>> >>> OUTPUTFORMAT >>> NAME "geojson" >>> DRIVER "OGR/GEOJSON" >>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" >>> FORMATOPTION "STORAGE=stream" >>> FORMATOPTION "FORM=SIMPLE" >>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" >>> END >>> " >>> If this would already be a correct JSONP service, I have to look on the >> Leaflet side for the error... >>> Thanks for your help. >>> >>> Cheers >>> >>> Lars >>> _______________________________________________ >>> mapserver-users mailing list >>> mapserver-users at lists.osgeo.org >>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>> _______________________________________________ >>> mapserver-users mailing list >>> mapserver-users at lists.osgeo.org >>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>> >> _______________________________________________ >> mapserver-users mailing list >> mapserver-users at lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/mapserver-users From fricke at gisberater.com Tue Jan 13 02:04:06 2015 From: fricke at gisberater.com (Lars Fricke) Date: Tue, 13 Jan 2015 11:04:06 +0100 Subject: [mapserver-users] (no subject) In-Reply-To: References: Message-ID: <54B4ED96.2070804@gisberater.com> An HTML attachment was scrubbed... URL: From fricke at gisberater.com Tue Jan 13 05:21:43 2015 From: fricke at gisberater.com (Lars Fricke) Date: Tue, 13 Jan 2015 14:21:43 +0100 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> Message-ID: <54B51BE7.3090409@gisberater.com> Hi, I compiled MapServer after applying the patch (at least I think it was applied). Unfortunately the output is not JSONP format. Maybe I'm getting something wrong. So here is what I did: Applied patch -p1 < jsonp.diff I got an updated mapogroutput.c. I then compiled with the following options: cmake -DCMAKE_INSTALL_PREFIX=/opt \ -DCMAKE_PREFIX_PATH="/usr/local;/opt" \ -DWITH_CLIENT_WFS=ON \ -DWITH_CLIENT_WMS=ON \ -DWITH_CURL=ON \ -DWITH_SOS=ON \ -DWITH_PHP=0 \ -DWITH_PYTHON=ON \ -DWITH_SVGCAIRO=OFF \ -DWITH_ORACLESPATIAL=0 \ -DWITH_MSSQL2008=OFF \ -DWITH_THREAD_SAFETY=ON \ -DWITH_LIBXML2=ON \ -DWITH_MYSQL=ON\ -DWITH_SDE=0 .. >../configure.out.txt Which goes through without any warning. I do make next, getting a few warnings about the Python bindings but nothing about mapogroutput (ecept that it was compiled). Then sudo make install. No warnings. I then set a symlink to the new mapserv file inside cgi-bin and start my apache. I changed my mapfile as you indicated: WEB FOOTER "test" IMAGEPATH "/var/www/html/tmp/" TEMPPATH "/var/www/html/tmp/" IMAGEURL "/html/tmp/" METADATA "wfs_title" "Test" "ows_onlineresource" "http://localhost:8082/wfs?" "ows_enable_request" "*" "ows_srs" "EPSG:3857" "wfs_srs" "EPSG:3857" "wfs_getfeature_formatlist" "geojson,csv,ogrgml" "wfs_encoding" "UTF-8" END # METADATA VALIDATION callback ".*" END END # WEB OUTPUTFORMAT NAME "geojson" DRIVER "OGR/GEOJSON" MIMETYPE "application/json; subtype=geojson; charset=utf-8" FORMATOPTION "STORAGE=stream" FORMATOPTION "FORM=SIMPLE" FORMATOPTION "LCO:COORDINATE_PRECISION=5" FORMATOPTION "JSONP=%callback%" END Unfortunately calling: http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYPENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,6570228 gives me a result as before without your changes: { "type": "FeatureCollection", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::3857" } }, "features": [ { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ 793757.73417, 6570202.31642 ] ] ] } }, { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ 793752.31968, 6570224.89917 ] ] ] } }, { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ 793735.55884, 6570231.00753 ] ] ] } } ] } I also tried this with an AJAX call from Javascript, giving me the exactly same result. I get an error message trying to use the result in Leaflet telling me a ";" is missing. I assume it should look like this: var testlayer = [{ "type": "FeatureCollection", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::3857" } }, "features": [ { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ 793757.73417, 6570202.31642 ] ] ] } }, { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ 793752.31968, 6570224.89917 ] ] ] } }, { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ 793735.55884, 6570231.00753 ] ] ] } } ] }]; I'm not sure what is going on. Am I not applying the changes correctly or is my call wrong? Thanks for you great support. Best Lars Am 09.01.2015 um 15:30 schrieb Eichner, Andreas - SID: > Hi, > > I've attached a quick'n dirty solution (against master). When applied to > mapogroutput.c you can set a JSONP formatoption to the callback name: > > OUTPUTFORMAT > NAME 'geojson' > DRIVER 'OGR/GEOJSON' > MIMETYPE 'application/json; subtype=geojson; charset=utf-8' > FORMATOPTION 'STORAGE=stream' > FORMATOPTION 'FORM=simple' > FORMATOPTION 'LCO:COORDINATE_PRECISION=5' > FORMATOPTION 'JSONP=%callback%' > END > > This needs of course a WEB.VALIDATION: > WEB > ... > VALIDATION > callback '.*' > END > END > > Would be great if you can test if this works (looks good to me). The Devs might have a look if this could be integrated into master until OGR has an appropriate layer creation option (solution described by Even). > > Greetings > >> -----Urspr?ngliche Nachricht----- >> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- >> bounces at lists.osgeo.org] Im Auftrag von Lars Fricke >> Gesendet: Freitag, 9. Januar 2015 11:24 >> An: mapserver-users at lists.osgeo.org >> Betreff: Re: [mapserver-users] Setting up a JSONP service >> >> Hello, >> >> first of all: Thank you for your support! >> Sorry for the late reply but I unfortunately was ill. >> >> @ Steve: >> I read about templating but also read that it is slower? >> I do not have a lot of experience in writing templates. Would you mind >> sharing a JSONP template? >> >> @ Even: Thank you for your thoughts. Who would implement that change >> though? I'm afraid I can't. >> >> @ Jeff: I followed those links but I only found threads referring to >> GeoServer or that were not related to my question. The GDAL page I did >> study and that's how I managed to set up the GeoJSON service but thats >> not the same unfortunately as it conflicts with the same origin policy. >> >> Best >> >> Lars >> >> Am 30.12.2014 um 16:24 schrieb Lime, Steve D (MNIT): >>> You can also use MapServer templates to accomplish this. It's a little >> more work since you have to write the template but it's quite flexible >> then. Usually I write the template to produce JSON and then use a simple >> wrapper template to produce JSONP. For example, jsonp.js looks like >> (callback is passed in): >>> // MapServer Template >>> [callback]( >>> [include src="templates/json.js"] >>> ) >>> >>> Output formats look like: >>> >>> OUTPUTFORMAT >>> NAME 'JSON' >>> DRIVER 'TEMPLATE' >>> MIMETYPE 'application/json;' >>> FORMATOPTION 'FILE=templates/json.js' >>> FORMATOPTION 'ATTACHMENT=service.json' >>> END >>> >>> OUTPUTFORMAT >>> NAME 'JSONP' >>> DRIVER 'TEMPLATE' >>> MIMETYPE 'application/json;' >>> FORMATOPTION 'FILE=templates/jsonp.js' >>> FORMATOPTION 'ATTACHMENT=service.json' >>> END >>> >>> Steve >>> >>> -----Original Message----- >>> From:mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- >> bounces at lists.osgeo.org] On Behalf Of Lars Fricke >>> Sent: Monday, December 29, 2014 5:34 AM >>> To:mapserver-users at lists.osgeo.org >>> Subject: [mapserver-users] Setting up a JSONP service >>> >>> Dear List, >>> >>> I have a WFS service running under MapServer that I would like to >> operate as JSONP service. I managed to set GEOJSON as output format but I >> get "Cross-Origin-Request Blocked" if I try to call it with a Javascript >> client (using Leaflet L.layerJSON. >>> The question is: Is it possible to set up a JSONP service from Mapserver >> and if yes, how? My current mapfile looks like this (relevant parts): >>> " >>> # in WEB - METADATA >>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" >>> >>> OUTPUTFORMAT >>> NAME "geojson" >>> DRIVER "OGR/GEOJSON" >>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" >>> FORMATOPTION "STORAGE=stream" >>> FORMATOPTION "FORM=SIMPLE" >>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" >>> END >>> " >>> If this would already be a correct JSONP service, I have to look on the >> Leaflet side for the error... >>> Thanks for your help. >>> >>> Cheers >>> >>> Lars >>> _______________________________________________ >>> mapserver-users mailing list >>> mapserver-users at lists.osgeo.org >>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>> _______________________________________________ >>> mapserver-users mailing list >>> mapserver-users at lists.osgeo.org >>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>> >> _______________________________________________ >> mapserver-users mailing list >> mapserver-users at lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/mapserver-users From Andreas.Eichner at sid.sachsen.de Tue Jan 13 06:18:12 2015 From: Andreas.Eichner at sid.sachsen.de (Eichner, Andreas - SID) Date: Tue, 13 Jan 2015 14:18:12 +0000 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <54B51BE7.3090409@gisberater.com> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> <54B51BE7.3090409@gisberater.com> Message-ID: <6F331135492B944D90731CE93743D5681BC6AA@FS-EX-DB102.fs.sachsen.de> You need to append the "callback" parameter to the query string: http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYPENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,6570228&callback=foobar You can test on the command line, too: MS_MAPFILE=/path/to/mapfile ./mapserv QUERY_STRING='service=WFS&version=1.1.0&request=GetFeature&typename=HU& SRS=EPSG:3857&bbox=793732,6570204,793765,6570228&outputformat=application/json; subtype=geojson; charset=utf-8&callback=foobar' Please note that IMHO "geojson" alone isn't enough. The full mimetype string should be used as reported by GetCapabilities. HTH > -----Urspr?ngliche Nachricht----- > Von: Lars Fricke [mailto:fricke at gisberater.com] > Gesendet: Dienstag, 13. Januar 2015 14:22 > An: Eichner, Andreas - SID; mapserver-users at lists.osgeo.org > Betreff: Re: [mapserver-users] Setting up a JSONP service > > Hi, > > I compiled MapServer after applying the patch (at least I think it was > applied). Unfortunately the output is not JSONP format. Maybe I'm > getting something wrong. So here is what I did: > Applied > patch -p1 < jsonp.diff > > I got an updated mapogroutput.c. > > I then compiled with the following options: > cmake -DCMAKE_INSTALL_PREFIX=/opt \ > -DCMAKE_PREFIX_PATH="/usr/local;/opt" \ > -DWITH_CLIENT_WFS=ON \ > -DWITH_CLIENT_WMS=ON \ > -DWITH_CURL=ON \ > -DWITH_SOS=ON \ > -DWITH_PHP=0 \ > -DWITH_PYTHON=ON \ > -DWITH_SVGCAIRO=OFF \ > -DWITH_ORACLESPATIAL=0 \ > -DWITH_MSSQL2008=OFF \ > -DWITH_THREAD_SAFETY=ON \ > -DWITH_LIBXML2=ON \ > -DWITH_MYSQL=ON\ > -DWITH_SDE=0 .. >../configure.out.txt > > Which goes through without any warning. > > I do make next, getting a few warnings about the Python bindings but > nothing about mapogroutput (ecept that it was compiled). Then sudo make > install. No warnings. > I then set a symlink to the new mapserv file inside cgi-bin and start my > apache. > > I changed my mapfile as you indicated: > WEB > FOOTER "test" > IMAGEPATH "/var/www/html/tmp/" > TEMPPATH "/var/www/html/tmp/" > IMAGEURL "/html/tmp/" > METADATA > "wfs_title" "Test" > "ows_onlineresource" "http://localhost:8082/wfs?" > "ows_enable_request" "*" > "ows_srs" "EPSG:3857" > "wfs_srs" "EPSG:3857" > "wfs_getfeature_formatlist" "geojson,csv,ogrgml" > "wfs_encoding" "UTF-8" > END # METADATA > VALIDATION > callback ".*" > END > END # WEB > > OUTPUTFORMAT > NAME "geojson" > DRIVER "OGR/GEOJSON" > MIMETYPE "application/json; subtype=geojson; charset=utf-8" > FORMATOPTION "STORAGE=stream" > FORMATOPTION "FORM=SIMPLE" > FORMATOPTION "LCO:COORDINATE_PRECISION=5" > FORMATOPTION "JSONP=%callback%" > END > > Unfortunately calling: > http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP > ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 > 0228 > > gives me a result as before without your changes: > { > "type": "FeatureCollection", > "crs": { "type": "name", "properties": { "name": > "urn:ogc:def:crs:EPSG::3857" } }, > "features": [ > { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ > 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ > 793757.73417, 6570202.31642 ] ] ] } }, > { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ > 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ > 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ > 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ > 793752.31968, 6570224.89917 ] ] ] } }, > { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ > 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ > 793735.55884, 6570231.00753 ] ] ] } } > ] > } > > I also tried this with an AJAX call from Javascript, giving me the > exactly same result. > > I get an error message trying to use the result in Leaflet telling me a > ";" is missing. I assume it should look like this: > > var testlayer = [{ > "type": "FeatureCollection", > "crs": { "type": "name", "properties": { "name": > "urn:ogc:def:crs:EPSG::3857" } }, > "features": [ > { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ > 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ > 793757.73417, 6570202.31642 ] ] ] } }, > { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ > 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ > 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ > 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ > 793752.31968, 6570224.89917 ] ] ] } }, > { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ > 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ > 793735.55884, 6570231.00753 ] ] ] } } > ] > }]; > > I'm not sure what is going on. Am I not applying the changes correctly > or is my call wrong? > > Thanks for you great support. > > Best > > Lars > > > Am 09.01.2015 um 15:30 schrieb Eichner, Andreas - SID: > > Hi, > > > > I've attached a quick'n dirty solution (against master). When applied to > > mapogroutput.c you can set a JSONP formatoption to the callback name: > > > > OUTPUTFORMAT > > NAME 'geojson' > > DRIVER 'OGR/GEOJSON' > > MIMETYPE 'application/json; subtype=geojson; charset=utf-8' > > FORMATOPTION 'STORAGE=stream' > > FORMATOPTION 'FORM=simple' > > FORMATOPTION 'LCO:COORDINATE_PRECISION=5' > > FORMATOPTION 'JSONP=%callback%' > > END > > > > This needs of course a WEB.VALIDATION: > > WEB > > ... > > VALIDATION > > callback '.*' > > END > > END > > > > Would be great if you can test if this works (looks good to me). The > Devs might have a look if this could be integrated into master until OGR > has an appropriate layer creation option (solution described by Even). > > > > Greetings > > > >> -----Urspr?ngliche Nachricht----- > >> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- > >> bounces at lists.osgeo.org] Im Auftrag von Lars Fricke > >> Gesendet: Freitag, 9. Januar 2015 11:24 > >> An: mapserver-users at lists.osgeo.org > >> Betreff: Re: [mapserver-users] Setting up a JSONP service > >> > >> Hello, > >> > >> first of all: Thank you for your support! > >> Sorry for the late reply but I unfortunately was ill. > >> > >> @ Steve: > >> I read about templating but also read that it is slower? > >> I do not have a lot of experience in writing templates. Would you mind > >> sharing a JSONP template? > >> > >> @ Even: Thank you for your thoughts. Who would implement that change > >> though? I'm afraid I can't. > >> > >> @ Jeff: I followed those links but I only found threads referring to > >> GeoServer or that were not related to my question. The GDAL page I did > >> study and that's how I managed to set up the GeoJSON service but thats > >> not the same unfortunately as it conflicts with the same origin policy. > >> > >> Best > >> > >> Lars > >> > >> Am 30.12.2014 um 16:24 schrieb Lime, Steve D (MNIT): > >>> You can also use MapServer templates to accomplish this. It's a little > >> more work since you have to write the template but it's quite flexible > >> then. Usually I write the template to produce JSON and then use a > simple > >> wrapper template to produce JSONP. For example, jsonp.js looks like > >> (callback is passed in): > >>> // MapServer Template > >>> [callback]( > >>> [include src="templates/json.js"] > >>> ) > >>> > >>> Output formats look like: > >>> > >>> OUTPUTFORMAT > >>> NAME 'JSON' > >>> DRIVER 'TEMPLATE' > >>> MIMETYPE 'application/json;' > >>> FORMATOPTION 'FILE=templates/json.js' > >>> FORMATOPTION 'ATTACHMENT=service.json' > >>> END > >>> > >>> OUTPUTFORMAT > >>> NAME 'JSONP' > >>> DRIVER 'TEMPLATE' > >>> MIMETYPE 'application/json;' > >>> FORMATOPTION 'FILE=templates/jsonp.js' > >>> FORMATOPTION 'ATTACHMENT=service.json' > >>> END > >>> > >>> Steve > >>> > >>> -----Original Message----- > >>> From:mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- > >> bounces at lists.osgeo.org] On Behalf Of Lars Fricke > >>> Sent: Monday, December 29, 2014 5:34 AM > >>> To:mapserver-users at lists.osgeo.org > >>> Subject: [mapserver-users] Setting up a JSONP service > >>> > >>> Dear List, > >>> > >>> I have a WFS service running under MapServer that I would like to > >> operate as JSONP service. I managed to set GEOJSON as output format but > I > >> get "Cross-Origin-Request Blocked" if I try to call it with a > Javascript > >> client (using Leaflet L.layerJSON. > >>> The question is: Is it possible to set up a JSONP service from > Mapserver > >> and if yes, how? My current mapfile looks like this (relevant parts): > >>> " > >>> # in WEB - METADATA > >>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" > >>> > >>> OUTPUTFORMAT > >>> NAME "geojson" > >>> DRIVER "OGR/GEOJSON" > >>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" > >>> FORMATOPTION "STORAGE=stream" > >>> FORMATOPTION "FORM=SIMPLE" > >>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" > >>> END > >>> " > >>> If this would already be a correct JSONP service, I have to look on > the > >> Leaflet side for the error... > >>> Thanks for your help. > >>> > >>> Cheers > >>> > >>> Lars > >>> _______________________________________________ > >>> mapserver-users mailing list > >>> mapserver-users at lists.osgeo.org > >>> http://lists.osgeo.org/mailman/listinfo/mapserver-users > >>> _______________________________________________ > >>> mapserver-users mailing list > >>> mapserver-users at lists.osgeo.org > >>> http://lists.osgeo.org/mailman/listinfo/mapserver-users > >>> > >> _______________________________________________ > >> mapserver-users mailing list > >> mapserver-users at lists.osgeo.org > >> http://lists.osgeo.org/mailman/listinfo/mapserver-users From Andreas.Eichner at sid.sachsen.de Tue Jan 13 06:57:53 2015 From: Andreas.Eichner at sid.sachsen.de (Eichner, Andreas - SID) Date: Tue, 13 Jan 2015 14:57:53 +0000 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <6F331135492B944D90731CE93743D5681BC6AA@FS-EX-DB102.fs.sachsen.de> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> <54B51BE7.3090409@gisberater.com> <6F331135492B944D90731CE93743D5681BC6AA@FS-EX-DB102.fs.sachsen.de> Message-ID: <6F331135492B944D90731CE93743D5681BC6B8@FS-EX-DB102.fs.sachsen.de> Arg.. outputformat=geojson also works, only had a typo... > -----Urspr?ngliche Nachricht----- > Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- > bounces at lists.osgeo.org] Im Auftrag von Eichner, Andreas - SID > Gesendet: Dienstag, 13. Januar 2015 15:18 > An: 'lars.fricke at skendata.de'; mapserver-users at lists.osgeo.org > Betreff: Re: [mapserver-users] Setting up a JSONP service > > You need to append the "callback" parameter to the query string: > > http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP > ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 > 0228&callback=foobar > > You can test on the command line, too: > MS_MAPFILE=/path/to/mapfile ./mapserv > QUERY_STRING='service=WFS&version=1.1.0&request=GetFeature&typename=HU& > SRS=EPSG:3857&bbox=793732,6570204,793765,6570228&outputformat=application/ > json; subtype=geojson; charset=utf-8&callback=foobar' > > Please note that IMHO "geojson" alone isn't enough. The full mimetype > string should be used as reported by GetCapabilities. > > HTH > > > -----Urspr?ngliche Nachricht----- > > Von: Lars Fricke [mailto:fricke at gisberater.com] > > Gesendet: Dienstag, 13. Januar 2015 14:22 > > An: Eichner, Andreas - SID; mapserver-users at lists.osgeo.org > > Betreff: Re: [mapserver-users] Setting up a JSONP service > > > > Hi, > > > > I compiled MapServer after applying the patch (at least I think it was > > applied). Unfortunately the output is not JSONP format. Maybe I'm > > getting something wrong. So here is what I did: > > Applied > > patch -p1 < jsonp.diff > > > > I got an updated mapogroutput.c. > > > > I then compiled with the following options: > > cmake -DCMAKE_INSTALL_PREFIX=/opt \ > > -DCMAKE_PREFIX_PATH="/usr/local;/opt" \ > > -DWITH_CLIENT_WFS=ON \ > > -DWITH_CLIENT_WMS=ON \ > > -DWITH_CURL=ON \ > > -DWITH_SOS=ON \ > > -DWITH_PHP=0 \ > > -DWITH_PYTHON=ON \ > > -DWITH_SVGCAIRO=OFF \ > > -DWITH_ORACLESPATIAL=0 \ > > -DWITH_MSSQL2008=OFF \ > > -DWITH_THREAD_SAFETY=ON \ > > -DWITH_LIBXML2=ON \ > > -DWITH_MYSQL=ON\ > > -DWITH_SDE=0 .. >../configure.out.txt > > > > Which goes through without any warning. > > > > I do make next, getting a few warnings about the Python bindings but > > nothing about mapogroutput (ecept that it was compiled). Then sudo make > > install. No warnings. > > I then set a symlink to the new mapserv file inside cgi-bin and start my > > apache. > > > > I changed my mapfile as you indicated: > > WEB > > FOOTER "test" > > IMAGEPATH "/var/www/html/tmp/" > > TEMPPATH "/var/www/html/tmp/" > > IMAGEURL "/html/tmp/" > > METADATA > > "wfs_title" "Test" > > "ows_onlineresource" "http://localhost:8082/wfs?" > > "ows_enable_request" "*" > > "ows_srs" "EPSG:3857" > > "wfs_srs" "EPSG:3857" > > "wfs_getfeature_formatlist" "geojson,csv,ogrgml" > > "wfs_encoding" "UTF-8" > > END # METADATA > > VALIDATION > > callback ".*" > > END > > END # WEB > > > > OUTPUTFORMAT > > NAME "geojson" > > DRIVER "OGR/GEOJSON" > > MIMETYPE "application/json; subtype=geojson; charset=utf-8" > > FORMATOPTION "STORAGE=stream" > > FORMATOPTION "FORM=SIMPLE" > > FORMATOPTION "LCO:COORDINATE_PRECISION=5" > > FORMATOPTION "JSONP=%callback%" > > END > > > > Unfortunately calling: > > > http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP > > > ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 > > 0228 > > > > gives me a result as before without your changes: > > { > > "type": "FeatureCollection", > > "crs": { "type": "name", "properties": { "name": > > "urn:ogc:def:crs:EPSG::3857" } }, > > "features": [ > > { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > > "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > > 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ > > 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ > > 793757.73417, 6570202.31642 ] ] ] } }, > > { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > > "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > > 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ > > 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ > > 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ > > 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ > > 793752.31968, 6570224.89917 ] ] ] } }, > > { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > > "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > > 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ > > 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ > > 793735.55884, 6570231.00753 ] ] ] } } > > ] > > } > > > > I also tried this with an AJAX call from Javascript, giving me the > > exactly same result. > > > > I get an error message trying to use the result in Leaflet telling me a > > ";" is missing. I assume it should look like this: > > > > var testlayer = [{ > > "type": "FeatureCollection", > > "crs": { "type": "name", "properties": { "name": > > "urn:ogc:def:crs:EPSG::3857" } }, > > "features": [ > > { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > > "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > > 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ > > 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ > > 793757.73417, 6570202.31642 ] ] ] } }, > > { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > > "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > > 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ > > 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ > > 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ > > 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ > > 793752.31968, 6570224.89917 ] ] ] } }, > > { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > > "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > > 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ > > 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ > > 793735.55884, 6570231.00753 ] ] ] } } > > ] > > }]; > > > > I'm not sure what is going on. Am I not applying the changes correctly > > or is my call wrong? > > > > Thanks for you great support. > > > > Best > > > > Lars > > > > > > Am 09.01.2015 um 15:30 schrieb Eichner, Andreas - SID: > > > Hi, > > > > > > I've attached a quick'n dirty solution (against master). When applied > to > > > mapogroutput.c you can set a JSONP formatoption to the callback name: > > > > > > OUTPUTFORMAT > > > NAME 'geojson' > > > DRIVER 'OGR/GEOJSON' > > > MIMETYPE 'application/json; subtype=geojson; charset=utf-8' > > > FORMATOPTION 'STORAGE=stream' > > > FORMATOPTION 'FORM=simple' > > > FORMATOPTION 'LCO:COORDINATE_PRECISION=5' > > > FORMATOPTION 'JSONP=%callback%' > > > END > > > > > > This needs of course a WEB.VALIDATION: > > > WEB > > > ... > > > VALIDATION > > > callback '.*' > > > END > > > END > > > > > > Would be great if you can test if this works (looks good to me). The > > Devs might have a look if this could be integrated into master until OGR > > has an appropriate layer creation option (solution described by Even). > > > > > > Greetings > > > > > >> -----Urspr?ngliche Nachricht----- > > >> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- > > >> bounces at lists.osgeo.org] Im Auftrag von Lars Fricke > > >> Gesendet: Freitag, 9. Januar 2015 11:24 > > >> An: mapserver-users at lists.osgeo.org > > >> Betreff: Re: [mapserver-users] Setting up a JSONP service > > >> > > >> Hello, > > >> > > >> first of all: Thank you for your support! > > >> Sorry for the late reply but I unfortunately was ill. > > >> > > >> @ Steve: > > >> I read about templating but also read that it is slower? > > >> I do not have a lot of experience in writing templates. Would you > mind > > >> sharing a JSONP template? > > >> > > >> @ Even: Thank you for your thoughts. Who would implement that change > > >> though? I'm afraid I can't. > > >> > > >> @ Jeff: I followed those links but I only found threads referring to > > >> GeoServer or that were not related to my question. The GDAL page I > did > > >> study and that's how I managed to set up the GeoJSON service but > thats > > >> not the same unfortunately as it conflicts with the same origin > policy. > > >> > > >> Best > > >> > > >> Lars > > >> > > >> Am 30.12.2014 um 16:24 schrieb Lime, Steve D (MNIT): > > >>> You can also use MapServer templates to accomplish this. It's a > little > > >> more work since you have to write the template but it's quite > flexible > > >> then. Usually I write the template to produce JSON and then use a > > simple > > >> wrapper template to produce JSONP. For example, jsonp.js looks like > > >> (callback is passed in): > > >>> // MapServer Template > > >>> [callback]( > > >>> [include src="templates/json.js"] > > >>> ) > > >>> > > >>> Output formats look like: > > >>> > > >>> OUTPUTFORMAT > > >>> NAME 'JSON' > > >>> DRIVER 'TEMPLATE' > > >>> MIMETYPE 'application/json;' > > >>> FORMATOPTION 'FILE=templates/json.js' > > >>> FORMATOPTION 'ATTACHMENT=service.json' > > >>> END > > >>> > > >>> OUTPUTFORMAT > > >>> NAME 'JSONP' > > >>> DRIVER 'TEMPLATE' > > >>> MIMETYPE 'application/json;' > > >>> FORMATOPTION 'FILE=templates/jsonp.js' > > >>> FORMATOPTION 'ATTACHMENT=service.json' > > >>> END > > >>> > > >>> Steve > > >>> > > >>> -----Original Message----- > > >>> From:mapserver-users-bounces at lists.osgeo.org [mailto:mapserver- > users- > > >> bounces at lists.osgeo.org] On Behalf Of Lars Fricke > > >>> Sent: Monday, December 29, 2014 5:34 AM > > >>> To:mapserver-users at lists.osgeo.org > > >>> Subject: [mapserver-users] Setting up a JSONP service > > >>> > > >>> Dear List, > > >>> > > >>> I have a WFS service running under MapServer that I would like to > > >> operate as JSONP service. I managed to set GEOJSON as output format > but > > I > > >> get "Cross-Origin-Request Blocked" if I try to call it with a > > Javascript > > >> client (using Leaflet L.layerJSON. > > >>> The question is: Is it possible to set up a JSONP service from > > Mapserver > > >> and if yes, how? My current mapfile looks like this (relevant parts): > > >>> " > > >>> # in WEB - METADATA > > >>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" > > >>> > > >>> OUTPUTFORMAT > > >>> NAME "geojson" > > >>> DRIVER "OGR/GEOJSON" > > >>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" > > >>> FORMATOPTION "STORAGE=stream" > > >>> FORMATOPTION "FORM=SIMPLE" > > >>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" > > >>> END > > >>> " > > >>> If this would already be a correct JSONP service, I have to look on > > the > > >> Leaflet side for the error... > > >>> Thanks for your help. > > >>> > > >>> Cheers > > >>> > > >>> Lars > > >>> _______________________________________________ > > >>> mapserver-users mailing list > > >>> mapserver-users at lists.osgeo.org > > >>> http://lists.osgeo.org/mailman/listinfo/mapserver-users > > >>> _______________________________________________ > > >>> mapserver-users mailing list > > >>> mapserver-users at lists.osgeo.org > > >>> http://lists.osgeo.org/mailman/listinfo/mapserver-users > > >>> > > >> _______________________________________________ > > >> mapserver-users mailing list > > >> mapserver-users at lists.osgeo.org > > >> http://lists.osgeo.org/mailman/listinfo/mapserver-users > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users From fricke at gisberater.com Tue Jan 13 07:38:47 2015 From: fricke at gisberater.com (Lars Fricke) Date: Tue, 13 Jan 2015 16:38:47 +0100 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <6F331135492B944D90731CE93743D5681BC6B8@FS-EX-DB102.fs.sachsen.de> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> <54B51BE7.3090409@gisberater.com> <6F331135492B944D90731CE93743D5681BC6AA@FS-EX-DB102.fs.sachsen.de> <6F331135492B944D90731CE93743D5681BC6B8@FS-EX-DB102.fs.sachsen.de> Message-ID: <54B53C07.7060503@gisberater.com> Hi Andreas, I guess I'm still doing something wrong. If I use http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 0228&callback=foobar I'm getting the exact same output as before. What are you getting? Can you post an example of your servers response? Thank you so much. Best Lars Am 13.01.2015 um 15:57 schrieb Eichner, Andreas - SID: > Arg.. outputformat=geojson also works, only had a typo... > >> -----Urspr?ngliche Nachricht----- >> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- >> bounces at lists.osgeo.org] Im Auftrag von Eichner, Andreas - SID >> Gesendet: Dienstag, 13. Januar 2015 15:18 >> An: 'lars.fricke at skendata.de'; mapserver-users at lists.osgeo.org >> Betreff: Re: [mapserver-users] Setting up a JSONP service >> >> You need to append the "callback" parameter to the query string: >> >> http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP >> ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 >> 0228&callback=foobar >> >> You can test on the command line, too: >> MS_MAPFILE=/path/to/mapfile ./mapserv >> QUERY_STRING='service=WFS&version=1.1.0&request=GetFeature&typename=HU& >> SRS=EPSG:3857&bbox=793732,6570204,793765,6570228&outputformat=application/ >> json; subtype=geojson; charset=utf-8&callback=foobar' >> >> Please note that IMHO "geojson" alone isn't enough. The full mimetype >> string should be used as reported by GetCapabilities. >> >> HTH >> >>> -----Urspr?ngliche Nachricht----- >>> Von: Lars Fricke [mailto:fricke at gisberater.com] >>> Gesendet: Dienstag, 13. Januar 2015 14:22 >>> An: Eichner, Andreas - SID; mapserver-users at lists.osgeo.org >>> Betreff: Re: [mapserver-users] Setting up a JSONP service >>> >>> Hi, >>> >>> I compiled MapServer after applying the patch (at least I think it was >>> applied). Unfortunately the output is not JSONP format. Maybe I'm >>> getting something wrong. So here is what I did: >>> Applied >>> patch -p1 < jsonp.diff >>> >>> I got an updated mapogroutput.c. >>> >>> I then compiled with the following options: >>> cmake -DCMAKE_INSTALL_PREFIX=/opt \ >>> -DCMAKE_PREFIX_PATH="/usr/local;/opt" \ >>> -DWITH_CLIENT_WFS=ON \ >>> -DWITH_CLIENT_WMS=ON \ >>> -DWITH_CURL=ON \ >>> -DWITH_SOS=ON \ >>> -DWITH_PHP=0 \ >>> -DWITH_PYTHON=ON \ >>> -DWITH_SVGCAIRO=OFF \ >>> -DWITH_ORACLESPATIAL=0 \ >>> -DWITH_MSSQL2008=OFF \ >>> -DWITH_THREAD_SAFETY=ON \ >>> -DWITH_LIBXML2=ON \ >>> -DWITH_MYSQL=ON\ >>> -DWITH_SDE=0 .. >../configure.out.txt >>> >>> Which goes through without any warning. >>> >>> I do make next, getting a few warnings about the Python bindings but >>> nothing about mapogroutput (ecept that it was compiled). Then sudo make >>> install. No warnings. >>> I then set a symlink to the new mapserv file inside cgi-bin and start my >>> apache. >>> >>> I changed my mapfile as you indicated: >>> WEB >>> FOOTER "test" >>> IMAGEPATH "/var/www/html/tmp/" >>> TEMPPATH "/var/www/html/tmp/" >>> IMAGEURL "/html/tmp/" >>> METADATA >>> "wfs_title" "Test" >>> "ows_onlineresource" "http://localhost:8082/wfs?" >>> "ows_enable_request" "*" >>> "ows_srs" "EPSG:3857" >>> "wfs_srs" "EPSG:3857" >>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" >>> "wfs_encoding" "UTF-8" >>> END # METADATA >>> VALIDATION >>> callback ".*" >>> END >>> END # WEB >>> >>> OUTPUTFORMAT >>> NAME "geojson" >>> DRIVER "OGR/GEOJSON" >>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" >>> FORMATOPTION "STORAGE=stream" >>> FORMATOPTION "FORM=SIMPLE" >>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" >>> FORMATOPTION "JSONP=%callback%" >>> END >>> >>> Unfortunately calling: >>> >> http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP >> ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 >>> 0228 >>> >>> gives me a result as before without your changes: >>> { >>> "type": "FeatureCollection", >>> "crs": { "type": "name", "properties": { "name": >>> "urn:ogc:def:crs:EPSG::3857" } }, >>> "features": [ >>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>> "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>> 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ >>> 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ >>> 793757.73417, 6570202.31642 ] ] ] } }, >>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>> "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>> 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ >>> 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ >>> 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ >>> 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ >>> 793752.31968, 6570224.89917 ] ] ] } }, >>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>> "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>> 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ >>> 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ >>> 793735.55884, 6570231.00753 ] ] ] } } >>> ] >>> } >>> >>> I also tried this with an AJAX call from Javascript, giving me the >>> exactly same result. >>> >>> I get an error message trying to use the result in Leaflet telling me a >>> ";" is missing. I assume it should look like this: >>> >>> var testlayer = [{ >>> "type": "FeatureCollection", >>> "crs": { "type": "name", "properties": { "name": >>> "urn:ogc:def:crs:EPSG::3857" } }, >>> "features": [ >>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>> "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>> 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ >>> 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ >>> 793757.73417, 6570202.31642 ] ] ] } }, >>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>> "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>> 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ >>> 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ >>> 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ >>> 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ >>> 793752.31968, 6570224.89917 ] ] ] } }, >>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>> "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>> 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ >>> 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ >>> 793735.55884, 6570231.00753 ] ] ] } } >>> ] >>> }]; >>> >>> I'm not sure what is going on. Am I not applying the changes correctly >>> or is my call wrong? >>> >>> Thanks for you great support. >>> >>> Best >>> >>> Lars >>> >>> >>> Am 09.01.2015 um 15:30 schrieb Eichner, Andreas - SID: >>>> Hi, >>>> >>>> I've attached a quick'n dirty solution (against master). When applied >> to >>>> mapogroutput.c you can set a JSONP formatoption to the callback name: >>>> >>>> OUTPUTFORMAT >>>> NAME 'geojson' >>>> DRIVER 'OGR/GEOJSON' >>>> MIMETYPE 'application/json; subtype=geojson; charset=utf-8' >>>> FORMATOPTION 'STORAGE=stream' >>>> FORMATOPTION 'FORM=simple' >>>> FORMATOPTION 'LCO:COORDINATE_PRECISION=5' >>>> FORMATOPTION 'JSONP=%callback%' >>>> END >>>> >>>> This needs of course a WEB.VALIDATION: >>>> WEB >>>> ... >>>> VALIDATION >>>> callback '.*' >>>> END >>>> END >>>> >>>> Would be great if you can test if this works (looks good to me). The >>> Devs might have a look if this could be integrated into master until OGR >>> has an appropriate layer creation option (solution described by Even). >>>> Greetings >>>> >>>>> -----Urspr?ngliche Nachricht----- >>>>> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- >>>>> bounces at lists.osgeo.org] Im Auftrag von Lars Fricke >>>>> Gesendet: Freitag, 9. Januar 2015 11:24 >>>>> An: mapserver-users at lists.osgeo.org >>>>> Betreff: Re: [mapserver-users] Setting up a JSONP service >>>>> >>>>> Hello, >>>>> >>>>> first of all: Thank you for your support! >>>>> Sorry for the late reply but I unfortunately was ill. >>>>> >>>>> @ Steve: >>>>> I read about templating but also read that it is slower? >>>>> I do not have a lot of experience in writing templates. Would you >> mind >>>>> sharing a JSONP template? >>>>> >>>>> @ Even: Thank you for your thoughts. Who would implement that change >>>>> though? I'm afraid I can't. >>>>> >>>>> @ Jeff: I followed those links but I only found threads referring to >>>>> GeoServer or that were not related to my question. The GDAL page I >> did >>>>> study and that's how I managed to set up the GeoJSON service but >> thats >>>>> not the same unfortunately as it conflicts with the same origin >> policy. >>>>> Best >>>>> >>>>> Lars >>>>> >>>>> Am 30.12.2014 um 16:24 schrieb Lime, Steve D (MNIT): >>>>>> You can also use MapServer templates to accomplish this. It's a >> little >>>>> more work since you have to write the template but it's quite >> flexible >>>>> then. Usually I write the template to produce JSON and then use a >>> simple >>>>> wrapper template to produce JSONP. For example, jsonp.js looks like >>>>> (callback is passed in): >>>>>> // MapServer Template >>>>>> [callback]( >>>>>> [include src="templates/json.js"] >>>>>> ) >>>>>> >>>>>> Output formats look like: >>>>>> >>>>>> OUTPUTFORMAT >>>>>> NAME 'JSON' >>>>>> DRIVER 'TEMPLATE' >>>>>> MIMETYPE 'application/json;' >>>>>> FORMATOPTION 'FILE=templates/json.js' >>>>>> FORMATOPTION 'ATTACHMENT=service.json' >>>>>> END >>>>>> >>>>>> OUTPUTFORMAT >>>>>> NAME 'JSONP' >>>>>> DRIVER 'TEMPLATE' >>>>>> MIMETYPE 'application/json;' >>>>>> FORMATOPTION 'FILE=templates/jsonp.js' >>>>>> FORMATOPTION 'ATTACHMENT=service.json' >>>>>> END >>>>>> >>>>>> Steve >>>>>> >>>>>> -----Original Message----- >>>>>> From:mapserver-users-bounces at lists.osgeo.org [mailto:mapserver- >> users- >>>>> bounces at lists.osgeo.org] On Behalf Of Lars Fricke >>>>>> Sent: Monday, December 29, 2014 5:34 AM >>>>>> To:mapserver-users at lists.osgeo.org >>>>>> Subject: [mapserver-users] Setting up a JSONP service >>>>>> >>>>>> Dear List, >>>>>> >>>>>> I have a WFS service running under MapServer that I would like to >>>>> operate as JSONP service. I managed to set GEOJSON as output format >> but >>> I >>>>> get "Cross-Origin-Request Blocked" if I try to call it with a >>> Javascript >>>>> client (using Leaflet L.layerJSON. >>>>>> The question is: Is it possible to set up a JSONP service from >>> Mapserver >>>>> and if yes, how? My current mapfile looks like this (relevant parts): >>>>>> " >>>>>> # in WEB - METADATA >>>>>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" >>>>>> >>>>>> OUTPUTFORMAT >>>>>> NAME "geojson" >>>>>> DRIVER "OGR/GEOJSON" >>>>>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" >>>>>> FORMATOPTION "STORAGE=stream" >>>>>> FORMATOPTION "FORM=SIMPLE" >>>>>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" >>>>>> END >>>>>> " >>>>>> If this would already be a correct JSONP service, I have to look on >>> the >>>>> Leaflet side for the error... >>>>>> Thanks for your help. >>>>>> >>>>>> Cheers >>>>>> >>>>>> Lars >>>>>> _______________________________________________ >>>>>> mapserver-users mailing list >>>>>> mapserver-users at lists.osgeo.org >>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>>>> _______________________________________________ >>>>>> mapserver-users mailing list >>>>>> mapserver-users at lists.osgeo.org >>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>>>> >>>>> _______________________________________________ >>>>> mapserver-users mailing list >>>>> mapserver-users at lists.osgeo.org >>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >> _______________________________________________ >> mapserver-users mailing list >> mapserver-users at lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/mapserver-users From Andreas.Eichner at sid.sachsen.de Tue Jan 13 07:52:21 2015 From: Andreas.Eichner at sid.sachsen.de (Eichner, Andreas - SID) Date: Tue, 13 Jan 2015 15:52:21 +0000 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <54B53C07.7060503@gisberater.com> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> <54B51BE7.3090409@gisberater.com> <6F331135492B944D90731CE93743D5681BC6AA@FS-EX-DB102.fs.sachsen.de> <6F331135492B944D90731CE93743D5681BC6B8@FS-EX-DB102.fs.sachsen.de> <54B53C07.7060503@gisberater.com> Message-ID: <6F331135492B944D90731CE93743D5681BC6DB@FS-EX-DB102.fs.sachsen.de> That's what I get on the console: $ MS_MAPFILE=$(pwd)/IHK_Handelsflaechen.map ./mapserv QUERY_STRING='service=WFS&version=1.1.0&request=GetFeature&featureid=IHK.71247&outputformat=geojson&callback=foobar'Content-Disposition: attachment; filename=result.dat Content-Type: application/json; subtype=geojson; charset=utf-8 foobar({ "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "PLZ": "09648", ..., "LANDKREIS": "Mittelsachsen" }, "geometry": { "type": "Point", "coordinates": [ 4568447.14, 5650577.57 ] } } ] } ); In other words, the JSON is enclosed by "foobar(" and ");": The relevant parts of the mapfile are: OUTPUTFORMAT NAME 'geojson' # NAME 'jsonp' DRIVER 'OGR/GEOJSON' MIMETYPE 'application/json; subtype=geojson; charset=utf-8' # MIMETYPE 'text/javascript; charset=utf-8' FORMATOPTION 'STORAGE=stream' FORMATOPTION 'FORM=simple' FORMATOPTION 'LCO:COORDINATE_PRECISION=5' FORMATOPTION 'JSONP=%callback%' END WEB VALIDATION callback '.*' # default_callback 'jsonp' END END The default value does not work, so the substitution parameter must be given. > -----Urspr?ngliche Nachricht----- > Von: Lars Fricke [mailto:fricke at gisberater.com] > Gesendet: Dienstag, 13. Januar 2015 16:39 > An: Eichner, Andreas - SID; mapserver-users at lists.osgeo.org > Betreff: Re: [mapserver-users] Setting up a JSONP service > > Hi Andreas, > > I guess I'm still doing something wrong. If I use > http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP > ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 > 0228&callback=foobar > > I'm getting the exact same output as before. What are you getting? Can > you post an example of your servers response? > > Thank you so much. > > Best > > Lars > > Am 13.01.2015 um 15:57 schrieb Eichner, Andreas - SID: > > Arg.. outputformat=geojson also works, only had a typo... > > > >> -----Urspr?ngliche Nachricht----- > >> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- > >> bounces at lists.osgeo.org] Im Auftrag von Eichner, Andreas - SID > >> Gesendet: Dienstag, 13. Januar 2015 15:18 > >> An: 'lars.fricke at skendata.de'; mapserver-users at lists.osgeo.org > >> Betreff: Re: [mapserver-users] Setting up a JSONP service > >> > >> You need to append the "callback" parameter to the query string: > >> > >> > http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP > >> > ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 > >> 0228&callback=foobar > >> > >> You can test on the command line, too: > >> MS_MAPFILE=/path/to/mapfile ./mapserv > >> QUERY_STRING='service=WFS&version=1.1.0&request=GetFeature&typename=HU& > >> > SRS=EPSG:3857&bbox=793732,6570204,793765,6570228&outputformat=application/ > >> json; subtype=geojson; charset=utf-8&callback=foobar' > >> > >> Please note that IMHO "geojson" alone isn't enough. The full mimetype > >> string should be used as reported by GetCapabilities. > >> > >> HTH > >> > >>> -----Urspr?ngliche Nachricht----- > >>> Von: Lars Fricke [mailto:fricke at gisberater.com] > >>> Gesendet: Dienstag, 13. Januar 2015 14:22 > >>> An: Eichner, Andreas - SID; mapserver-users at lists.osgeo.org > >>> Betreff: Re: [mapserver-users] Setting up a JSONP service > >>> > >>> Hi, > >>> > >>> I compiled MapServer after applying the patch (at least I think it was > >>> applied). Unfortunately the output is not JSONP format. Maybe I'm > >>> getting something wrong. So here is what I did: > >>> Applied > >>> patch -p1 < jsonp.diff > >>> > >>> I got an updated mapogroutput.c. > >>> > >>> I then compiled with the following options: > >>> cmake -DCMAKE_INSTALL_PREFIX=/opt \ > >>> -DCMAKE_PREFIX_PATH="/usr/local;/opt" \ > >>> -DWITH_CLIENT_WFS=ON \ > >>> -DWITH_CLIENT_WMS=ON \ > >>> -DWITH_CURL=ON \ > >>> -DWITH_SOS=ON \ > >>> -DWITH_PHP=0 \ > >>> -DWITH_PYTHON=ON \ > >>> -DWITH_SVGCAIRO=OFF \ > >>> -DWITH_ORACLESPATIAL=0 \ > >>> -DWITH_MSSQL2008=OFF \ > >>> -DWITH_THREAD_SAFETY=ON \ > >>> -DWITH_LIBXML2=ON \ > >>> -DWITH_MYSQL=ON\ > >>> -DWITH_SDE=0 .. >../configure.out.txt > >>> > >>> Which goes through without any warning. > >>> > >>> I do make next, getting a few warnings about the Python bindings but > >>> nothing about mapogroutput (ecept that it was compiled). Then sudo > make > >>> install. No warnings. > >>> I then set a symlink to the new mapserv file inside cgi-bin and start > my > >>> apache. > >>> > >>> I changed my mapfile as you indicated: > >>> WEB > >>> FOOTER "test" > >>> IMAGEPATH "/var/www/html/tmp/" > >>> TEMPPATH "/var/www/html/tmp/" > >>> IMAGEURL "/html/tmp/" > >>> METADATA > >>> "wfs_title" "Test" > >>> "ows_onlineresource" "http://localhost:8082/wfs?" > >>> "ows_enable_request" "*" > >>> "ows_srs" "EPSG:3857" > >>> "wfs_srs" "EPSG:3857" > >>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" > >>> "wfs_encoding" "UTF-8" > >>> END # METADATA > >>> VALIDATION > >>> callback ".*" > >>> END > >>> END # WEB > >>> > >>> OUTPUTFORMAT > >>> NAME "geojson" > >>> DRIVER "OGR/GEOJSON" > >>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" > >>> FORMATOPTION "STORAGE=stream" > >>> FORMATOPTION "FORM=SIMPLE" > >>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" > >>> FORMATOPTION "JSONP=%callback%" > >>> END > >>> > >>> Unfortunately calling: > >>> > >> > http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP > >> > ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 > >>> 0228 > >>> > >>> gives me a result as before without your changes: > >>> { > >>> "type": "FeatureCollection", > >>> "crs": { "type": "name", "properties": { "name": > >>> "urn:ogc:def:crs:EPSG::3857" } }, > >>> "features": [ > >>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > >>> "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > >>> 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ > >>> 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ > >>> 793757.73417, 6570202.31642 ] ] ] } }, > >>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > >>> "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > >>> 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ > >>> 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ > >>> 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ > >>> 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ > >>> 793752.31968, 6570224.89917 ] ] ] } }, > >>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > >>> "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > >>> 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ > >>> 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ > >>> 793735.55884, 6570231.00753 ] ] ] } } > >>> ] > >>> } > >>> > >>> I also tried this with an AJAX call from Javascript, giving me the > >>> exactly same result. > >>> > >>> I get an error message trying to use the result in Leaflet telling me > a > >>> ";" is missing. I assume it should look like this: > >>> > >>> var testlayer = [{ > >>> "type": "FeatureCollection", > >>> "crs": { "type": "name", "properties": { "name": > >>> "urn:ogc:def:crs:EPSG::3857" } }, > >>> "features": [ > >>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > >>> "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > >>> 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ > >>> 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ > >>> 793757.73417, 6570202.31642 ] ] ] } }, > >>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > >>> "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > >>> 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ > >>> 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ > >>> 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ > >>> 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ > >>> 793752.31968, 6570224.89917 ] ] ] } }, > >>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": > >>> "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ > >>> 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ > >>> 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ > >>> 793735.55884, 6570231.00753 ] ] ] } } > >>> ] > >>> }]; > >>> > >>> I'm not sure what is going on. Am I not applying the changes correctly > >>> or is my call wrong? > >>> > >>> Thanks for you great support. > >>> > >>> Best > >>> > >>> Lars > >>> > >>> > >>> Am 09.01.2015 um 15:30 schrieb Eichner, Andreas - SID: > >>>> Hi, > >>>> > >>>> I've attached a quick'n dirty solution (against master). When applied > >> to > >>>> mapogroutput.c you can set a JSONP formatoption to the callback name: > >>>> > >>>> OUTPUTFORMAT > >>>> NAME 'geojson' > >>>> DRIVER 'OGR/GEOJSON' > >>>> MIMETYPE 'application/json; subtype=geojson; charset=utf-8' > >>>> FORMATOPTION 'STORAGE=stream' > >>>> FORMATOPTION 'FORM=simple' > >>>> FORMATOPTION 'LCO:COORDINATE_PRECISION=5' > >>>> FORMATOPTION 'JSONP=%callback%' > >>>> END > >>>> > >>>> This needs of course a WEB.VALIDATION: > >>>> WEB > >>>> ... > >>>> VALIDATION > >>>> callback '.*' > >>>> END > >>>> END > >>>> > >>>> Would be great if you can test if this works (looks good to me). The > >>> Devs might have a look if this could be integrated into master until > OGR > >>> has an appropriate layer creation option (solution described by Even). > >>>> Greetings > >>>> > >>>>> -----Urspr?ngliche Nachricht----- > >>>>> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver- > users- > >>>>> bounces at lists.osgeo.org] Im Auftrag von Lars Fricke > >>>>> Gesendet: Freitag, 9. Januar 2015 11:24 > >>>>> An: mapserver-users at lists.osgeo.org > >>>>> Betreff: Re: [mapserver-users] Setting up a JSONP service > >>>>> > >>>>> Hello, > >>>>> > >>>>> first of all: Thank you for your support! > >>>>> Sorry for the late reply but I unfortunately was ill. > >>>>> > >>>>> @ Steve: > >>>>> I read about templating but also read that it is slower? > >>>>> I do not have a lot of experience in writing templates. Would you > >> mind > >>>>> sharing a JSONP template? > >>>>> > >>>>> @ Even: Thank you for your thoughts. Who would implement that change > >>>>> though? I'm afraid I can't. > >>>>> > >>>>> @ Jeff: I followed those links but I only found threads referring to > >>>>> GeoServer or that were not related to my question. The GDAL page I > >> did > >>>>> study and that's how I managed to set up the GeoJSON service but > >> thats > >>>>> not the same unfortunately as it conflicts with the same origin > >> policy. > >>>>> Best > >>>>> > >>>>> Lars > >>>>> > >>>>> Am 30.12.2014 um 16:24 schrieb Lime, Steve D (MNIT): > >>>>>> You can also use MapServer templates to accomplish this. It's a > >> little > >>>>> more work since you have to write the template but it's quite > >> flexible > >>>>> then. Usually I write the template to produce JSON and then use a > >>> simple > >>>>> wrapper template to produce JSONP. For example, jsonp.js looks like > >>>>> (callback is passed in): > >>>>>> // MapServer Template > >>>>>> [callback]( > >>>>>> [include src="templates/json.js"] > >>>>>> ) > >>>>>> > >>>>>> Output formats look like: > >>>>>> > >>>>>> OUTPUTFORMAT > >>>>>> NAME 'JSON' > >>>>>> DRIVER 'TEMPLATE' > >>>>>> MIMETYPE 'application/json;' > >>>>>> FORMATOPTION 'FILE=templates/json.js' > >>>>>> FORMATOPTION 'ATTACHMENT=service.json' > >>>>>> END > >>>>>> > >>>>>> OUTPUTFORMAT > >>>>>> NAME 'JSONP' > >>>>>> DRIVER 'TEMPLATE' > >>>>>> MIMETYPE 'application/json;' > >>>>>> FORMATOPTION 'FILE=templates/jsonp.js' > >>>>>> FORMATOPTION 'ATTACHMENT=service.json' > >>>>>> END > >>>>>> > >>>>>> Steve > >>>>>> > >>>>>> -----Original Message----- > >>>>>> From:mapserver-users-bounces at lists.osgeo.org [mailto:mapserver- > >> users- > >>>>> bounces at lists.osgeo.org] On Behalf Of Lars Fricke > >>>>>> Sent: Monday, December 29, 2014 5:34 AM > >>>>>> To:mapserver-users at lists.osgeo.org > >>>>>> Subject: [mapserver-users] Setting up a JSONP service > >>>>>> > >>>>>> Dear List, > >>>>>> > >>>>>> I have a WFS service running under MapServer that I would like to > >>>>> operate as JSONP service. I managed to set GEOJSON as output format > >> but > >>> I > >>>>> get "Cross-Origin-Request Blocked" if I try to call it with a > >>> Javascript > >>>>> client (using Leaflet L.layerJSON. > >>>>>> The question is: Is it possible to set up a JSONP service from > >>> Mapserver > >>>>> and if yes, how? My current mapfile looks like this (relevant > parts): > >>>>>> " > >>>>>> # in WEB - METADATA > >>>>>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" > >>>>>> > >>>>>> OUTPUTFORMAT > >>>>>> NAME "geojson" > >>>>>> DRIVER "OGR/GEOJSON" > >>>>>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" > >>>>>> FORMATOPTION "STORAGE=stream" > >>>>>> FORMATOPTION "FORM=SIMPLE" > >>>>>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" > >>>>>> END > >>>>>> " > >>>>>> If this would already be a correct JSONP service, I have to look on > >>> the > >>>>> Leaflet side for the error... > >>>>>> Thanks for your help. > >>>>>> > >>>>>> Cheers > >>>>>> > >>>>>> Lars > >>>>>> _______________________________________________ > >>>>>> mapserver-users mailing list > >>>>>> mapserver-users at lists.osgeo.org > >>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users > >>>>>> _______________________________________________ > >>>>>> mapserver-users mailing list > >>>>>> mapserver-users at lists.osgeo.org > >>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users > >>>>>> > >>>>> _______________________________________________ > >>>>> mapserver-users mailing list > >>>>> mapserver-users at lists.osgeo.org > >>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users > >> _______________________________________________ > >> mapserver-users mailing list > >> mapserver-users at lists.osgeo.org > >> http://lists.osgeo.org/mailman/listinfo/mapserver-users From Pasquale.Maiorano at ssi.it Tue Jan 13 08:49:24 2015 From: Pasquale.Maiorano at ssi.it (Maiorano Pasquale) Date: Tue, 13 Jan 2015 17:49:24 +0100 Subject: [mapserver-users] enable to run mapserver Message-ID: <909214C1813780458B3E4EABE7D1568301D31417@ssi-mail.ssi.it> Dear Sirs, when I run the plugin Mapserver Exporter I found the following problem: Traceback (most recent call last): File "C:/Users/maiorano/.qgis2/python/plugins\rt_mapserver_exporter\plugin.py ", line 65, in run from .mapfileexportdlg import MapfileExportDlg File "C:/PROGRA~1/QGISCH~1/apps/qgis/./python\qgis\utils.py", line 454, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:/Users/maiorano/.qgis2/python/plugins\rt_mapserver_exporter\mapfileex portdlg.py", line 30, in import mapscript File "C:/PROGRA~1/QGISCH~1/apps/qgis/./python\qgis\utils.py", line 454, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ImportError: No module named mapscript I am using QGIS 2.4.0 and RT Map Server Export ver. 0.4.0 Any advice will be appreciated. Regards, Pasquale Maiorano -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.greenwood at gmail.com Tue Jan 13 10:18:29 2015 From: richard.greenwood at gmail.com (Richard Greenwood) Date: Tue, 13 Jan 2015 11:18:29 -0700 Subject: [mapserver-users] enable to run mapserver In-Reply-To: <909214C1813780458B3E4EABE7D1568301D31417@ssi-mail.ssi.it> References: <909214C1813780458B3E4EABE7D1568301D31417@ssi-mail.ssi.it> Message-ID: I do not think that the MapServer eport plugin has worked since QGIS 1.8 and even there you need to use "old styling" for you layers. Best of luck, Rich On Tue, Jan 13, 2015 at 9:49 AM, Maiorano Pasquale wrote: > Dear Sirs, > > > > when I run the plugin Mapserver Exporter I found the following problem: > > > > Traceback (most recent call last): > File > "C:/Users/maiorano/.qgis2/python/plugins\rt_mapserver_exporter\plugin.py", > line 65, in run > from .mapfileexportdlg import MapfileExportDlg > File "C:/PROGRA~1/QGISCH~1/apps/qgis/./python\qgis\utils.py", line 454, > in _import > mod = _builtin_import(name, globals, locals, fromlist, level) > File > "C:/Users/maiorano/.qgis2/python/plugins\rt_mapserver_exporter\mapfileexportdlg.py", > line 30, in > import mapscript > File "C:/PROGRA~1/QGISCH~1/apps/qgis/./python\qgis\utils.py", line 454, > in _import > mod = _builtin_import(name, globals, locals, fromlist, level) > ImportError: No module named mapscript > > > > I am using QGIS 2.4.0 and RT Map Server Export ver. 0.4.0 > > > > Any advice will be appreciated. > > > > Regards, > > > > Pasquale Maiorano > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > -- Richard W. Greenwood, PLS www.greenwoodmap.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steve.Lime at state.mn.us Tue Jan 13 15:41:27 2015 From: Steve.Lime at state.mn.us (Lime, Steve D (MNIT)) Date: Tue, 13 Jan 2015 23:41:27 +0000 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <54AFAC59.5060604@gisberater.com> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> Message-ID: Hi Lars: Most of what you need was in my last reply. Those are snippets from a working configuration. Here's a simple JSON template for a raster query that creates an array of xyz objects: // MapServer Template {'result':{ 'points':[ [resultset layer="elev_dem30ra3"] [feature trimlast=","]{x:[x], y:[y], z:[value_0]},[/feature] [/resultset] ] }} You could turn this into JSONP and not use the include strategy (I wanted both JSON and JSONP) simply by wrapping the object in callback (callback is a value passed through MapServer, e.g. &mode=query&callback=foo): // MapServer Template (jsonp.js) [callback]({'result':{ 'points':[ [resultset layer="elev_dem30ra3"] [feature trimlast=","]{x:[x], y:[y], z:[value_0]},[/feature] [/resultset] ] }}) and here's the corresponding OUTPUTFORMAT block: OUTPUTFORMAT NAME 'JSONP' DRIVER 'TEMPLATE' MIMETYPE 'application/json;' FORMATOPTION 'FILE=templates/jsonp.js' FORMATOPTION 'ATTACHMENT=service.json' END Regarding speed, templates are going to be a bit slower since there are generally two passes through the data, once to identify the candidate records and a second for presentation. Also the template assembly is done in memory so there are limits on how large of datasets you can practically work with. How big a deal this is depends on your situation. It's not perfect but in general I've had great luck with this approach. Steve -----Original Message----- From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Lars Fricke Sent: Friday, January 09, 2015 4:24 AM To: mapserver-users at lists.osgeo.org Subject: Re: [mapserver-users] Setting up a JSONP service Hello, first of all: Thank you for your support! Sorry for the late reply but I unfortunately was ill. @ Steve: I read about templating but also read that it is slower? I do not have a lot of experience in writing templates. Would you mind sharing a JSONP template? @ Even: Thank you for your thoughts. Who would implement that change though? I'm afraid I can't. @ Jeff: I followed those links but I only found threads referring to GeoServer or that were not related to my question. The GDAL page I did study and that's how I managed to set up the GeoJSON service but thats not the same unfortunately as it conflicts with the same origin policy. Best Lars Am 30.12.2014 um 16:24 schrieb Lime, Steve D (MNIT): > You can also use MapServer templates to accomplish this. It's a little more work since you have to write the template but it's quite flexible then. Usually I write the template to produce JSON and then use a simple wrapper template to produce JSONP. For example, jsonp.js looks like (callback is passed in): > > // MapServer Template > [callback]( > [include src="templates/json.js"] > ) > > Output formats look like: > > OUTPUTFORMAT > NAME 'JSON' > DRIVER 'TEMPLATE' > MIMETYPE 'application/json;' > FORMATOPTION 'FILE=templates/json.js' > FORMATOPTION 'ATTACHMENT=service.json' > END > > OUTPUTFORMAT > NAME 'JSONP' > DRIVER 'TEMPLATE' > MIMETYPE 'application/json;' > FORMATOPTION 'FILE=templates/jsonp.js' > FORMATOPTION 'ATTACHMENT=service.json' > END > > Steve > > -----Original Message----- > From:mapserver-users-bounces at lists.osgeo.org > [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Lars > Fricke > Sent: Monday, December 29, 2014 5:34 AM > To:mapserver-users at lists.osgeo.org > Subject: [mapserver-users] Setting up a JSONP service > > Dear List, > > I have a WFS service running under MapServer that I would like to operate as JSONP service. I managed to set GEOJSON as output format but I get "Cross-Origin-Request Blocked" if I try to call it with a Javascript client (using Leaflet L.layerJSON. > The question is: Is it possible to set up a JSONP service from Mapserver and if yes, how? My current mapfile looks like this (relevant parts): > > " > # in WEB - METADATA > "wfs_getfeature_formatlist" "geojson,csv,ogrgml" > > OUTPUTFORMAT > NAME "geojson" > DRIVER "OGR/GEOJSON" > MIMETYPE "application/json; subtype=geojson; charset=utf-8" > FORMATOPTION "STORAGE=stream" > FORMATOPTION "FORM=SIMPLE" > FORMATOPTION "LCO:COORDINATE_PRECISION=5" > END > " > If this would already be a correct JSONP service, I have to look on the Leaflet side for the error... > Thanks for your help. > > Cheers > > Lars > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users From liuxiaoer at live.cn Tue Jan 13 17:12:38 2015 From: liuxiaoer at live.cn (=?gb2312?B?wfXQobb+?=) Date: Wed, 14 Jan 2015 01:12:38 +0000 Subject: [mapserver-users] FW: Errors about mapcache configure in apache httpd In-Reply-To: References: , Message-ID: Hi, list: I had succeeded in compiling and installing the mapcache according to the guide, but there was something wrong with integrating mod_mapcache.so to apache httpd. The following is my logs about compiling and installing and httpd conf file. mapcache.conf LoadModule mapcache_module modules/mod_apreq2.so # # Require all granted # #MapCacheAlias /mapcache "/var/www/mapcache/mapcache.xml" [root at localhost build]# systemctl status httpd.service -l httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled) Active: failed (Result: exit-code) since ? 2015-01-14 08:19:05 CST; 7s ago Process: 29697 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS) Process: 29695 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE) Main PID: 29695 (code=exited, status=1/FAILURE) Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec" 1? 14 08:19:05 localhost.localdomain httpd[29695]: httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 of /etc/httpd/conf.modules.d/10-mp-.conf: Cannot load modules/mod_mapcache.so into server: libmapcache.so.1: cannot open shared object file: No such file or directory 1? 14 08:19:05 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE 1? 14 08:19:05 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server. 1? 14 08:19:05 localhost.localdomain systemd[1]: Unit httpd.service entered failed state. Any advice will be appreciated. Regards,liuxiaoer -------------- next part -------------- An HTML attachment was scrubbed... URL: From fricke at gisberater.com Wed Jan 14 00:34:49 2015 From: fricke at gisberater.com (Lars Fricke) Date: Wed, 14 Jan 2015 09:34:49 +0100 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <6F331135492B944D90731CE93743D5681BC6DB@FS-EX-DB102.fs.sachsen.de> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> <54B51BE7.3090409@gisberater.com> <6F331135492B944D90731CE93743D5681BC6AA@FS-EX-DB102.fs.sachsen.de> <6F331135492B944D90731CE93743D5681BC6B8@FS-EX-DB102.fs.sachsen.de> <54B53C07.7060503@gisberater.com> <6F331135492B944D90731CE93743D5681BC6DB@FS-EX-DB102.fs.sachsen.de> Message-ID: <54B62A29.8070900@gisberater.com> Hi Andreas, I see. This is what I would need I guess but I'm not getting it. The "foobar(" and the ");" is missing in my output. I guess I have to go through my system finding out if potentially an older version of Mapserver is used instead of the new compilation. I did already uninstall first but maybe that was not good enough. I even manually deleted the old mapserv file but it seems something is still wrong because I get a different output than you even I use the same call. I'll keep you posted. Best Lars Am 13.01.2015 um 16:52 schrieb Eichner, Andreas - SID: > That's what I get on the console: > > $ MS_MAPFILE=$(pwd)/IHK_Handelsflaechen.map ./mapserv QUERY_STRING='service=WFS&version=1.1.0&request=GetFeature&featureid=IHK.71247&outputformat=geojson&callback=foobar'Content-Disposition: attachment; filename=result.dat > Content-Type: application/json; subtype=geojson; charset=utf-8 > > foobar({ > "type": "FeatureCollection", > > "features": [ > { "type": "Feature", "properties": { "PLZ": "09648", ..., "LANDKREIS": "Mittelsachsen" }, "geometry": { "type": "Point", "coordinates": [ 4568447.14, 5650577.57 ] } } > ] > } > ); > > In other words, the JSON is enclosed by "foobar(" and ");": The relevant parts of the mapfile are: > > OUTPUTFORMAT > NAME 'geojson' > # NAME 'jsonp' > DRIVER 'OGR/GEOJSON' > MIMETYPE 'application/json; subtype=geojson; charset=utf-8' > # MIMETYPE 'text/javascript; charset=utf-8' > FORMATOPTION 'STORAGE=stream' > FORMATOPTION 'FORM=simple' > FORMATOPTION 'LCO:COORDINATE_PRECISION=5' > FORMATOPTION 'JSONP=%callback%' > END > > WEB > VALIDATION > callback '.*' > # default_callback 'jsonp' > END > END > > The default value does not work, so the substitution parameter must be given. > > > >> -----Urspr?ngliche Nachricht----- >> Von: Lars Fricke [mailto:fricke at gisberater.com] >> Gesendet: Dienstag, 13. Januar 2015 16:39 >> An: Eichner, Andreas - SID; mapserver-users at lists.osgeo.org >> Betreff: Re: [mapserver-users] Setting up a JSONP service >> >> Hi Andreas, >> >> I guess I'm still doing something wrong. If I use >> http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP >> ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 >> 0228&callback=foobar >> >> I'm getting the exact same output as before. What are you getting? Can >> you post an example of your servers response? >> >> Thank you so much. >> >> Best >> >> Lars >> >> Am 13.01.2015 um 15:57 schrieb Eichner, Andreas - SID: >>> Arg.. outputformat=geojson also works, only had a typo... >>> >>>> -----Urspr?ngliche Nachricht----- >>>> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- >>>> bounces at lists.osgeo.org] Im Auftrag von Eichner, Andreas - SID >>>> Gesendet: Dienstag, 13. Januar 2015 15:18 >>>> An: 'lars.fricke at skendata.de'; mapserver-users at lists.osgeo.org >>>> Betreff: Re: [mapserver-users] Setting up a JSONP service >>>> >>>> You need to append the "callback" parameter to the query string: >>>> >>>> >> http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP >> ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 >>>> 0228&callback=foobar >>>> >>>> You can test on the command line, too: >>>> MS_MAPFILE=/path/to/mapfile ./mapserv >>>> QUERY_STRING='service=WFS&version=1.1.0&request=GetFeature&typename=HU& >>>> >> SRS=EPSG:3857&bbox=793732,6570204,793765,6570228&outputformat=application/ >>>> json; subtype=geojson; charset=utf-8&callback=foobar' >>>> >>>> Please note that IMHO "geojson" alone isn't enough. The full mimetype >>>> string should be used as reported by GetCapabilities. >>>> >>>> HTH >>>> >>>>> -----Urspr?ngliche Nachricht----- >>>>> Von: Lars Fricke [mailto:fricke at gisberater.com] >>>>> Gesendet: Dienstag, 13. Januar 2015 14:22 >>>>> An: Eichner, Andreas - SID; mapserver-users at lists.osgeo.org >>>>> Betreff: Re: [mapserver-users] Setting up a JSONP service >>>>> >>>>> Hi, >>>>> >>>>> I compiled MapServer after applying the patch (at least I think it was >>>>> applied). Unfortunately the output is not JSONP format. Maybe I'm >>>>> getting something wrong. So here is what I did: >>>>> Applied >>>>> patch -p1 < jsonp.diff >>>>> >>>>> I got an updated mapogroutput.c. >>>>> >>>>> I then compiled with the following options: >>>>> cmake -DCMAKE_INSTALL_PREFIX=/opt \ >>>>> -DCMAKE_PREFIX_PATH="/usr/local;/opt" \ >>>>> -DWITH_CLIENT_WFS=ON \ >>>>> -DWITH_CLIENT_WMS=ON \ >>>>> -DWITH_CURL=ON \ >>>>> -DWITH_SOS=ON \ >>>>> -DWITH_PHP=0 \ >>>>> -DWITH_PYTHON=ON \ >>>>> -DWITH_SVGCAIRO=OFF \ >>>>> -DWITH_ORACLESPATIAL=0 \ >>>>> -DWITH_MSSQL2008=OFF \ >>>>> -DWITH_THREAD_SAFETY=ON \ >>>>> -DWITH_LIBXML2=ON \ >>>>> -DWITH_MYSQL=ON\ >>>>> -DWITH_SDE=0 .. >../configure.out.txt >>>>> >>>>> Which goes through without any warning. >>>>> >>>>> I do make next, getting a few warnings about the Python bindings but >>>>> nothing about mapogroutput (ecept that it was compiled). Then sudo >> make >>>>> install. No warnings. >>>>> I then set a symlink to the new mapserv file inside cgi-bin and start >> my >>>>> apache. >>>>> >>>>> I changed my mapfile as you indicated: >>>>> WEB >>>>> FOOTER "test" >>>>> IMAGEPATH "/var/www/html/tmp/" >>>>> TEMPPATH "/var/www/html/tmp/" >>>>> IMAGEURL "/html/tmp/" >>>>> METADATA >>>>> "wfs_title" "Test" >>>>> "ows_onlineresource" "http://localhost:8082/wfs?" >>>>> "ows_enable_request" "*" >>>>> "ows_srs" "EPSG:3857" >>>>> "wfs_srs" "EPSG:3857" >>>>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" >>>>> "wfs_encoding" "UTF-8" >>>>> END # METADATA >>>>> VALIDATION >>>>> callback ".*" >>>>> END >>>>> END # WEB >>>>> >>>>> OUTPUTFORMAT >>>>> NAME "geojson" >>>>> DRIVER "OGR/GEOJSON" >>>>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" >>>>> FORMATOPTION "STORAGE=stream" >>>>> FORMATOPTION "FORM=SIMPLE" >>>>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" >>>>> FORMATOPTION "JSONP=%callback%" >>>>> END >>>>> >>>>> Unfortunately calling: >>>>> >> http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP >> ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 >>>>> 0228 >>>>> >>>>> gives me a result as before without your changes: >>>>> { >>>>> "type": "FeatureCollection", >>>>> "crs": { "type": "name", "properties": { "name": >>>>> "urn:ogc:def:crs:EPSG::3857" } }, >>>>> "features": [ >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ >>>>> 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ >>>>> 793757.73417, 6570202.31642 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ >>>>> 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ >>>>> 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ >>>>> 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ >>>>> 793752.31968, 6570224.89917 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ >>>>> 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ >>>>> 793735.55884, 6570231.00753 ] ] ] } } >>>>> ] >>>>> } >>>>> >>>>> I also tried this with an AJAX call from Javascript, giving me the >>>>> exactly same result. >>>>> >>>>> I get an error message trying to use the result in Leaflet telling me >> a >>>>> ";" is missing. I assume it should look like this: >>>>> >>>>> var testlayer = [{ >>>>> "type": "FeatureCollection", >>>>> "crs": { "type": "name", "properties": { "name": >>>>> "urn:ogc:def:crs:EPSG::3857" } }, >>>>> "features": [ >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ >>>>> 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ >>>>> 793757.73417, 6570202.31642 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ >>>>> 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ >>>>> 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ >>>>> 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ >>>>> 793752.31968, 6570224.89917 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ >>>>> 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ >>>>> 793735.55884, 6570231.00753 ] ] ] } } >>>>> ] >>>>> }]; >>>>> >>>>> I'm not sure what is going on. Am I not applying the changes correctly >>>>> or is my call wrong? >>>>> >>>>> Thanks for you great support. >>>>> >>>>> Best >>>>> >>>>> Lars >>>>> >>>>> >>>>> Am 09.01.2015 um 15:30 schrieb Eichner, Andreas - SID: >>>>>> Hi, >>>>>> >>>>>> I've attached a quick'n dirty solution (against master). When applied >>>> to >>>>>> mapogroutput.c you can set a JSONP formatoption to the callback name: >>>>>> >>>>>> OUTPUTFORMAT >>>>>> NAME 'geojson' >>>>>> DRIVER 'OGR/GEOJSON' >>>>>> MIMETYPE 'application/json; subtype=geojson; charset=utf-8' >>>>>> FORMATOPTION 'STORAGE=stream' >>>>>> FORMATOPTION 'FORM=simple' >>>>>> FORMATOPTION 'LCO:COORDINATE_PRECISION=5' >>>>>> FORMATOPTION 'JSONP=%callback%' >>>>>> END >>>>>> >>>>>> This needs of course a WEB.VALIDATION: >>>>>> WEB >>>>>> ... >>>>>> VALIDATION >>>>>> callback '.*' >>>>>> END >>>>>> END >>>>>> >>>>>> Would be great if you can test if this works (looks good to me). The >>>>> Devs might have a look if this could be integrated into master until >> OGR >>>>> has an appropriate layer creation option (solution described by Even). >>>>>> Greetings >>>>>> >>>>>>> -----Urspr?ngliche Nachricht----- >>>>>>> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver- >> users- >>>>>>> bounces at lists.osgeo.org] Im Auftrag von Lars Fricke >>>>>>> Gesendet: Freitag, 9. Januar 2015 11:24 >>>>>>> An: mapserver-users at lists.osgeo.org >>>>>>> Betreff: Re: [mapserver-users] Setting up a JSONP service >>>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> first of all: Thank you for your support! >>>>>>> Sorry for the late reply but I unfortunately was ill. >>>>>>> >>>>>>> @ Steve: >>>>>>> I read about templating but also read that it is slower? >>>>>>> I do not have a lot of experience in writing templates. Would you >>>> mind >>>>>>> sharing a JSONP template? >>>>>>> >>>>>>> @ Even: Thank you for your thoughts. Who would implement that change >>>>>>> though? I'm afraid I can't. >>>>>>> >>>>>>> @ Jeff: I followed those links but I only found threads referring to >>>>>>> GeoServer or that were not related to my question. The GDAL page I >>>> did >>>>>>> study and that's how I managed to set up the GeoJSON service but >>>> thats >>>>>>> not the same unfortunately as it conflicts with the same origin >>>> policy. >>>>>>> Best >>>>>>> >>>>>>> Lars >>>>>>> >>>>>>> Am 30.12.2014 um 16:24 schrieb Lime, Steve D (MNIT): >>>>>>>> You can also use MapServer templates to accomplish this. It's a >>>> little >>>>>>> more work since you have to write the template but it's quite >>>> flexible >>>>>>> then. Usually I write the template to produce JSON and then use a >>>>> simple >>>>>>> wrapper template to produce JSONP. For example, jsonp.js looks like >>>>>>> (callback is passed in): >>>>>>>> // MapServer Template >>>>>>>> [callback]( >>>>>>>> [include src="templates/json.js"] >>>>>>>> ) >>>>>>>> >>>>>>>> Output formats look like: >>>>>>>> >>>>>>>> OUTPUTFORMAT >>>>>>>> NAME 'JSON' >>>>>>>> DRIVER 'TEMPLATE' >>>>>>>> MIMETYPE 'application/json;' >>>>>>>> FORMATOPTION 'FILE=templates/json.js' >>>>>>>> FORMATOPTION 'ATTACHMENT=service.json' >>>>>>>> END >>>>>>>> >>>>>>>> OUTPUTFORMAT >>>>>>>> NAME 'JSONP' >>>>>>>> DRIVER 'TEMPLATE' >>>>>>>> MIMETYPE 'application/json;' >>>>>>>> FORMATOPTION 'FILE=templates/jsonp.js' >>>>>>>> FORMATOPTION 'ATTACHMENT=service.json' >>>>>>>> END >>>>>>>> >>>>>>>> Steve >>>>>>>> >>>>>>>> -----Original Message----- >>>>>>>> From:mapserver-users-bounces at lists.osgeo.org [mailto:mapserver- >>>> users- >>>>>>> bounces at lists.osgeo.org] On Behalf Of Lars Fricke >>>>>>>> Sent: Monday, December 29, 2014 5:34 AM >>>>>>>> To:mapserver-users at lists.osgeo.org >>>>>>>> Subject: [mapserver-users] Setting up a JSONP service >>>>>>>> >>>>>>>> Dear List, >>>>>>>> >>>>>>>> I have a WFS service running under MapServer that I would like to >>>>>>> operate as JSONP service. I managed to set GEOJSON as output format >>>> but >>>>> I >>>>>>> get "Cross-Origin-Request Blocked" if I try to call it with a >>>>> Javascript >>>>>>> client (using Leaflet L.layerJSON. >>>>>>>> The question is: Is it possible to set up a JSONP service from >>>>> Mapserver >>>>>>> and if yes, how? My current mapfile looks like this (relevant >> parts): >>>>>>>> " >>>>>>>> # in WEB - METADATA >>>>>>>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" >>>>>>>> >>>>>>>> OUTPUTFORMAT >>>>>>>> NAME "geojson" >>>>>>>> DRIVER "OGR/GEOJSON" >>>>>>>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" >>>>>>>> FORMATOPTION "STORAGE=stream" >>>>>>>> FORMATOPTION "FORM=SIMPLE" >>>>>>>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" >>>>>>>> END >>>>>>>> " >>>>>>>> If this would already be a correct JSONP service, I have to look on >>>>> the >>>>>>> Leaflet side for the error... >>>>>>>> Thanks for your help. >>>>>>>> >>>>>>>> Cheers >>>>>>>> >>>>>>>> Lars >>>>>>>> _______________________________________________ >>>>>>>> mapserver-users mailing list >>>>>>>> mapserver-users at lists.osgeo.org >>>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>>>>>> _______________________________________________ >>>>>>>> mapserver-users mailing list >>>>>>>> mapserver-users at lists.osgeo.org >>>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> mapserver-users mailing list >>>>>>> mapserver-users at lists.osgeo.org >>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>> _______________________________________________ >>>> 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 > From fricke at gisberater.com Wed Jan 14 01:58:56 2015 From: fricke at gisberater.com (Lars Fricke) Date: Wed, 14 Jan 2015 10:58:56 +0100 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <6F331135492B944D90731CE93743D5681BC6DB@FS-EX-DB102.fs.sachsen.de> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> <54B51BE7.3090409@gisberater.com> <6F331135492B944D90731CE93743D5681BC6AA@FS-EX-DB102.fs.sachsen.de> <6F331135492B944D90731CE93743D5681BC6B8@FS-EX-DB102.fs.sachsen.de> <54B53C07.7060503@gisberater.com> <6F331135492B944D90731CE93743D5681BC6DB@FS-EX-DB102.fs.sachsen.de> Message-ID: <54B63DE0.3080806@gisberater.com> Hi Andreas, I checked everything now and I'm sufficiently sure the system is using the correct Mapserver version. I also checked the binary path and everything seems fine. I'm still not getting the same output as you. I get an error message however: Content-Type:: command not found. Do I need to compile OGR, too? Or am I missing a compile option? Sorry, I'm really not experienced in this at all. Here is my configuration: cmake -DCMAKE_INSTALL_PREFIX=/opt \ -DCMAKE_PREFIX_PATH="/usr/local;/opt" \ -DWITH_CLIENT_WFS=ON \ -DWITH_CLIENT_WMS=ON \ -DWITH_OGR=ON \ -DWITH_CURL=ON \ -DWITH_SOS=ON \ -DWITH_PHP=0 \ -DWITH_PYTHON=ON \ -DWITH_SVGCAIRO=OFF \ -DWITH_ORACLESPATIAL=0 \ -DWITH_MSSQL2008=OFF \ -DWITH_THREAD_SAFETY=ON \ -DWITH_LIBXML2=ON \ -DWITH_MYSQL=ON\ -DWITH_SDE=0 .. >../configure.out.txt I really appreciate your efforts! Best Lars Am 13.01.2015 um 16:52 schrieb Eichner, Andreas - SID: > That's what I get on the console: > > $ MS_MAPFILE=$(pwd)/IHK_Handelsflaechen.map ./mapserv QUERY_STRING='service=WFS&version=1.1.0&request=GetFeature&featureid=IHK.71247&outputformat=geojson&callback=foobar'Content-Disposition: attachment; filename=result.dat > Content-Type: application/json; subtype=geojson; charset=utf-8 > > foobar({ > "type": "FeatureCollection", > > "features": [ > { "type": "Feature", "properties": { "PLZ": "09648", ..., "LANDKREIS": "Mittelsachsen" }, "geometry": { "type": "Point", "coordinates": [ 4568447.14, 5650577.57 ] } } > ] > } > ); > > In other words, the JSON is enclosed by "foobar(" and ");": The relevant parts of the mapfile are: > > OUTPUTFORMAT > NAME 'geojson' > # NAME 'jsonp' > DRIVER 'OGR/GEOJSON' > MIMETYPE 'application/json; subtype=geojson; charset=utf-8' > # MIMETYPE 'text/javascript; charset=utf-8' > FORMATOPTION 'STORAGE=stream' > FORMATOPTION 'FORM=simple' > FORMATOPTION 'LCO:COORDINATE_PRECISION=5' > FORMATOPTION 'JSONP=%callback%' > END > > WEB > VALIDATION > callback '.*' > # default_callback 'jsonp' > END > END > > The default value does not work, so the substitution parameter must be given. > > > >> -----Urspr?ngliche Nachricht----- >> Von: Lars Fricke [mailto:fricke at gisberater.com] >> Gesendet: Dienstag, 13. Januar 2015 16:39 >> An: Eichner, Andreas - SID; mapserver-users at lists.osgeo.org >> Betreff: Re: [mapserver-users] Setting up a JSONP service >> >> Hi Andreas, >> >> I guess I'm still doing something wrong. If I use >> http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP >> ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 >> 0228&callback=foobar >> >> I'm getting the exact same output as before. What are you getting? Can >> you post an example of your servers response? >> >> Thank you so much. >> >> Best >> >> Lars >> >> Am 13.01.2015 um 15:57 schrieb Eichner, Andreas - SID: >>> Arg.. outputformat=geojson also works, only had a typo... >>> >>>> -----Urspr?ngliche Nachricht----- >>>> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- >>>> bounces at lists.osgeo.org] Im Auftrag von Eichner, Andreas - SID >>>> Gesendet: Dienstag, 13. Januar 2015 15:18 >>>> An: 'lars.fricke at skendata.de'; mapserver-users at lists.osgeo.org >>>> Betreff: Re: [mapserver-users] Setting up a JSONP service >>>> >>>> You need to append the "callback" parameter to the query string: >>>> >>>> >> http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP >> ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 >>>> 0228&callback=foobar >>>> >>>> You can test on the command line, too: >>>> MS_MAPFILE=/path/to/mapfile ./mapserv >>>> QUERY_STRING='service=WFS&version=1.1.0&request=GetFeature&typename=HU& >>>> >> SRS=EPSG:3857&bbox=793732,6570204,793765,6570228&outputformat=application/ >>>> json; subtype=geojson; charset=utf-8&callback=foobar' >>>> >>>> Please note that IMHO "geojson" alone isn't enough. The full mimetype >>>> string should be used as reported by GetCapabilities. >>>> >>>> HTH >>>> >>>>> -----Urspr?ngliche Nachricht----- >>>>> Von: Lars Fricke [mailto:fricke at gisberater.com] >>>>> Gesendet: Dienstag, 13. Januar 2015 14:22 >>>>> An: Eichner, Andreas - SID; mapserver-users at lists.osgeo.org >>>>> Betreff: Re: [mapserver-users] Setting up a JSONP service >>>>> >>>>> Hi, >>>>> >>>>> I compiled MapServer after applying the patch (at least I think it was >>>>> applied). Unfortunately the output is not JSONP format. Maybe I'm >>>>> getting something wrong. So here is what I did: >>>>> Applied >>>>> patch -p1 < jsonp.diff >>>>> >>>>> I got an updated mapogroutput.c. >>>>> >>>>> I then compiled with the following options: >>>>> cmake -DCMAKE_INSTALL_PREFIX=/opt \ >>>>> -DCMAKE_PREFIX_PATH="/usr/local;/opt" \ >>>>> -DWITH_CLIENT_WFS=ON \ >>>>> -DWITH_CLIENT_WMS=ON \ >>>>> -DWITH_CURL=ON \ >>>>> -DWITH_SOS=ON \ >>>>> -DWITH_PHP=0 \ >>>>> -DWITH_PYTHON=ON \ >>>>> -DWITH_SVGCAIRO=OFF \ >>>>> -DWITH_ORACLESPATIAL=0 \ >>>>> -DWITH_MSSQL2008=OFF \ >>>>> -DWITH_THREAD_SAFETY=ON \ >>>>> -DWITH_LIBXML2=ON \ >>>>> -DWITH_MYSQL=ON\ >>>>> -DWITH_SDE=0 .. >../configure.out.txt >>>>> >>>>> Which goes through without any warning. >>>>> >>>>> I do make next, getting a few warnings about the Python bindings but >>>>> nothing about mapogroutput (ecept that it was compiled). Then sudo >> make >>>>> install. No warnings. >>>>> I then set a symlink to the new mapserv file inside cgi-bin and start >> my >>>>> apache. >>>>> >>>>> I changed my mapfile as you indicated: >>>>> WEB >>>>> FOOTER "test" >>>>> IMAGEPATH "/var/www/html/tmp/" >>>>> TEMPPATH "/var/www/html/tmp/" >>>>> IMAGEURL "/html/tmp/" >>>>> METADATA >>>>> "wfs_title" "Test" >>>>> "ows_onlineresource" "http://localhost:8082/wfs?" >>>>> "ows_enable_request" "*" >>>>> "ows_srs" "EPSG:3857" >>>>> "wfs_srs" "EPSG:3857" >>>>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" >>>>> "wfs_encoding" "UTF-8" >>>>> END # METADATA >>>>> VALIDATION >>>>> callback ".*" >>>>> END >>>>> END # WEB >>>>> >>>>> OUTPUTFORMAT >>>>> NAME "geojson" >>>>> DRIVER "OGR/GEOJSON" >>>>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" >>>>> FORMATOPTION "STORAGE=stream" >>>>> FORMATOPTION "FORM=SIMPLE" >>>>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" >>>>> FORMATOPTION "JSONP=%callback%" >>>>> END >>>>> >>>>> Unfortunately calling: >>>>> >> http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP >> ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 >>>>> 0228 >>>>> >>>>> gives me a result as before without your changes: >>>>> { >>>>> "type": "FeatureCollection", >>>>> "crs": { "type": "name", "properties": { "name": >>>>> "urn:ogc:def:crs:EPSG::3857" } }, >>>>> "features": [ >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ >>>>> 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ >>>>> 793757.73417, 6570202.31642 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ >>>>> 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ >>>>> 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ >>>>> 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ >>>>> 793752.31968, 6570224.89917 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ >>>>> 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ >>>>> 793735.55884, 6570231.00753 ] ] ] } } >>>>> ] >>>>> } >>>>> >>>>> I also tried this with an AJAX call from Javascript, giving me the >>>>> exactly same result. >>>>> >>>>> I get an error message trying to use the result in Leaflet telling me >> a >>>>> ";" is missing. I assume it should look like this: >>>>> >>>>> var testlayer = [{ >>>>> "type": "FeatureCollection", >>>>> "crs": { "type": "name", "properties": { "name": >>>>> "urn:ogc:def:crs:EPSG::3857" } }, >>>>> "features": [ >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ >>>>> 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ >>>>> 793757.73417, 6570202.31642 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ >>>>> 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ >>>>> 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ >>>>> 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ >>>>> 793752.31968, 6570224.89917 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ >>>>> 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ >>>>> 793735.55884, 6570231.00753 ] ] ] } } >>>>> ] >>>>> }]; >>>>> >>>>> I'm not sure what is going on. Am I not applying the changes correctly >>>>> or is my call wrong? >>>>> >>>>> Thanks for you great support. >>>>> >>>>> Best >>>>> >>>>> Lars >>>>> >>>>> >>>>> Am 09.01.2015 um 15:30 schrieb Eichner, Andreas - SID: >>>>>> Hi, >>>>>> >>>>>> I've attached a quick'n dirty solution (against master). When applied >>>> to >>>>>> mapogroutput.c you can set a JSONP formatoption to the callback name: >>>>>> >>>>>> OUTPUTFORMAT >>>>>> NAME 'geojson' >>>>>> DRIVER 'OGR/GEOJSON' >>>>>> MIMETYPE 'application/json; subtype=geojson; charset=utf-8' >>>>>> FORMATOPTION 'STORAGE=stream' >>>>>> FORMATOPTION 'FORM=simple' >>>>>> FORMATOPTION 'LCO:COORDINATE_PRECISION=5' >>>>>> FORMATOPTION 'JSONP=%callback%' >>>>>> END >>>>>> >>>>>> This needs of course a WEB.VALIDATION: >>>>>> WEB >>>>>> ... >>>>>> VALIDATION >>>>>> callback '.*' >>>>>> END >>>>>> END >>>>>> >>>>>> Would be great if you can test if this works (looks good to me). The >>>>> Devs might have a look if this could be integrated into master until >> OGR >>>>> has an appropriate layer creation option (solution described by Even). >>>>>> Greetings >>>>>> >>>>>>> -----Urspr?ngliche Nachricht----- >>>>>>> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver- >> users- >>>>>>> bounces at lists.osgeo.org] Im Auftrag von Lars Fricke >>>>>>> Gesendet: Freitag, 9. Januar 2015 11:24 >>>>>>> An: mapserver-users at lists.osgeo.org >>>>>>> Betreff: Re: [mapserver-users] Setting up a JSONP service >>>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> first of all: Thank you for your support! >>>>>>> Sorry for the late reply but I unfortunately was ill. >>>>>>> >>>>>>> @ Steve: >>>>>>> I read about templating but also read that it is slower? >>>>>>> I do not have a lot of experience in writing templates. Would you >>>> mind >>>>>>> sharing a JSONP template? >>>>>>> >>>>>>> @ Even: Thank you for your thoughts. Who would implement that change >>>>>>> though? I'm afraid I can't. >>>>>>> >>>>>>> @ Jeff: I followed those links but I only found threads referring to >>>>>>> GeoServer or that were not related to my question. The GDAL page I >>>> did >>>>>>> study and that's how I managed to set up the GeoJSON service but >>>> thats >>>>>>> not the same unfortunately as it conflicts with the same origin >>>> policy. >>>>>>> Best >>>>>>> >>>>>>> Lars >>>>>>> >>>>>>> Am 30.12.2014 um 16:24 schrieb Lime, Steve D (MNIT): >>>>>>>> You can also use MapServer templates to accomplish this. It's a >>>> little >>>>>>> more work since you have to write the template but it's quite >>>> flexible >>>>>>> then. Usually I write the template to produce JSON and then use a >>>>> simple >>>>>>> wrapper template to produce JSONP. For example, jsonp.js looks like >>>>>>> (callback is passed in): >>>>>>>> // MapServer Template >>>>>>>> [callback]( >>>>>>>> [include src="templates/json.js"] >>>>>>>> ) >>>>>>>> >>>>>>>> Output formats look like: >>>>>>>> >>>>>>>> OUTPUTFORMAT >>>>>>>> NAME 'JSON' >>>>>>>> DRIVER 'TEMPLATE' >>>>>>>> MIMETYPE 'application/json;' >>>>>>>> FORMATOPTION 'FILE=templates/json.js' >>>>>>>> FORMATOPTION 'ATTACHMENT=service.json' >>>>>>>> END >>>>>>>> >>>>>>>> OUTPUTFORMAT >>>>>>>> NAME 'JSONP' >>>>>>>> DRIVER 'TEMPLATE' >>>>>>>> MIMETYPE 'application/json;' >>>>>>>> FORMATOPTION 'FILE=templates/jsonp.js' >>>>>>>> FORMATOPTION 'ATTACHMENT=service.json' >>>>>>>> END >>>>>>>> >>>>>>>> Steve >>>>>>>> >>>>>>>> -----Original Message----- >>>>>>>> From:mapserver-users-bounces at lists.osgeo.org [mailto:mapserver- >>>> users- >>>>>>> bounces at lists.osgeo.org] On Behalf Of Lars Fricke >>>>>>>> Sent: Monday, December 29, 2014 5:34 AM >>>>>>>> To:mapserver-users at lists.osgeo.org >>>>>>>> Subject: [mapserver-users] Setting up a JSONP service >>>>>>>> >>>>>>>> Dear List, >>>>>>>> >>>>>>>> I have a WFS service running under MapServer that I would like to >>>>>>> operate as JSONP service. I managed to set GEOJSON as output format >>>> but >>>>> I >>>>>>> get "Cross-Origin-Request Blocked" if I try to call it with a >>>>> Javascript >>>>>>> client (using Leaflet L.layerJSON. >>>>>>>> The question is: Is it possible to set up a JSONP service from >>>>> Mapserver >>>>>>> and if yes, how? My current mapfile looks like this (relevant >> parts): >>>>>>>> " >>>>>>>> # in WEB - METADATA >>>>>>>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" >>>>>>>> >>>>>>>> OUTPUTFORMAT >>>>>>>> NAME "geojson" >>>>>>>> DRIVER "OGR/GEOJSON" >>>>>>>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" >>>>>>>> FORMATOPTION "STORAGE=stream" >>>>>>>> FORMATOPTION "FORM=SIMPLE" >>>>>>>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" >>>>>>>> END >>>>>>>> " >>>>>>>> If this would already be a correct JSONP service, I have to look on >>>>> the >>>>>>> Leaflet side for the error... >>>>>>>> Thanks for your help. >>>>>>>> >>>>>>>> Cheers >>>>>>>> >>>>>>>> Lars >>>>>>>> _______________________________________________ >>>>>>>> mapserver-users mailing list >>>>>>>> mapserver-users at lists.osgeo.org >>>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>>>>>> _______________________________________________ >>>>>>>> mapserver-users mailing list >>>>>>>> mapserver-users at lists.osgeo.org >>>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> mapserver-users mailing list >>>>>>> mapserver-users at lists.osgeo.org >>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>> _______________________________________________ >>>> 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 > From mathieu.coudert at gmail.com Wed Jan 14 02:01:59 2015 From: mathieu.coudert at gmail.com (Mathieu Coudert) Date: Wed, 14 Jan 2015 11:01:59 +0100 Subject: [mapserver-users] FW: Errors about mapcache configure in apache httpd In-Reply-To: References: Message-ID: Hi, I would suggest you to check/update your shared libraries after compiling MapCache... You will find more info there : http://unix.stackexchange.com/questions/67781/use-shared-libraries-in-usr-local-lib Cheers, Mathieu On Wed, Jan 14, 2015 at 2:12 AM, ??? wrote: > Hi, list: > > I had succeeded in compiling and installing the mapcache according to the > guide , but there was > something wrong with integrating mod_mapcache.so to apache httpd. The > following is my logs about compiling and installing and httpd conf file. > > > > > > > > > > > mapcache.conf > > > LoadModule mapcache_module modules/mod_apreq2.so > > # > # Require all granted > # > #MapCacheAlias /mapcache "/var/www/mapcache/mapcache.xml" > > > > > > > > > > > [root at localhost build]# systemctl status httpd.service -l > httpd.service - The Apache HTTP Server > Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled) > Active: failed (Result: exit-code) since ? 2015-01-14 08:19:05 CST; 7s > ago > Process: 29697 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, > status=0/SUCCESS) > Process: 29695 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND > (code=exited, status=1/FAILURE) > Main PID: 29695 (code=exited, status=1/FAILURE) > Status: "Total requests: 0; Current requests/sec: 0; Current traffic: > 0 B/sec" > > 1? 14 08:19:05 localhost.localdomain httpd[29695]: httpd: Syntax error on > line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 of > /etc/httpd/conf.modules.d/10-mp-.conf: Cannot load modules/mod_mapcache.so > into server: libmapcache.so.1: cannot open shared object file: No such file > or directory > 1? 14 08:19:05 localhost.localdomain systemd[1]: httpd.service: main > process exited, code=exited, status=1/FAILURE > 1? 14 08:19:05 localhost.localdomain systemd[1]: Failed to start The > Apache HTTP Server. > 1? 14 08:19:05 localhost.localdomain systemd[1]: Unit httpd.service > entered failed state. > > > Any advice will be appreciated. > > > Regards, > > liuxiaoer > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fricke at gisberater.com Wed Jan 14 05:21:58 2015 From: fricke at gisberater.com (Lars Fricke) Date: Wed, 14 Jan 2015 14:21:58 +0100 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <6F331135492B944D90731CE93743D5681BC6DB@FS-EX-DB102.fs.sachsen.de> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> <54B51BE7.3090409@gisberater.com> <6F331135492B944D90731CE93743D5681BC6AA@FS-EX-DB102.fs.sachsen.de> <6F331135492B944D90731CE93743D5681BC6B8@FS-EX-DB102.fs.sachsen.de> <54B53C07.7060503@gisberater.com> <6F331135492B944D90731CE93743D5681BC6DB@FS-EX-DB102.fs.sachsen.de> Message-ID: <54B66D76.60507@gisberater.com> Hi Andreas, I found it! I compiled against mapserver-6.4.1 instead of mapserver-master o_O. I now compiled against master and it works.... Thanks again for your great support! I will now see if I can use this output in my application correctly. Best Lars Am 13.01.2015 um 16:52 schrieb Eichner, Andreas - SID: > That's what I get on the console: > > $ MS_MAPFILE=$(pwd)/IHK_Handelsflaechen.map ./mapserv QUERY_STRING='service=WFS&version=1.1.0&request=GetFeature&featureid=IHK.71247&outputformat=geojson&callback=foobar'Content-Disposition: attachment; filename=result.dat > Content-Type: application/json; subtype=geojson; charset=utf-8 > > foobar({ > "type": "FeatureCollection", > > "features": [ > { "type": "Feature", "properties": { "PLZ": "09648", ..., "LANDKREIS": "Mittelsachsen" }, "geometry": { "type": "Point", "coordinates": [ 4568447.14, 5650577.57 ] } } > ] > } > ); > > In other words, the JSON is enclosed by "foobar(" and ");": The relevant parts of the mapfile are: > > OUTPUTFORMAT > NAME 'geojson' > # NAME 'jsonp' > DRIVER 'OGR/GEOJSON' > MIMETYPE 'application/json; subtype=geojson; charset=utf-8' > # MIMETYPE 'text/javascript; charset=utf-8' > FORMATOPTION 'STORAGE=stream' > FORMATOPTION 'FORM=simple' > FORMATOPTION 'LCO:COORDINATE_PRECISION=5' > FORMATOPTION 'JSONP=%callback%' > END > > WEB > VALIDATION > callback '.*' > # default_callback 'jsonp' > END > END > > The default value does not work, so the substitution parameter must be given. > > > >> -----Urspr?ngliche Nachricht----- >> Von: Lars Fricke [mailto:fricke at gisberater.com] >> Gesendet: Dienstag, 13. Januar 2015 16:39 >> An: Eichner, Andreas - SID; mapserver-users at lists.osgeo.org >> Betreff: Re: [mapserver-users] Setting up a JSONP service >> >> Hi Andreas, >> >> I guess I'm still doing something wrong. If I use >> http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP >> ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 >> 0228&callback=foobar >> >> I'm getting the exact same output as before. What are you getting? Can >> you post an example of your servers response? >> >> Thank you so much. >> >> Best >> >> Lars >> >> Am 13.01.2015 um 15:57 schrieb Eichner, Andreas - SID: >>> Arg.. outputformat=geojson also works, only had a typo... >>> >>>> -----Urspr?ngliche Nachricht----- >>>> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- >>>> bounces at lists.osgeo.org] Im Auftrag von Eichner, Andreas - SID >>>> Gesendet: Dienstag, 13. Januar 2015 15:18 >>>> An: 'lars.fricke at skendata.de'; mapserver-users at lists.osgeo.org >>>> Betreff: Re: [mapserver-users] Setting up a JSONP service >>>> >>>> You need to append the "callback" parameter to the query string: >>>> >>>> >> http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP >> ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 >>>> 0228&callback=foobar >>>> >>>> You can test on the command line, too: >>>> MS_MAPFILE=/path/to/mapfile ./mapserv >>>> QUERY_STRING='service=WFS&version=1.1.0&request=GetFeature&typename=HU& >>>> >> SRS=EPSG:3857&bbox=793732,6570204,793765,6570228&outputformat=application/ >>>> json; subtype=geojson; charset=utf-8&callback=foobar' >>>> >>>> Please note that IMHO "geojson" alone isn't enough. The full mimetype >>>> string should be used as reported by GetCapabilities. >>>> >>>> HTH >>>> >>>>> -----Urspr?ngliche Nachricht----- >>>>> Von: Lars Fricke [mailto:fricke at gisberater.com] >>>>> Gesendet: Dienstag, 13. Januar 2015 14:22 >>>>> An: Eichner, Andreas - SID; mapserver-users at lists.osgeo.org >>>>> Betreff: Re: [mapserver-users] Setting up a JSONP service >>>>> >>>>> Hi, >>>>> >>>>> I compiled MapServer after applying the patch (at least I think it was >>>>> applied). Unfortunately the output is not JSONP format. Maybe I'm >>>>> getting something wrong. So here is what I did: >>>>> Applied >>>>> patch -p1 < jsonp.diff >>>>> >>>>> I got an updated mapogroutput.c. >>>>> >>>>> I then compiled with the following options: >>>>> cmake -DCMAKE_INSTALL_PREFIX=/opt \ >>>>> -DCMAKE_PREFIX_PATH="/usr/local;/opt" \ >>>>> -DWITH_CLIENT_WFS=ON \ >>>>> -DWITH_CLIENT_WMS=ON \ >>>>> -DWITH_CURL=ON \ >>>>> -DWITH_SOS=ON \ >>>>> -DWITH_PHP=0 \ >>>>> -DWITH_PYTHON=ON \ >>>>> -DWITH_SVGCAIRO=OFF \ >>>>> -DWITH_ORACLESPATIAL=0 \ >>>>> -DWITH_MSSQL2008=OFF \ >>>>> -DWITH_THREAD_SAFETY=ON \ >>>>> -DWITH_LIBXML2=ON \ >>>>> -DWITH_MYSQL=ON\ >>>>> -DWITH_SDE=0 .. >../configure.out.txt >>>>> >>>>> Which goes through without any warning. >>>>> >>>>> I do make next, getting a few warnings about the Python bindings but >>>>> nothing about mapogroutput (ecept that it was compiled). Then sudo >> make >>>>> install. No warnings. >>>>> I then set a symlink to the new mapserv file inside cgi-bin and start >> my >>>>> apache. >>>>> >>>>> I changed my mapfile as you indicated: >>>>> WEB >>>>> FOOTER "test" >>>>> IMAGEPATH "/var/www/html/tmp/" >>>>> TEMPPATH "/var/www/html/tmp/" >>>>> IMAGEURL "/html/tmp/" >>>>> METADATA >>>>> "wfs_title" "Test" >>>>> "ows_onlineresource" "http://localhost:8082/wfs?" >>>>> "ows_enable_request" "*" >>>>> "ows_srs" "EPSG:3857" >>>>> "wfs_srs" "EPSG:3857" >>>>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" >>>>> "wfs_encoding" "UTF-8" >>>>> END # METADATA >>>>> VALIDATION >>>>> callback ".*" >>>>> END >>>>> END # WEB >>>>> >>>>> OUTPUTFORMAT >>>>> NAME "geojson" >>>>> DRIVER "OGR/GEOJSON" >>>>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" >>>>> FORMATOPTION "STORAGE=stream" >>>>> FORMATOPTION "FORM=SIMPLE" >>>>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" >>>>> FORMATOPTION "JSONP=%callback%" >>>>> END >>>>> >>>>> Unfortunately calling: >>>>> >> http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP >> ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 >>>>> 0228 >>>>> >>>>> gives me a result as before without your changes: >>>>> { >>>>> "type": "FeatureCollection", >>>>> "crs": { "type": "name", "properties": { "name": >>>>> "urn:ogc:def:crs:EPSG::3857" } }, >>>>> "features": [ >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ >>>>> 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ >>>>> 793757.73417, 6570202.31642 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ >>>>> 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ >>>>> 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ >>>>> 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ >>>>> 793752.31968, 6570224.89917 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ >>>>> 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ >>>>> 793735.55884, 6570231.00753 ] ] ] } } >>>>> ] >>>>> } >>>>> >>>>> I also tried this with an AJAX call from Javascript, giving me the >>>>> exactly same result. >>>>> >>>>> I get an error message trying to use the result in Leaflet telling me >> a >>>>> ";" is missing. I assume it should look like this: >>>>> >>>>> var testlayer = [{ >>>>> "type": "FeatureCollection", >>>>> "crs": { "type": "name", "properties": { "name": >>>>> "urn:ogc:def:crs:EPSG::3857" } }, >>>>> "features": [ >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ >>>>> 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ >>>>> 793757.73417, 6570202.31642 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ >>>>> 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ >>>>> 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ >>>>> 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ >>>>> 793752.31968, 6570224.89917 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ >>>>> 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ >>>>> 793735.55884, 6570231.00753 ] ] ] } } >>>>> ] >>>>> }]; >>>>> >>>>> I'm not sure what is going on. Am I not applying the changes correctly >>>>> or is my call wrong? >>>>> >>>>> Thanks for you great support. >>>>> >>>>> Best >>>>> >>>>> Lars >>>>> >>>>> >>>>> Am 09.01.2015 um 15:30 schrieb Eichner, Andreas - SID: >>>>>> Hi, >>>>>> >>>>>> I've attached a quick'n dirty solution (against master). When applied >>>> to >>>>>> mapogroutput.c you can set a JSONP formatoption to the callback name: >>>>>> >>>>>> OUTPUTFORMAT >>>>>> NAME 'geojson' >>>>>> DRIVER 'OGR/GEOJSON' >>>>>> MIMETYPE 'application/json; subtype=geojson; charset=utf-8' >>>>>> FORMATOPTION 'STORAGE=stream' >>>>>> FORMATOPTION 'FORM=simple' >>>>>> FORMATOPTION 'LCO:COORDINATE_PRECISION=5' >>>>>> FORMATOPTION 'JSONP=%callback%' >>>>>> END >>>>>> >>>>>> This needs of course a WEB.VALIDATION: >>>>>> WEB >>>>>> ... >>>>>> VALIDATION >>>>>> callback '.*' >>>>>> END >>>>>> END >>>>>> >>>>>> Would be great if you can test if this works (looks good to me). The >>>>> Devs might have a look if this could be integrated into master until >> OGR >>>>> has an appropriate layer creation option (solution described by Even). >>>>>> Greetings >>>>>> >>>>>>> -----Urspr?ngliche Nachricht----- >>>>>>> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver- >> users- >>>>>>> bounces at lists.osgeo.org] Im Auftrag von Lars Fricke >>>>>>> Gesendet: Freitag, 9. Januar 2015 11:24 >>>>>>> An: mapserver-users at lists.osgeo.org >>>>>>> Betreff: Re: [mapserver-users] Setting up a JSONP service >>>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> first of all: Thank you for your support! >>>>>>> Sorry for the late reply but I unfortunately was ill. >>>>>>> >>>>>>> @ Steve: >>>>>>> I read about templating but also read that it is slower? >>>>>>> I do not have a lot of experience in writing templates. Would you >>>> mind >>>>>>> sharing a JSONP template? >>>>>>> >>>>>>> @ Even: Thank you for your thoughts. Who would implement that change >>>>>>> though? I'm afraid I can't. >>>>>>> >>>>>>> @ Jeff: I followed those links but I only found threads referring to >>>>>>> GeoServer or that were not related to my question. The GDAL page I >>>> did >>>>>>> study and that's how I managed to set up the GeoJSON service but >>>> thats >>>>>>> not the same unfortunately as it conflicts with the same origin >>>> policy. >>>>>>> Best >>>>>>> >>>>>>> Lars >>>>>>> >>>>>>> Am 30.12.2014 um 16:24 schrieb Lime, Steve D (MNIT): >>>>>>>> You can also use MapServer templates to accomplish this. It's a >>>> little >>>>>>> more work since you have to write the template but it's quite >>>> flexible >>>>>>> then. Usually I write the template to produce JSON and then use a >>>>> simple >>>>>>> wrapper template to produce JSONP. For example, jsonp.js looks like >>>>>>> (callback is passed in): >>>>>>>> // MapServer Template >>>>>>>> [callback]( >>>>>>>> [include src="templates/json.js"] >>>>>>>> ) >>>>>>>> >>>>>>>> Output formats look like: >>>>>>>> >>>>>>>> OUTPUTFORMAT >>>>>>>> NAME 'JSON' >>>>>>>> DRIVER 'TEMPLATE' >>>>>>>> MIMETYPE 'application/json;' >>>>>>>> FORMATOPTION 'FILE=templates/json.js' >>>>>>>> FORMATOPTION 'ATTACHMENT=service.json' >>>>>>>> END >>>>>>>> >>>>>>>> OUTPUTFORMAT >>>>>>>> NAME 'JSONP' >>>>>>>> DRIVER 'TEMPLATE' >>>>>>>> MIMETYPE 'application/json;' >>>>>>>> FORMATOPTION 'FILE=templates/jsonp.js' >>>>>>>> FORMATOPTION 'ATTACHMENT=service.json' >>>>>>>> END >>>>>>>> >>>>>>>> Steve >>>>>>>> >>>>>>>> -----Original Message----- >>>>>>>> From:mapserver-users-bounces at lists.osgeo.org [mailto:mapserver- >>>> users- >>>>>>> bounces at lists.osgeo.org] On Behalf Of Lars Fricke >>>>>>>> Sent: Monday, December 29, 2014 5:34 AM >>>>>>>> To:mapserver-users at lists.osgeo.org >>>>>>>> Subject: [mapserver-users] Setting up a JSONP service >>>>>>>> >>>>>>>> Dear List, >>>>>>>> >>>>>>>> I have a WFS service running under MapServer that I would like to >>>>>>> operate as JSONP service. I managed to set GEOJSON as output format >>>> but >>>>> I >>>>>>> get "Cross-Origin-Request Blocked" if I try to call it with a >>>>> Javascript >>>>>>> client (using Leaflet L.layerJSON. >>>>>>>> The question is: Is it possible to set up a JSONP service from >>>>> Mapserver >>>>>>> and if yes, how? My current mapfile looks like this (relevant >> parts): >>>>>>>> " >>>>>>>> # in WEB - METADATA >>>>>>>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" >>>>>>>> >>>>>>>> OUTPUTFORMAT >>>>>>>> NAME "geojson" >>>>>>>> DRIVER "OGR/GEOJSON" >>>>>>>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" >>>>>>>> FORMATOPTION "STORAGE=stream" >>>>>>>> FORMATOPTION "FORM=SIMPLE" >>>>>>>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" >>>>>>>> END >>>>>>>> " >>>>>>>> If this would already be a correct JSONP service, I have to look on >>>>> the >>>>>>> Leaflet side for the error... >>>>>>>> Thanks for your help. >>>>>>>> >>>>>>>> Cheers >>>>>>>> >>>>>>>> Lars >>>>>>>> _______________________________________________ >>>>>>>> mapserver-users mailing list >>>>>>>> mapserver-users at lists.osgeo.org >>>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>>>>>> _______________________________________________ >>>>>>>> mapserver-users mailing list >>>>>>>> mapserver-users at lists.osgeo.org >>>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> mapserver-users mailing list >>>>>>> mapserver-users at lists.osgeo.org >>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>> _______________________________________________ >>>> 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 > From eleonora at creativalab.com Wed Jan 14 05:58:34 2015 From: eleonora at creativalab.com (kassandraxx) Date: Wed, 14 Jan 2015 05:58:34 -0800 (PST) Subject: [mapserver-users] mapserver - postgis/postgresql connection problem Message-ID: <1421243914740-5181475.post@n6.nabble.com> Hello! http://archeogis.myftp.org/pmapper-4.2.0/map_default.phtml in this example, I can see the data uploaded to the ftp, but I can not see the data uploaded to the database ( ager Firmanus ) . In QGIS i can add postgis vector data, then the database is working properly. This is part of my map file LAYER NAME 'Ager Firmanus' TYPE LINE DUMP true TEMPLATE void EXTENT 325018.498153 4739346.182159 402747.056951 4777108.180989 CONNECTIONTYPE postgis CONNECTION "dbname='db_name' host=archeogis.myftp.org port=5432 user='xxx' password='xxx' sslmode=disable" DATA 'the_geom FROM "ager_firmanus" USING UNIQUE gid USING srid=32633' METADATA 'ows_title' 'ager_firmanus' END STATUS OFF TRANSPARENCY 100 PROJECTION 'proj=utm' 'zone=33' 'datum=WGS84' 'units=m' 'no_defs' END CLASS NAME 'ager_firmanus' STYLE WIDTH 1 COLOR 77 158 104 END END END Table ager_firmanus gid Id the_geom 1 0 0102000020797F0000FE0000004979E20BBB4A1841014A22E... table geometry_columns f_table_catalog f_table_schema f_table_name f_geometry_column coord_dimension srid type db_name public ager_firmanus the_geom 2 32633 LINESTRING I can not understand where is the error :( -- View this message in context: http://osgeo-org.1560.x6.nabble.com/mapserver-postgis-postgresql-connection-problem-tp5181475.html Sent from the Mapserver - User mailing list archive at Nabble.com. From jukka.rahkonen at maanmittauslaitos.fi Wed Jan 14 06:30:00 2015 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Wed, 14 Jan 2015 14:30:00 +0000 Subject: [mapserver-users] mapserver - postgis/postgresql connection problem Message-ID: Hi, At least your DATA, EXTENT and PROJECTION do not match. You define the projection of the layer as EPSG:4326 but I guess that it EPSG:32633. TRANSPARENCY 100 means totally transparent map so even if it happens to work you can't notice it. Then I am not sure if pmapper can turn the status of the layer from OFF to ON. However, I am sure that starting testing with an application is never a good idea. Test first with shp2img http://mapserver.org/utilities/shp2img.html and you can avoid the troubles caused by http server and misconfigured client. Once you can see that you map works with shp2img you can continue. It would be good to see your whole mapfile. If you have created it with the QGIS plugin it will not work without some more edits. -Jukka Rahkonen- kassandraxx wrote: > Hello! > http://archeogis.myftp.org/pmapper-4.2.0/map_default.phtml > in this example, I can see the data uploaded to the ftp, but I can not see the data uploaded to the database ( ager Firmanus ) . In QGIS i can add postgis vector data, then the database is working properly. > This is part of my map file LAYER NAME 'Ager Firmanus' TYPE LINE DUMP true TEMPLATE void EXTENT 325018.498153 4739346.182159 402747.056951 4777108.180989 CONNECTIONTYPE postgis CONNECTION "dbname='db_name' host=archeogis.myftp.org port=5432 user='xxx' password='xxx' sslmode=disable" DATA 'the_geom FROM "ager_firmanus" USING UNIQUE gid USING srid=32633' METADATA 'ows_title' 'ager_firmanus' END STATUS OFF TRANSPARENCY 100 PROJECTION 'proj=utm' 'zone=33' 'datum=WGS84' 'units=m' 'no_defs' END CLASS NAME 'ager_firmanus' STYLE WIDTH 1 COLOR 77 158 104 END END END Table ager_firmanus gid Id the_geom 1 0 0102000020797F0000FE0000004979E20BBB4A1841014A22E... table geometry_columns f_table_catalog f_table_schema f_table_name f_geometry_column coord_dimension srid type db_name public ager_firmanus the_geom 2 32633 LINESTRING I can not understand where is the error :( -- View this message in context: http://osgeo-org.1560.x6.nabble.com/mapserver-postgis-postgresql-connection-problem-tp5181475.html Sent from the Mapserver - User mailing list archive at Nabble.com. _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users From eleonora at creativalab.com Wed Jan 14 07:37:35 2015 From: eleonora at creativalab.com (kassandraxx) Date: Wed, 14 Jan 2015 07:37:35 -0800 (PST) Subject: [mapserver-users] mapserver - postgis/postgresql connection problem In-Reply-To: References: <1421243914740-5181475.post@n6.nabble.com> Message-ID: <1421249855509-5181502.post@n6.nabble.com> thanks so much for your advice, unfortunately, are still inexperienced. :( my project and my files are based on wgs84 utm 33N I checked all extend with ogrinfo and I corrected then I tried as you suggested to use shp2img on my map file and this is the error that comes back: shp2img -m pmapper_demo.map -o test.png msDrawMap(): Image handling error. Failed to draw layer named 'Ager Firmanus'.
msPostGISLayerWhichShapes(): Query error. Error (ERROR: function geomfromtext(u nknown, integer) does not exist LINE 1: ...geom,"gid" from "ager_firmanus" where the_geom && GeomFromTe... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. ) executing query: select encode(ST_AsBinary(ST_Force_2D("the_geom"),'NDR'),'hex ') as geom,"gid" from "ager_firmanus" where the_geom && GeomFromText('POLYGON((2 52691.191155437 4727437.25648659,252691.191155437 4871219.56915799,425287.594538 208 4871219.56915799,425287.594538208 4727437.25648659,252691.191155437 4727437. 25648659))',32633)
this is my whole file map MAP EXTENT 266351.432505 4727437.256493 411627.353192 4871219.569158 IMAGECOLOR 255 255 255 UNITS meters SIZE 600 500 SHAPEPATH "/var/www/data" SYMBOLSET "../common/symbols/symbols-pmapper.sym" FONTSET "../common/fonts/msfontset.txt" RESOLUTION 96 IMAGETYPE png PROJECTION 'proj=utm' 'zone=33' 'datum=WGS84' 'units=m' 'no_defs' END # Start of web interface definition WEB TEMPLATE "map.html" IMAGEPATH "/var/www/tmp/" IMAGEURL "/tmp/" END # Web # Start of Reference map definition REFERENCE EXTENT 266351.432505 4727437.256493 411627.353192 4871219.569158 IMAGE "../../images/reference.png" SIZE 229 149 COLOR -1 -1 -1 OUTLINECOLOR 255 0 0 END # Reference # Start of legend LEGEND KEYSIZE 20 20 IMAGECOLOR 255 255 255 LABEL TYPE TRUETYPE FONT "georgia" SIZE 11 COLOR 200 50 0 END STATUS ON END SCALEBAR IMAGECOLOR 255 255 255 LABEL COLOR 0 0 0 SIZE small END STYLE 1 SIZE 350 10 COLOR 0 0 125 UNITS KILOMETERS INTERVALS 4 TRANSPARENT FALSE STATUS ON END # Scalebar object ends # Start of querymap QUERYMAP SIZE 200 150 STATUS ON STYLE SELECTED COLOR 255 0 0 END #================== START OF LAYER SECTION =====================# LAYER # States polygon layer begins here NAME "Marche" TEMPLATE void EXTENT 266351.432505 4727437.256493 411627.353192 4871219.569158 DATA "marche" STATUS OFF TYPE POLYGON METADATA "ows_title" "marche" END # Metadata CLASS NAME "marche" STYLE COLOR 200 254 199 END END END # States polygon layer ends here LAYER NAME "Comuni" TYPE POLYGON DUMP true TEMPLATE void EXTENT 354559.923623 4741968.996931 380152.627473 4767524.906967 DATA "comuni_ricerca" METADATA 'ows_title' 'comuni_ricerca' END STATUS OFF PROJECTION 'proj=utm' 'zone=33' 'datum=WGS84' 'units=m' 'no_defs' END CLASSITEM 'NOME_COM' CLASS NAME "Amandola" EXPRESSION "Amandola" STYLE WIDTH 1 OUTLINECOLOR 0 0 0 COLOR 90 218 71 END END CLASS NAME "Comunanza" EXPRESSION "Comunanza" STYLE WIDTH 1 OUTLINECOLOR 0 0 0 COLOR 204 163 11 END END CLASS NAME "Montefalcone Appennino" EXPRESSION "Montefalcone Appennino" STYLE WIDTH 1 OUTLINECOLOR 0 0 0 COLOR 59 114 249 END END CLASS NAME "Montefortino" EXPRESSION "Montefortino" STYLE WIDTH 1 OUTLINECOLOR 0 0 0 COLOR 211 131 138 END END CLASS NAME "Montemonaco" EXPRESSION "Montemonaco" STYLE WIDTH 1 OUTLINECOLOR 0 0 0 COLOR 77 182 62 END END CLASS NAME "Santa Vittoria in Matenano" EXPRESSION "Santa Vittoria in Matenano" STYLE WIDTH 1 OUTLINECOLOR 0 0 0 COLOR 88 128 122 END END CLASS NAME "Smerillo" EXPRESSION "Smerillo" STYLE WIDTH 0.91 OUTLINECOLOR 0 0 0 COLOR 53 149 170 END END END LAYER NAME "Cittadine" TYPE POINT DUMP true TEMPLATE void EXTENT 365500.628492 4757245.000969 370593.603261 4759482.322111 DATA "citta" METADATA 'ows_title' 'citta' END STATUS OFF PROJECTION 'proj=utm' 'zone=33' 'datum=WGS84' 'units=m' 'no_defs' END CLASS NAME 'citta' STYLE SYMBOL "circle" SIZE 7.0 OUTLINECOLOR 0 0 0 COLOR 214 205 104 END END END LAYER NAME "Idrografia" TYPE LINE DUMP true TEMPLATE void EXTENT 355646.233379 4743380.868410 380147.958386 4767436.959607 DATA "idrografia_clip" METADATA 'ows_title' 'idrografia_clip' END STATUS OFF PROJECTION 'proj=utm' 'zone=33' 'datum=WGS84' 'units=m' 'no_defs' END CLASS NAME 'idrografia_clip' STYLE WIDTH 1 COLOR 146 190 255 END END END LAYER NAME "Curve di livello" TYPE LINE DUMP true TEMPLATE void EXTENT 354562.132679 4741970.274523 380150.652637 4767491.845169 DATA "isoipse_clip" METADATA 'ows_title' 'isoipse_clip' END STATUS OFF PROJECTION 'proj=utm' 'zone=33' 'datum=WGS84' 'units=m' 'no_defs' END CLASS NAME 'isoipse_clip' STYLE WIDTH 1 COLOR 237 237 237 END END END LAYER NAME "Strade" TYPE LINE DUMP true TEMPLATE void EXTENT 354639.299023 4742245.805300 379951.835356 4767409.867252 DATA "viabilita_clip" METADATA 'ows_title' 'viabilita_clip' END STATUS OFF PROJECTION 'proj=utm' 'zone=33' 'datum=WGS84' 'units=m' 'no_defs' END CLASS NAME 'viabilita_clip' STYLE WIDTH 0.10 COLOR 0 0 0 END END END LAYER # States polygon layer begins here NAME "Edifici" DATA "edifici" DUMP true TEMPLATE void EXTENT 357707.023218 4756331.869061 377721.396435 4767017.463077 STATUS OFF TYPE POLYGON METADATA "ows_title" "edifici" END # Metadata CLASS NAME "edifici" STYLE COLOR 156 156 156 END END END # States polygon layer ends here LAYER NAME 'Ager Firmanus' TYPE LINE DUMP true TEMPLATE void EXTENT 373783.754747 4759872.638913 405743.922708 4794307.658343 CONNECTIONTYPE postgis CONNECTION "dbname='db_name' host=archeogis.myftp.org port=5432 user='xxx' password='xxx' sslmode=disable" DATA 'the_geom FROM "ager_firmanus" USING UNIQUE gid USING srid=32633' METADATA 'ows_title' 'ager_firmanus' END STATUS ON PROJECTION 'proj=utm' 'zone=33' 'datum=WGS84' 'units=m' 'no_defs' END CLASS NAME 'ager_firmanus' STYLE WIDTH 10 COLOR 77 158 104 END END END END #Map -- View this message in context: http://osgeo-org.1560.x6.nabble.com/mapserver-postgis-postgresql-connection-problem-tp5181475p5181502.html Sent from the Mapserver - User mailing list archive at Nabble.com. From fricke at gisberater.com Wed Jan 14 08:07:26 2015 From: fricke at gisberater.com (Lars Fricke) Date: Wed, 14 Jan 2015 17:07:26 +0100 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> Message-ID: <54B6943E.3090904@gisberater.com> Hi Steve, I really appreciate that you took this effort! In the meantime (after I wrote my question to you), Andreas has come up with a more direct solution and since we will have quite some traffic on the server I expect we will need every bit of performance. So I guess we will not use templates after all. Anyway, it's great how people on this list respond with different good solutions and suggestions! Thank you! Best Lars Am 14.01.2015 um 00:41 schrieb Lime, Steve D (MNIT): > Hi Lars: Most of what you need was in my last reply. Those are snippets from a working configuration. Here's a simple JSON template for a raster query that creates an array of xyz objects: > > // MapServer Template > {'result':{ > 'points':[ > [resultset layer="elev_dem30ra3"] > [feature trimlast=","]{x:[x], y:[y], z:[value_0]},[/feature] > [/resultset] > ] > }} > > You could turn this into JSONP and not use the include strategy (I wanted both JSON and JSONP) simply by wrapping the object in callback (callback is a value passed through MapServer, e.g. &mode=query&callback=foo): > > // MapServer Template (jsonp.js) > [callback]({'result':{ > 'points':[ > [resultset layer="elev_dem30ra3"] > [feature trimlast=","]{x:[x], y:[y], z:[value_0]},[/feature] > [/resultset] > ] > }}) > > and here's the corresponding OUTPUTFORMAT block: > > OUTPUTFORMAT > NAME 'JSONP' > DRIVER 'TEMPLATE' > MIMETYPE 'application/json;' > FORMATOPTION 'FILE=templates/jsonp.js' > FORMATOPTION 'ATTACHMENT=service.json' > END > > Regarding speed, templates are going to be a bit slower since there are generally two passes through the data, once to identify the candidate records and a second for presentation. Also the template assembly is done in memory so there are limits on how large of datasets you can practically work with. How big a deal this is depends on your situation. It's not perfect but in general I've had great luck with this approach. > > Steve > > -----Original Message----- > From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Lars Fricke > Sent: Friday, January 09, 2015 4:24 AM > To: mapserver-users at lists.osgeo.org > Subject: Re: [mapserver-users] Setting up a JSONP service > > Hello, > > first of all: Thank you for your support! > Sorry for the late reply but I unfortunately was ill. > > @ Steve: > I read about templating but also read that it is slower? > I do not have a lot of experience in writing templates. Would you mind sharing a JSONP template? > > @ Even: Thank you for your thoughts. Who would implement that change though? I'm afraid I can't. > > @ Jeff: I followed those links but I only found threads referring to GeoServer or that were not related to my question. The GDAL page I did study and that's how I managed to set up the GeoJSON service but thats not the same unfortunately as it conflicts with the same origin policy. > > Best > > Lars > > Am 30.12.2014 um 16:24 schrieb Lime, Steve D (MNIT): >> You can also use MapServer templates to accomplish this. It's a little more work since you have to write the template but it's quite flexible then. Usually I write the template to produce JSON and then use a simple wrapper template to produce JSONP. For example, jsonp.js looks like (callback is passed in): >> >> // MapServer Template >> [callback]( >> [include src="templates/json.js"] >> ) >> >> Output formats look like: >> >> OUTPUTFORMAT >> NAME 'JSON' >> DRIVER 'TEMPLATE' >> MIMETYPE 'application/json;' >> FORMATOPTION 'FILE=templates/json.js' >> FORMATOPTION 'ATTACHMENT=service.json' >> END >> >> OUTPUTFORMAT >> NAME 'JSONP' >> DRIVER 'TEMPLATE' >> MIMETYPE 'application/json;' >> FORMATOPTION 'FILE=templates/jsonp.js' >> FORMATOPTION 'ATTACHMENT=service.json' >> END >> >> Steve >> >> -----Original Message----- >> From:mapserver-users-bounces at lists.osgeo.org >> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Lars >> Fricke >> Sent: Monday, December 29, 2014 5:34 AM >> To:mapserver-users at lists.osgeo.org >> Subject: [mapserver-users] Setting up a JSONP service >> >> Dear List, >> >> I have a WFS service running under MapServer that I would like to operate as JSONP service. I managed to set GEOJSON as output format but I get "Cross-Origin-Request Blocked" if I try to call it with a Javascript client (using Leaflet L.layerJSON. >> The question is: Is it possible to set up a JSONP service from Mapserver and if yes, how? My current mapfile looks like this (relevant parts): >> >> " >> # in WEB - METADATA >> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" >> >> OUTPUTFORMAT >> NAME "geojson" >> DRIVER "OGR/GEOJSON" >> MIMETYPE "application/json; subtype=geojson; charset=utf-8" >> FORMATOPTION "STORAGE=stream" >> FORMATOPTION "FORM=SIMPLE" >> FORMATOPTION "LCO:COORDINATE_PRECISION=5" >> END >> " >> If this would already be a correct JSONP service, I have to look on the Leaflet side for the error... >> Thanks for your help. >> >> Cheers >> >> Lars >> _______________________________________________ >> mapserver-users mailing list >> mapserver-users at lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/mapserver-users >> _______________________________________________ >> mapserver-users mailing list >> mapserver-users at lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/mapserver-users >> > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > From Pasquale.Maiorano at ssi.it Wed Jan 14 08:24:27 2015 From: Pasquale.Maiorano at ssi.it (Maiorano Pasquale) Date: Wed, 14 Jan 2015 17:24:27 +0100 Subject: [mapserver-users] old/new Symbology Message-ID: <909214C1813780458B3E4EABE7D1568301D31419@ssi-mail.ssi.it> Dear Sirs, Is anyone able to tell me how to set the old symbology instead of the new one on the QGIS 2.7.0 before exporting to Pmap Server? Many thanks in advance. Pasquale Maiorano -------------- next part -------------- An HTML attachment was scrubbed... URL: From fricke at gisberater.com Wed Jan 14 08:17:06 2015 From: fricke at gisberater.com (Lars Fricke) Date: Wed, 14 Jan 2015 17:17:06 +0100 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <6F331135492B944D90731CE93743D5681BC6DB@FS-EX-DB102.fs.sachsen.de> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> <54B51BE7.3090409@gisberater.com> <6F331135492B944D90731CE93743D5681BC6AA@FS-EX-DB102.fs.sachsen.de> <6F331135492B944D90731CE93743D5681BC6B8@FS-EX-DB102.fs.sachsen.de> <54B53C07.7060503@gisberater.com> <6F331135492B944D90731CE93743D5681BC6DB@FS-EX-DB102.fs.sachsen.de> Message-ID: <54B69682.1090101@gisberater.com> Hello Andreas, I confirm your solution is working perfectly well. I succeeded to integrate the JSONP output into my web application with no conflicts. Funny this depended so much on the version of code I happened to grab wrong. Sorry for producing extra work by that. I'd love to see this go to the repositories, it's really helpful until someone will extend OGR. So thanks again from Mecklenburg to Saxony :-) Best Lars Am 13.01.2015 um 16:52 schrieb Eichner, Andreas - SID: > That's what I get on the console: > > $ MS_MAPFILE=$(pwd)/IHK_Handelsflaechen.map ./mapserv QUERY_STRING='service=WFS&version=1.1.0&request=GetFeature&featureid=IHK.71247&outputformat=geojson&callback=foobar'Content-Disposition: attachment; filename=result.dat > Content-Type: application/json; subtype=geojson; charset=utf-8 > > foobar({ > "type": "FeatureCollection", > > "features": [ > { "type": "Feature", "properties": { "PLZ": "09648", ..., "LANDKREIS": "Mittelsachsen" }, "geometry": { "type": "Point", "coordinates": [ 4568447.14, 5650577.57 ] } } > ] > } > ); > > In other words, the JSON is enclosed by "foobar(" and ");": The relevant parts of the mapfile are: > > OUTPUTFORMAT > NAME 'geojson' > # NAME 'jsonp' > DRIVER 'OGR/GEOJSON' > MIMETYPE 'application/json; subtype=geojson; charset=utf-8' > # MIMETYPE 'text/javascript; charset=utf-8' > FORMATOPTION 'STORAGE=stream' > FORMATOPTION 'FORM=simple' > FORMATOPTION 'LCO:COORDINATE_PRECISION=5' > FORMATOPTION 'JSONP=%callback%' > END > > WEB > VALIDATION > callback '.*' > # default_callback 'jsonp' > END > END > > The default value does not work, so the substitution parameter must be given. > > > >> -----Urspr?ngliche Nachricht----- >> Von: Lars Fricke [mailto:fricke at gisberater.com] >> Gesendet: Dienstag, 13. Januar 2015 16:39 >> An: Eichner, Andreas - SID; mapserver-users at lists.osgeo.org >> Betreff: Re: [mapserver-users] Setting up a JSONP service >> >> Hi Andreas, >> >> I guess I'm still doing something wrong. If I use >> http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP >> ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 >> 0228&callback=foobar >> >> I'm getting the exact same output as before. What are you getting? Can >> you post an example of your servers response? >> >> Thank you so much. >> >> Best >> >> Lars >> >> Am 13.01.2015 um 15:57 schrieb Eichner, Andreas - SID: >>> Arg.. outputformat=geojson also works, only had a typo... >>> >>>> -----Urspr?ngliche Nachricht----- >>>> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- >>>> bounces at lists.osgeo.org] Im Auftrag von Eichner, Andreas - SID >>>> Gesendet: Dienstag, 13. Januar 2015 15:18 >>>> An: 'lars.fricke at skendata.de'; mapserver-users at lists.osgeo.org >>>> Betreff: Re: [mapserver-users] Setting up a JSONP service >>>> >>>> You need to append the "callback" parameter to the query string: >>>> >>>> >> http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP >> ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 >>>> 0228&callback=foobar >>>> >>>> You can test on the command line, too: >>>> MS_MAPFILE=/path/to/mapfile ./mapserv >>>> QUERY_STRING='service=WFS&version=1.1.0&request=GetFeature&typename=HU& >>>> >> SRS=EPSG:3857&bbox=793732,6570204,793765,6570228&outputformat=application/ >>>> json; subtype=geojson; charset=utf-8&callback=foobar' >>>> >>>> Please note that IMHO "geojson" alone isn't enough. The full mimetype >>>> string should be used as reported by GetCapabilities. >>>> >>>> HTH >>>> >>>>> -----Urspr?ngliche Nachricht----- >>>>> Von: Lars Fricke [mailto:fricke at gisberater.com] >>>>> Gesendet: Dienstag, 13. Januar 2015 14:22 >>>>> An: Eichner, Andreas - SID; mapserver-users at lists.osgeo.org >>>>> Betreff: Re: [mapserver-users] Setting up a JSONP service >>>>> >>>>> Hi, >>>>> >>>>> I compiled MapServer after applying the patch (at least I think it was >>>>> applied). Unfortunately the output is not JSONP format. Maybe I'm >>>>> getting something wrong. So here is what I did: >>>>> Applied >>>>> patch -p1 < jsonp.diff >>>>> >>>>> I got an updated mapogroutput.c. >>>>> >>>>> I then compiled with the following options: >>>>> cmake -DCMAKE_INSTALL_PREFIX=/opt \ >>>>> -DCMAKE_PREFIX_PATH="/usr/local;/opt" \ >>>>> -DWITH_CLIENT_WFS=ON \ >>>>> -DWITH_CLIENT_WMS=ON \ >>>>> -DWITH_CURL=ON \ >>>>> -DWITH_SOS=ON \ >>>>> -DWITH_PHP=0 \ >>>>> -DWITH_PYTHON=ON \ >>>>> -DWITH_SVGCAIRO=OFF \ >>>>> -DWITH_ORACLESPATIAL=0 \ >>>>> -DWITH_MSSQL2008=OFF \ >>>>> -DWITH_THREAD_SAFETY=ON \ >>>>> -DWITH_LIBXML2=ON \ >>>>> -DWITH_MYSQL=ON\ >>>>> -DWITH_SDE=0 .. >../configure.out.txt >>>>> >>>>> Which goes through without any warning. >>>>> >>>>> I do make next, getting a few warnings about the Python bindings but >>>>> nothing about mapogroutput (ecept that it was compiled). Then sudo >> make >>>>> install. No warnings. >>>>> I then set a symlink to the new mapserv file inside cgi-bin and start >> my >>>>> apache. >>>>> >>>>> I changed my mapfile as you indicated: >>>>> WEB >>>>> FOOTER "test" >>>>> IMAGEPATH "/var/www/html/tmp/" >>>>> TEMPPATH "/var/www/html/tmp/" >>>>> IMAGEURL "/html/tmp/" >>>>> METADATA >>>>> "wfs_title" "Test" >>>>> "ows_onlineresource" "http://localhost:8082/wfs?" >>>>> "ows_enable_request" "*" >>>>> "ows_srs" "EPSG:3857" >>>>> "wfs_srs" "EPSG:3857" >>>>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" >>>>> "wfs_encoding" "UTF-8" >>>>> END # METADATA >>>>> VALIDATION >>>>> callback ".*" >>>>> END >>>>> END # WEB >>>>> >>>>> OUTPUTFORMAT >>>>> NAME "geojson" >>>>> DRIVER "OGR/GEOJSON" >>>>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" >>>>> FORMATOPTION "STORAGE=stream" >>>>> FORMATOPTION "FORM=SIMPLE" >>>>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" >>>>> FORMATOPTION "JSONP=%callback%" >>>>> END >>>>> >>>>> Unfortunately calling: >>>>> >> http://localhost:8082/wfs?SERVICE=WFS&VERSION=1.1.0&request=GetFeature&TYP >> ENAME=HU&outputformat=geojson&SRS=EPSG:3857&bbox=793732,6570204,793765,657 >>>>> 0228 >>>>> >>>>> gives me a result as before without your changes: >>>>> { >>>>> "type": "FeatureCollection", >>>>> "crs": { "type": "name", "properties": { "name": >>>>> "urn:ogc:def:crs:EPSG::3857" } }, >>>>> "features": [ >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ >>>>> 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ >>>>> 793757.73417, 6570202.31642 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ >>>>> 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ >>>>> 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ >>>>> 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ >>>>> 793752.31968, 6570224.89917 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ >>>>> 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ >>>>> 793735.55884, 6570231.00753 ] ] ] } } >>>>> ] >>>>> } >>>>> >>>>> I also tried this with an AJAX call from Javascript, giving me the >>>>> exactly same result. >>>>> >>>>> I get an error message trying to use the result in Leaflet telling me >> a >>>>> ";" is missing. I assume it should look like this: >>>>> >>>>> var testlayer = [{ >>>>> "type": "FeatureCollection", >>>>> "crs": { "type": "name", "properties": { "name": >>>>> "urn:ogc:def:crs:EPSG::3857" } }, >>>>> "features": [ >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245586"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793757.73417, 6570202.31642 ], [ 793762.85989, 6570195.63821 ], [ >>>>> 793770.20682, 6570201.30901 ], [ 793765.08276, 6570207.98411 ], [ >>>>> 793757.73417, 6570202.31642 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245583"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793752.31968, 6570224.89917 ], [ 793747.96097, 6570230.48534 ], [ >>>>> 793732.07033, 6570218.01607 ], [ 793740.12777, 6570207.69188 ], [ >>>>> 793742.99908, 6570209.94649 ], [ 793747.5696, 6570204.08902 ], [ >>>>> 793761.16105, 6570214.75134 ], [ 793752.94726, 6570225.27397 ], [ >>>>> 793752.31968, 6570224.89917 ] ] ] } }, >>>>> { "type": "Feature", "properties": { "gml_id": "", "UMRING_ID": >>>>> "36245550"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ >>>>> 793735.55884, 6570231.00753 ], [ 793738.78194, 6570226.81082 ], [ >>>>> 793746.26949, 6570232.5959 ], [ 793743.04798, 6570236.79266 ], [ >>>>> 793735.55884, 6570231.00753 ] ] ] } } >>>>> ] >>>>> }]; >>>>> >>>>> I'm not sure what is going on. Am I not applying the changes correctly >>>>> or is my call wrong? >>>>> >>>>> Thanks for you great support. >>>>> >>>>> Best >>>>> >>>>> Lars >>>>> >>>>> >>>>> Am 09.01.2015 um 15:30 schrieb Eichner, Andreas - SID: >>>>>> Hi, >>>>>> >>>>>> I've attached a quick'n dirty solution (against master). When applied >>>> to >>>>>> mapogroutput.c you can set a JSONP formatoption to the callback name: >>>>>> >>>>>> OUTPUTFORMAT >>>>>> NAME 'geojson' >>>>>> DRIVER 'OGR/GEOJSON' >>>>>> MIMETYPE 'application/json; subtype=geojson; charset=utf-8' >>>>>> FORMATOPTION 'STORAGE=stream' >>>>>> FORMATOPTION 'FORM=simple' >>>>>> FORMATOPTION 'LCO:COORDINATE_PRECISION=5' >>>>>> FORMATOPTION 'JSONP=%callback%' >>>>>> END >>>>>> >>>>>> This needs of course a WEB.VALIDATION: >>>>>> WEB >>>>>> ... >>>>>> VALIDATION >>>>>> callback '.*' >>>>>> END >>>>>> END >>>>>> >>>>>> Would be great if you can test if this works (looks good to me). The >>>>> Devs might have a look if this could be integrated into master until >> OGR >>>>> has an appropriate layer creation option (solution described by Even). >>>>>> Greetings >>>>>> >>>>>>> -----Urspr?ngliche Nachricht----- >>>>>>> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver- >> users- >>>>>>> bounces at lists.osgeo.org] Im Auftrag von Lars Fricke >>>>>>> Gesendet: Freitag, 9. Januar 2015 11:24 >>>>>>> An: mapserver-users at lists.osgeo.org >>>>>>> Betreff: Re: [mapserver-users] Setting up a JSONP service >>>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> first of all: Thank you for your support! >>>>>>> Sorry for the late reply but I unfortunately was ill. >>>>>>> >>>>>>> @ Steve: >>>>>>> I read about templating but also read that it is slower? >>>>>>> I do not have a lot of experience in writing templates. Would you >>>> mind >>>>>>> sharing a JSONP template? >>>>>>> >>>>>>> @ Even: Thank you for your thoughts. Who would implement that change >>>>>>> though? I'm afraid I can't. >>>>>>> >>>>>>> @ Jeff: I followed those links but I only found threads referring to >>>>>>> GeoServer or that were not related to my question. The GDAL page I >>>> did >>>>>>> study and that's how I managed to set up the GeoJSON service but >>>> thats >>>>>>> not the same unfortunately as it conflicts with the same origin >>>> policy. >>>>>>> Best >>>>>>> >>>>>>> Lars >>>>>>> >>>>>>> Am 30.12.2014 um 16:24 schrieb Lime, Steve D (MNIT): >>>>>>>> You can also use MapServer templates to accomplish this. It's a >>>> little >>>>>>> more work since you have to write the template but it's quite >>>> flexible >>>>>>> then. Usually I write the template to produce JSON and then use a >>>>> simple >>>>>>> wrapper template to produce JSONP. For example, jsonp.js looks like >>>>>>> (callback is passed in): >>>>>>>> // MapServer Template >>>>>>>> [callback]( >>>>>>>> [include src="templates/json.js"] >>>>>>>> ) >>>>>>>> >>>>>>>> Output formats look like: >>>>>>>> >>>>>>>> OUTPUTFORMAT >>>>>>>> NAME 'JSON' >>>>>>>> DRIVER 'TEMPLATE' >>>>>>>> MIMETYPE 'application/json;' >>>>>>>> FORMATOPTION 'FILE=templates/json.js' >>>>>>>> FORMATOPTION 'ATTACHMENT=service.json' >>>>>>>> END >>>>>>>> >>>>>>>> OUTPUTFORMAT >>>>>>>> NAME 'JSONP' >>>>>>>> DRIVER 'TEMPLATE' >>>>>>>> MIMETYPE 'application/json;' >>>>>>>> FORMATOPTION 'FILE=templates/jsonp.js' >>>>>>>> FORMATOPTION 'ATTACHMENT=service.json' >>>>>>>> END >>>>>>>> >>>>>>>> Steve >>>>>>>> >>>>>>>> -----Original Message----- >>>>>>>> From:mapserver-users-bounces at lists.osgeo.org [mailto:mapserver- >>>> users- >>>>>>> bounces at lists.osgeo.org] On Behalf Of Lars Fricke >>>>>>>> Sent: Monday, December 29, 2014 5:34 AM >>>>>>>> To:mapserver-users at lists.osgeo.org >>>>>>>> Subject: [mapserver-users] Setting up a JSONP service >>>>>>>> >>>>>>>> Dear List, >>>>>>>> >>>>>>>> I have a WFS service running under MapServer that I would like to >>>>>>> operate as JSONP service. I managed to set GEOJSON as output format >>>> but >>>>> I >>>>>>> get "Cross-Origin-Request Blocked" if I try to call it with a >>>>> Javascript >>>>>>> client (using Leaflet L.layerJSON. >>>>>>>> The question is: Is it possible to set up a JSONP service from >>>>> Mapserver >>>>>>> and if yes, how? My current mapfile looks like this (relevant >> parts): >>>>>>>> " >>>>>>>> # in WEB - METADATA >>>>>>>> "wfs_getfeature_formatlist" "geojson,csv,ogrgml" >>>>>>>> >>>>>>>> OUTPUTFORMAT >>>>>>>> NAME "geojson" >>>>>>>> DRIVER "OGR/GEOJSON" >>>>>>>> MIMETYPE "application/json; subtype=geojson; charset=utf-8" >>>>>>>> FORMATOPTION "STORAGE=stream" >>>>>>>> FORMATOPTION "FORM=SIMPLE" >>>>>>>> FORMATOPTION "LCO:COORDINATE_PRECISION=5" >>>>>>>> END >>>>>>>> " >>>>>>>> If this would already be a correct JSONP service, I have to look on >>>>> the >>>>>>> Leaflet side for the error... >>>>>>>> Thanks for your help. >>>>>>>> >>>>>>>> Cheers >>>>>>>> >>>>>>>> Lars >>>>>>>> _______________________________________________ >>>>>>>> mapserver-users mailing list >>>>>>>> mapserver-users at lists.osgeo.org >>>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>>>>>> _______________________________________________ >>>>>>>> mapserver-users mailing list >>>>>>>> mapserver-users at lists.osgeo.org >>>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> mapserver-users mailing list >>>>>>> mapserver-users at lists.osgeo.org >>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>> _______________________________________________ >>>> 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 > From Andreas.Eichner at sid.sachsen.de Thu Jan 15 03:26:09 2015 From: Andreas.Eichner at sid.sachsen.de (Eichner, Andreas - SID) Date: Thu, 15 Jan 2015 11:26:09 +0000 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <54B69682.1090101@gisberater.com> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> <54B51BE7.3090409@gisberater.com> <6F331135492B944D90731CE93743D5681BC6AA@FS-EX-DB102.fs.sachsen.de> <6F331135492B944D90731CE93743D5681BC6B8@FS-EX-DB102.fs.sachsen.de> <54B53C07.7060503@gisberater.com> <6F331135492B944D90731CE93743D5681BC6DB@FS-EX-DB102.fs.sachsen.de> <54B69682.1090101@gisberater.com> Message-ID: <6F331135492B944D90731CE93743D5681BE79F@FS-EX-DB102.fs.sachsen.de> Hey Lars, that's great news ;) I did some minor modifications (full patch attached). Now if output format has the format option "JSONP" then default substitutions are applied to it and the "Content-Disposition" header is omitted (causes browsers to display the "Save as" dialog). The map file should contain OUTPUTFORMAT NAME 'jsonp' DRIVER 'OGR/GEOJSON' MIMETYPE 'text/javascript; charset=utf-8' FORMATOPTION 'LCO:COORDINATE_PRECISION=5' FORMATOPTION 'STORAGE=stream' FORMATOPTION 'FORM=simple' FORMATOPTION 'JSONP=%callback%' END WEB METADATA wfs_getfeature_formatlist "jsonp" END VALIDATION callback '.*' default_callback 'my_callback' END END A WFS GetFeature request should then set the query string to contain OUTPUTFORMAT=jsonp and CALLBACK=callme. The default value might be useful if you want to run some javascript directly: default_callback '(function(j){alert(JSON.stringify(j));})' creates an immediately called anonymous function that displays the JSON. Of course, the real validation pattern should be something more sophisticated. Just to summarize for all those who didn't follow the thread: The same result could be achieved using the template engine as Steve mentioned and all this is a workaround for a missing datasource creation option in OGR's JSON driver. This patch might provide more performance and might save memory on large result sets. Kind regards! > -----Urspr?ngliche Nachricht----- > Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- > bounces at lists.osgeo.org] Im Auftrag von Lars Fricke > Gesendet: Mittwoch, 14. Januar 2015 17:17 > An: mapserver-users at lists.osgeo.org > Betreff: Re: [mapserver-users] Setting up a JSONP service > > Hello Andreas, > > I confirm your solution is working perfectly well. I succeeded to > integrate the JSONP output into my web application with no conflicts. > Funny this depended so much on the version of code I happened to grab > wrong. Sorry for producing extra work by that. > > I'd love to see this go to the repositories, it's really helpful until > someone will extend OGR. > > So thanks again from Mecklenburg to Saxony :-) > > Best > > Lars > -------------- next part -------------- A non-text attachment was scrubbed... Name: jsonp.diff Type: application/octet-stream Size: 1566 bytes Desc: jsonp.diff URL: From fricke at gisberater.com Thu Jan 15 03:33:54 2015 From: fricke at gisberater.com (Lars Fricke) Date: Thu, 15 Jan 2015 12:33:54 +0100 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <6F331135492B944D90731CE93743D5681BE79F@FS-EX-DB102.fs.sachsen.de> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> <54B51BE7.3090409@gisberater.com> <6F331135492B944D90731CE93743D5681BC6AA@FS-EX-DB102.fs.sachsen.de> <6F331135492B944D90731CE93743D5681BC6B8@FS-EX-DB102.fs.sachsen.de> <54B53C07.7060503@gisberater.com> <6F331135492B944D90731CE93743D5681BC6DB@FS-EX-DB102.fs.sachsen.de> <54B69682.1090101@gisberater.com> <6F331135492B944D90731CE93743D5681BE79F@FS-EX-DB102.fs.sachsen.de> Message-ID: <54B7A5A2.1090201@gisberater.com> An HTML attachment was scrubbed... URL: From Pasquale.Maiorano at ssi.it Thu Jan 15 05:58:30 2015 From: Pasquale.Maiorano at ssi.it (Maiorano Pasquale) Date: Thu, 15 Jan 2015 14:58:30 +0100 Subject: [mapserver-users] postgres layer not visible Message-ID: <909214C1813780458B3E4EABE7D1568301D3141A@ssi-mail.ssi.it> Dear Sirs, I followed a Youtube tutorial trying to show a couple of shape file previously save on postgres DB. I modified the pmapper_demo.map and the related config_xxx.xml. When a run the following page http://localhost/pmapper/map_default.phtml?config=gabon nothing happens. I created the following folder C:\ms4w\apps\pmapper\pmapper-4.3.2\config\gabon where I stored the pmapper_demo.map. In the dir config I stored the file config_gabon.xml. You can find hereinafter the file pmapper_demo.map: ######################################################################## ######################## # Adapt settings in map file pmapper_demo.map for the following tags to match settings # on your machine (see additionally MapServer documentation for detailed information): # # MAP # SHAPEPATH # FONTSET # SYMBOLSET # # WEB # IMAGEPATH # IMAGEURL # ######################################################################## ########################## # # Start of map file # MAP EXTENT 83684.2557031431 48040.09765625 455660.392391208 642189.8125 UNITS meters #EXTENT -15 30 40 70 #UNITS dd SIZE 600 500 SHAPEPATH "../../../pmapper_demodata" SYMBOLSET "../common/symbols/symbols-pmapper.sym" FONTSET "../common/fonts/msfontset.txt" RESOLUTION 96 IMAGETYPE png INTERLACE OFF #CONFIG "PROJ_LIB" "C:/proj/nad/" PROJECTION "proj=tmerc" "lat_0=0" "lon_0=12" "k=0.9996" "x_0=500000" "y_0=500000" "datum=WGS84" "units=m" "no_defs" END # PROJECTION # # Start of web interface definition # WEB TEMPLATE "map.html" IMAGEPATH "/ms4w/tmp/ms_tmp/" IMAGEURL "/ms_tmp/" METADATA #"MAPFILE_ENCODING" "ISO-8859-1" #"ows_title" "WMS Demo Server" #"ows_onlineresource" "http://wms.yourserver.org?owskey=test&" #"ows_srs" "EPSG:3035 EPSG:4326" END # Metadata END # Web # # Start of Reference map definition # REFERENCE EXTENT 83684.2557031431 48040.09765625 455660.392391208 642189.8125 IMAGE "../../images/gabon.png" SIZE 199 149 COLOR -1 -1 -1 OUTLINECOLOR 255 0 0 END # Reference # # Start of legend object # LEGEND STATUS OFF IMAGECOLOR 255 255 255 # OUTLINECOLOR 0 0 0 POSITION ll KEYSIZE 18 12 KEYSPACING 10 5 TEMPLATE "void" LABEL TYPE TRUETYPE FONT "FreeSans" SIZE small POSITION AUTO COLOR 0 0 89 OUTLINECOLOR 255 255 255 ANTIALIAS TRUE END END # # Start of ScaleBar definition # SCALEBAR STATUS off TRANSPARENT off INTERVALS 4 SIZE 200 3 UNITS kilometers COLOR 250 250 250 OUTLINECOLOR 0 0 0 BACKGROUNDCOLOR 100 100 100 STYLE 0 POSTLABELCACHE true LABEL COLOR 0 0 90 #OUTLINECOLOR 200 200 200 SIZE small END # Label END # Reference # SYMBOLS USED IN PMAPPER # - 'circle' always necessary (used e.g. for highlight) # - 'square' used in currecnt map file # Symbols can also be defined via tag SYMBOLSET (see above) Symbol Name 'circle' Type ELLIPSE Filled TRUE Points 1 1 END END Symbol Name 'square' Type VECTOR Filled TRUE Points 0 1 0 0 1 0 1 1 0 1 END END #================== START OF LAYER SECTION =====================# LAYER CONNECTION "dbname='gabon' host=localhost port=5432 user='postgres' password='nicoletta' sslmode=disable" CONNECTIONTYPE POSTGIS DATA 'the_geom FROM "gabon_coastline_riproiettato" USING UNIQUE GID USING SRID=5223' EXTENT 131038.078125 48040.09765625 433953.28125 642189.8125 METADATA "ows_title" "gabon_coastline_riproiettato" END # METADATA NAME "gabon_coastline_riproiettato" PROJECTION "proj=tmerc" "lat_0=0" "lon_0=12" "k=0.9996" "x_0=500000" "y_0=500000" "datum=WGS84" "units=m" "no_defs" END # PROJECTION STATUS ON TILEITEM "location" TYPE LINE UNITS METERS CLASS NAME "gabon_coastline_riproiettato" STYLE COLOR 121 8 226 WIDTH 1 END # STYLE END # CLASS END # LAYER LAYER CONNECTION "dbname='gabon' host=localhost port=5432 user='postgres' password='nicoletta' sslmode=disable" CONNECTIONTYPE POSTGIS DATA 'the_geom FROM "public"."Fiumi_riproiettato" USING UNIQUE gid USING UNIQUE 5223' EXTENT 150981.730577697 166673.281916046 346296.768620565 389978.665308564 METADATA "ows_title" "Fiumi_riproiettato" END # METADATA NAME "Fiumi_riproiettato" PROJECTION "proj=tmerc" "lat_0=0" "lon_0=12" "k=0.9996" "x_0=500000" "y_0=500000" "datum=WGS84" "units=m" "no_defs" END # PROJECTION STATUS ON TILEITEM "location" TYPE LINE UNITS METERS CLASS NAME "Fiumi_riproiettato" STYLE COLOR 62 186 93 WIDTH 1 END # STYLE END # CLASS END # LAYER LAYER CONNECTION "dbname='gabon' host=localhost port=5432 user='postgres' password='nicoletta' sslmode=disable" CONNECTIONTYPE POSTGIS DATA 'the_geom FROM "public"."Confini_Gabon_SR_GabonTM" USING UNIQUE gid USING UNIQUE 5223' EXTENT 128874.546875 56689.61328125 781735.125 760206.0625 METADATA "ows_title" "Confini_Gabon_SR_GabonTM" END # METADATA NAME "Confini_Gabon_SR_GabonTM" PROJECTION "proj=tmerc" "lat_0=0" "lon_0=12" "k=0.9996" "x_0=500000" "y_0=500000" "datum=WGS84" "units=m" "no_defs" END # PROJECTION STATUS OFF TILEITEM "location" TYPE POLYGON UNITS METERS CLASS NAME "Confini_Gabon_SR_GabonTM" STYLE COLOR 133 45 126 OUTLINECOLOR 0 0 0 WIDTH 1 END # STYLE END # CLASS END # LAYER END #Map Have you got any ideas where I am wrong? Any advice will be appreciated. Pasquale Maiorano -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steve.Lime at state.mn.us Thu Jan 15 06:28:23 2015 From: Steve.Lime at state.mn.us (Lime, Steve D (MNIT)) Date: Thu, 15 Jan 2015 14:28:23 +0000 Subject: [mapserver-users] Setting up a JSONP service In-Reply-To: <6F331135492B944D90731CE93743D5681BE79F@FS-EX-DB102.fs.sachsen.de> References: <54A13C3A.5060405@gisberater.com> <54AFAC59.5060604@gisberater.com> <6F331135492B944D90731CE93743D5681B65B3@FS-EX-DB102.fs.sachsen.de> <54B51BE7.3090409@gisberater.com> <6F331135492B944D90731CE93743D5681BC6AA@FS-EX-DB102.fs.sachsen.de> <6F331135492B944D90731CE93743D5681BC6B8@FS-EX-DB102.fs.sachsen.de> <54B53C07.7060503@gisberater.com> <6F331135492B944D90731CE93743D5681BC6DB@FS-EX-DB102.fs.sachsen.de> <54B69682.1090101@gisberater.com>, <6F331135492B944D90731CE93743D5681BE79F@FS-EX-DB102.fs.sachsen.de> Message-ID: Andreas: Do you want to try creating a pull request so we can consider merging your patch? Steve ________________________________________ From: mapserver-users-bounces at lists.osgeo.org [mapserver-users-bounces at lists.osgeo.org] on behalf of Eichner, Andreas - SID [Andreas.Eichner at sid.sachsen.de] Sent: Thursday, January 15, 2015 5:26 AM To: 'lars.fricke at skendata.de'; mapserver-users at lists.osgeo.org Subject: Re: [mapserver-users] Setting up a JSONP service Hey Lars, that's great news ;) I did some minor modifications (full patch attached). Now if output format has the format option "JSONP" then default substitutions are applied to it and the "Content-Disposition" header is omitted (causes browsers to display the "Save as" dialog). The map file should contain OUTPUTFORMAT NAME 'jsonp' DRIVER 'OGR/GEOJSON' MIMETYPE 'text/javascript; charset=utf-8' FORMATOPTION 'LCO:COORDINATE_PRECISION=5' FORMATOPTION 'STORAGE=stream' FORMATOPTION 'FORM=simple' FORMATOPTION 'JSONP=%callback%' END WEB METADATA wfs_getfeature_formatlist "jsonp" END VALIDATION callback '.*' default_callback 'my_callback' END END A WFS GetFeature request should then set the query string to contain OUTPUTFORMAT=jsonp and CALLBACK=callme. The default value might be useful if you want to run some javascript directly: default_callback '(function(j){alert(JSON.stringify(j));})' creates an immediately called anonymous function that displays the JSON. Of course, the real validation pattern should be something more sophisticated. Just to summarize for all those who didn't follow the thread: The same result could be achieved using the template engine as Steve mentioned and all this is a workaround for a missing datasource creation option in OGR's JSON driver. This patch might provide more performance and might save memory on large result sets. Kind regards! > -----Urspr?ngliche Nachricht----- > Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- > bounces at lists.osgeo.org] Im Auftrag von Lars Fricke > Gesendet: Mittwoch, 14. Januar 2015 17:17 > An: mapserver-users at lists.osgeo.org > Betreff: Re: [mapserver-users] Setting up a JSONP service > > Hello Andreas, > > I confirm your solution is working perfectly well. I succeeded to > integrate the JSONP output into my web application with no conflicts. > Funny this depended so much on the version of code I happened to grab > wrong. Sorry for producing extra work by that. > > I'd love to see this go to the repositories, it's really helpful until > someone will extend OGR. > > So thanks again from Mecklenburg to Saxony :-) > > Best > > Lars > From jmckenna at gatewaygeomatics.com Thu Jan 15 06:35:14 2015 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Thu, 15 Jan 2015 10:35:14 -0400 Subject: [mapserver-users] postgres layer not visible In-Reply-To: <909214C1813780458B3E4EABE7D1568301D3141A@ssi-mail.ssi.it> References: <909214C1813780458B3E4EABE7D1568301D3141A@ssi-mail.ssi.it> Message-ID: <54B7D022.60108@gatewaygeomatics.com> Hi Pasquale, I always test my mapfile with the shp2img commandline utility (http://mapserver.org/utilities/shp2img.html). An example command would be: shp2img -m pmapper_demo.map -o ttt.png -map_debug 3 That utility is often a massive help to diagnosing problems with layers. :) -jeff -- Jeff McKenna MapServer Consulting and Training Services http://www.gatewaygeomatics.com/ On 2015-01-15 9:58 AM, Maiorano Pasquale wrote: > Dear Sirs, > > I followed a Youtube tutorial trying to show a couple of shape file > previously save on postgres DB. I modified the pmapper_demo.map and the > related config_xxx.xml. When a run the following page > /http://localhost/pmapper/map_default.phtml?config=gabon/ nothing > happens. I created the following folder > /C:\ms4w\apps\pmapper\pmapper-4.3.2\config\gabon/ where I stored the > /pmapper_demo.map/. In the dir config I stored the file > /config_gabon.xml/. You can find hereinafter the file pmapper_demo.map: > > ################################################################################################ > > > # Adapt settings in map file pmapper_demo.map for the following > tags to match settings > > # on your machine (see additionally MapServer documentation for detailed > information): > > # > > # MAP > > # SHAPEPATH > > # FONTSET > > # SYMBOLSET > > # > > # WEB > > # IMAGEPATH > > # IMAGEURL > > # > > ################################################################################################## > > # > > # Start of map file > > # > > MAP > > EXTENT 83684.2557031431 48040.09765625 455660.392391208 642189.8125 > > UNITS meters > > #EXTENT -15 30 40 70 > > #UNITS dd > > SIZE 600 500 > > SHAPEPATH "../../../pmapper_demodata" > > SYMBOLSET "../common/symbols/symbols-pmapper.sym" > > FONTSET "../common/fonts/msfontset.txt" > > RESOLUTION 96 > > IMAGETYPE png > > INTERLACE OFF > > #CONFIG "PROJ_LIB" "C:/proj/nad/" > > PROJECTION > > "proj=tmerc" > > "lat_0=0" > > "lon_0=12" > > "k=0.9996" > > "x_0=500000" > > "y_0=500000" > > "datum=WGS84" > > "units=m" > > "no_defs" > > END # PROJECTION > > # > > # Start of web interface definition > > # > > WEB > > TEMPLATE "map.html" > > IMAGEPATH "/ms4w/tmp/ms_tmp/" > > IMAGEURL "/ms_tmp/" > > METADATA > > #"MAPFILE_ENCODING" "ISO-8859-1" > > #"ows_title" "WMS Demo Server" > > #"ows_onlineresource" "http://wms.yourserver.org?owskey=test&" > > #"ows_srs" "EPSG:3035 EPSG:4326" > > END # Metadata > > END # Web > > # > > # Start of Reference map definition > > # > > REFERENCE > > EXTENT 83684.2557031431 48040.09765625 455660.392391208 642189.8125 > > IMAGE "../../images/gabon.png" > > SIZE 199 149 > > COLOR -1 -1 -1 > > OUTLINECOLOR 255 0 0 > > END # Reference > > # > > # Start of legend object > > # > > LEGEND > > STATUS OFF > > IMAGECOLOR 255 255 255 > > # OUTLINECOLOR 0 0 0 > > POSITION ll > > KEYSIZE 18 12 > > KEYSPACING 10 5 > > TEMPLATE "void" > > LABEL > > TYPE TRUETYPE > > FONT "FreeSans" > > SIZE small > > POSITION AUTO > > COLOR 0 0 89 > > OUTLINECOLOR 255 255 255 > > ANTIALIAS TRUE > > END > > END > > # > > # Start of ScaleBar definition > > # > > SCALEBAR > > STATUS off > > TRANSPARENT off > > INTERVALS 4 > > SIZE 200 3 > > UNITS kilometers > > COLOR 250 250 250 > > OUTLINECOLOR 0 0 0 > > BACKGROUNDCOLOR 100 100 100 > > STYLE 0 > > POSTLABELCACHE true > > LABEL > > COLOR 0 0 90 > > #OUTLINECOLOR 200 200 200 > > SIZE small > > END # Label > > END # Reference > > # SYMBOLS USED IN PMAPPER > > # - 'circle' always necessary (used e.g. for highlight) > > # - 'square' used in currecnt map file > > # Symbols can also be defined via tag SYMBOLSET (see above) > > Symbol > > Name 'circle' > > Type ELLIPSE > > Filled TRUE > > Points > > 1 1 > > END > > END > > Symbol > > Name 'square' > > Type VECTOR > > Filled TRUE > > Points > > 0 1 > > 0 0 > > 1 0 > > 1 1 > > 0 1 > > END > > END > > #================== START OF LAYER SECTION =====================# > > LAYER > > CONNECTION "dbname='gabon' host=localhost port=5432 user='postgres' > password='nicoletta' sslmode=disable" > > CONNECTIONTYPE POSTGIS > > DATA 'the_geom FROM "gabon_coastline_riproiettato" USING UNIQUE GID > USING SRID=5223' > > EXTENT 131038.078125 48040.09765625 433953.28125 642189.8125 > > METADATA > > "ows_title" "gabon_coastline_riproiettato" > > END # METADATA > > NAME "gabon_coastline_riproiettato" > > PROJECTION > > "proj=tmerc" > > "lat_0=0" > > "lon_0=12" > > "k=0.9996" > > "x_0=500000" > > "y_0=500000" > > "datum=WGS84" > > "units=m" > > "no_defs" > > END # PROJECTION > > STATUS ON > > TILEITEM "location" > > TYPE LINE > > UNITS METERS > > CLASS > > NAME "gabon_coastline_riproiettato" > > STYLE > > COLOR 121 8 226 > > WIDTH 1 > > END # STYLE > > END # CLASS > > END # LAYER > > LAYER > > CONNECTION "dbname='gabon' host=localhost port=5432 user='postgres' > password='nicoletta' sslmode=disable" > > CONNECTIONTYPE POSTGIS > > DATA 'the_geom FROM "public"."Fiumi_riproiettato" USING UNIQUE gid > USING UNIQUE 5223' > > EXTENT 150981.730577697 166673.281916046 346296.768620565 389978.665308564 > > METADATA > > "ows_title" "Fiumi_riproiettato" > > END # METADATA > > NAME "Fiumi_riproiettato" > > PROJECTION > > "proj=tmerc" > > "lat_0=0" > > "lon_0=12" > > "k=0.9996" > > "x_0=500000" > > "y_0=500000" > > "datum=WGS84" > > "units=m" > > "no_defs" > > END # PROJECTION > > STATUS ON > > TILEITEM "location" > > TYPE LINE > > UNITS METERS > > CLASS > > NAME "Fiumi_riproiettato" > > STYLE > > COLOR 62 186 93 > > WIDTH 1 > > END # STYLE > > END # CLASS > > END # LAYER > > LAYER > > CONNECTION "dbname='gabon' host=localhost port=5432 user='postgres' > password='nicoletta' sslmode=disable" > > CONNECTIONTYPE POSTGIS > > DATA 'the_geom FROM "public"."Confini_Gabon_SR_GabonTM" USING > UNIQUE gid USING UNIQUE 5223' > > EXTENT 128874.546875 56689.61328125 781735.125 760206.0625 > > METADATA > > "ows_title" "Confini_Gabon_SR_GabonTM" > > END # METADATA > > NAME "Confini_Gabon_SR_GabonTM" > > PROJECTION > > "proj=tmerc" > > "lat_0=0" > > "lon_0=12" > > "k=0.9996" > > "x_0=500000" > > "y_0=500000" > > "datum=WGS84" > > "units=m" > > "no_defs" > > END # PROJECTION > > STATUS OFF > > TILEITEM "location" > > TYPE POLYGON > > UNITS METERS > > CLASS > > NAME "Confini_Gabon_SR_GabonTM" > > STYLE > > COLOR 133 45 126 > > OUTLINECOLOR 0 0 0 > > WIDTH 1 > > END # STYLE > > END # CLASS > > END # LAYER > > END #Map > > Have you got any ideas where I am wrong? > > Any advice will be appreciated. > > Pasquale Maiorano > > > From jukka.rahkonen at maanmittauslaitos.fi Thu Jan 15 07:02:34 2015 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Thu, 15 Jan 2015 15:02:34 +0000 Subject: [mapserver-users] postgres layer not visible Message-ID: Hi, This is another reported issue with a pmapper demo, kassandraxx had similar troubles yesterday. Is there some workshop going on, I do not remember any mails about pmapper since many years. Kassandraxx sent the following report which seems to mean that MapServer is using a deprecated function name "GeomFromText" while recent PostGIS supports only "ST_GeomFromText". shp2img -m pmapper_demo.map -o test.png msDrawMap(): Image handling error. Failed to draw layer named 'Ager Firmanus'.
msPostGISLayerWhichShapes(): Query error. Error (ERROR: function geomfromtext(u nknown, integer) does not exist LINE 1: ...geom,"gid" from "ager_firmanus" where the_geom && GeomFromTe... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. ) executing query: select encode(ST_AsBinary(ST_Force_2D("the_geom"),'NDR'),'hex ') as geom,"gid" from "ager_firmanus" where the_geom && GeomFromText('POLYGON((2 52691.191155437 4727437.25648659,252691.191155437 4871219.56915799,425287.594538 208 4871219.56915799,425287.594538208 4727437.25648659,252691.191155437 4727437. 25648659))',32633)
We should know these things at least: - Which MapServer version is used? - Where is that pmapper demo? - Who made and maintains it? - When it has last time proved to work? We would also need badly new good Mapserver tutorials and samples and I apologize that I have not been helping with making such even I have had some plans for that. -Jukka Rahkonen- Jeff McKenna wrote: Hi Pasquale, I always test my mapfile with the shp2img commandline utility (http://mapserver.org/utilities/shp2img.html). An example command would be: shp2img -m pmapper_demo.map -o ttt.png -map_debug 3 That utility is often a massive help to diagnosing problems with layers. :) -jeff -- Jeff McKenna MapServer Consulting and Training Services http://www.gatewaygeomatics.com/ On 2015-01-15 9:58 AM, Maiorano Pasquale wrote: > Dear Sirs, > > I followed a Youtube tutorial trying to show a couple of shape file > previously save on postgres DB. I modified the pmapper_demo.map and the > related config_xxx.xml. When a run the following page > /http://localhost/pmapper/map_default.phtml?config=gabon/ nothing > happens. I created the following folder > /C:\ms4w\apps\pmapper\pmapper-4.3.2\config\gabon/ where I stored the > /pmapper_demo.map/. In the dir config I stored the file > /config_gabon.xml/. You can find hereinafter the file pmapper_demo.map: > > ################################################################################################ > > > # Adapt settings in map file pmapper_demo.map for the following > tags to match settings > > # on your machine (see additionally MapServer documentation for detailed > information): > > # > > # MAP > > # SHAPEPATH > > # FONTSET > > # SYMBOLSET > > # > > # WEB > > # IMAGEPATH > > # IMAGEURL > > # > > ################################################################################################## > > # > > # Start of map file > > # > > MAP > > EXTENT 83684.2557031431 48040.09765625 455660.392391208 642189.8125 > > UNITS meters > > #EXTENT -15 30 40 70 > > #UNITS dd > > SIZE 600 500 > > SHAPEPATH "../../../pmapper_demodata" > > SYMBOLSET "../common/symbols/symbols-pmapper.sym" > > FONTSET "../common/fonts/msfontset.txt" > > RESOLUTION 96 > > IMAGETYPE png > > INTERLACE OFF > > #CONFIG "PROJ_LIB" "C:/proj/nad/" > > PROJECTION > > "proj=tmerc" > > "lat_0=0" > > "lon_0=12" > > "k=0.9996" > > "x_0=500000" > > "y_0=500000" > > "datum=WGS84" > > "units=m" > > "no_defs" > > END # PROJECTION > > # > > # Start of web interface definition > > # > > WEB > > TEMPLATE "map.html" > > IMAGEPATH "/ms4w/tmp/ms_tmp/" > > IMAGEURL "/ms_tmp/" > > METADATA > > #"MAPFILE_ENCODING" "ISO-8859-1" > > #"ows_title" "WMS Demo Server" > > #"ows_onlineresource" "http://wms.yourserver.org?owskey=test&" > > #"ows_srs" "EPSG:3035 EPSG:4326" > > END # Metadata > > END # Web > > # > > # Start of Reference map definition > > # > > REFERENCE > > EXTENT 83684.2557031431 48040.09765625 455660.392391208 642189.8125 > > IMAGE "../../images/gabon.png" > > SIZE 199 149 > > COLOR -1 -1 -1 > > OUTLINECOLOR 255 0 0 > > END # Reference > > # > > # Start of legend object > > # > > LEGEND > > STATUS OFF > > IMAGECOLOR 255 255 255 > > # OUTLINECOLOR 0 0 0 > > POSITION ll > > KEYSIZE 18 12 > > KEYSPACING 10 5 > > TEMPLATE "void" > > LABEL > > TYPE TRUETYPE > > FONT "FreeSans" > > SIZE small > > POSITION AUTO > > COLOR 0 0 89 > > OUTLINECOLOR 255 255 255 > > ANTIALIAS TRUE > > END > > END > > # > > # Start of ScaleBar definition > > # > > SCALEBAR > > STATUS off > > TRANSPARENT off > > INTERVALS 4 > > SIZE 200 3 > > UNITS kilometers > > COLOR 250 250 250 > > OUTLINECOLOR 0 0 0 > > BACKGROUNDCOLOR 100 100 100 > > STYLE 0 > > POSTLABELCACHE true > > LABEL > > COLOR 0 0 90 > > #OUTLINECOLOR 200 200 200 > > SIZE small > > END # Label > > END # Reference > > # SYMBOLS USED IN PMAPPER > > # - 'circle' always necessary (used e.g. for highlight) > > # - 'square' used in currecnt map file > > # Symbols can also be defined via tag SYMBOLSET (see above) > > Symbol > > Name 'circle' > > Type ELLIPSE > > Filled TRUE > > Points > > 1 1 > > END > > END > > Symbol > > Name 'square' > > Type VECTOR > > Filled TRUE > > Points > > 0 1 > > 0 0 > > 1 0 > > 1 1 > > 0 1 > > END > > END > > #================== START OF LAYER SECTION =====================# > > LAYER > > CONNECTION "dbname='gabon' host=localhost port=5432 user='postgres' > password='nicoletta' sslmode=disable" > > CONNECTIONTYPE POSTGIS > > DATA 'the_geom FROM "gabon_coastline_riproiettato" USING UNIQUE GID > USING SRID=5223' > > EXTENT 131038.078125 48040.09765625 433953.28125 642189.8125 > > METADATA > > "ows_title" "gabon_coastline_riproiettato" > > END # METADATA > > NAME "gabon_coastline_riproiettato" > > PROJECTION > > "proj=tmerc" > > "lat_0=0" > > "lon_0=12" > > "k=0.9996" > > "x_0=500000" > > "y_0=500000" > > "datum=WGS84" > > "units=m" > > "no_defs" > > END # PROJECTION > > STATUS ON > > TILEITEM "location" > > TYPE LINE > > UNITS METERS > > CLASS > > NAME "gabon_coastline_riproiettato" > > STYLE > > COLOR 121 8 226 > > WIDTH 1 > > END # STYLE > > END # CLASS > > END # LAYER > > LAYER > > CONNECTION "dbname='gabon' host=localhost port=5432 user='postgres' > password='nicoletta' sslmode=disable" > > CONNECTIONTYPE POSTGIS > > DATA 'the_geom FROM "public"."Fiumi_riproiettato" USING UNIQUE gid > USING UNIQUE 5223' > > EXTENT 150981.730577697 166673.281916046 346296.768620565 389978.665308564 > > METADATA > > "ows_title" "Fiumi_riproiettato" > > END # METADATA > > NAME "Fiumi_riproiettato" > > PROJECTION > > "proj=tmerc" > > "lat_0=0" > > "lon_0=12" > > "k=0.9996" > > "x_0=500000" > > "y_0=500000" > > "datum=WGS84" > > "units=m" > > "no_defs" > > END # PROJECTION > > STATUS ON > > TILEITEM "location" > > TYPE LINE > > UNITS METERS > > CLASS > > NAME "Fiumi_riproiettato" > > STYLE > > COLOR 62 186 93 > > WIDTH 1 > > END # STYLE > > END # CLASS > > END # LAYER > > LAYER > > CONNECTION "dbname='gabon' host=localhost port=5432 user='postgres' > password='nicoletta' sslmode=disable" > > CONNECTIONTYPE POSTGIS > > DATA 'the_geom FROM "public"."Confini_Gabon_SR_GabonTM" USING > UNIQUE gid USING UNIQUE 5223' > > EXTENT 128874.546875 56689.61328125 781735.125 760206.0625 > > METADATA > > "ows_title" "Confini_Gabon_SR_GabonTM" > > END # METADATA > > NAME "Confini_Gabon_SR_GabonTM" > > PROJECTION > > "proj=tmerc" > > "lat_0=0" > > "lon_0=12" > > "k=0.9996" > > "x_0=500000" > > "y_0=500000" > > "datum=WGS84" > > "units=m" > > "no_defs" > > END # PROJECTION > > STATUS OFF > > TILEITEM "location" > > TYPE POLYGON > > UNITS METERS > > CLASS > > NAME "Confini_Gabon_SR_GabonTM" > > STYLE > > COLOR 133 45 126 > > OUTLINECOLOR 0 0 0 > > WIDTH 1 > > END # STYLE > > END # CLASS > > END # LAYER > > END #Map > > Have you got any ideas where I am wrong? > > Any advice will be appreciated. > > Pasquale Maiorano > > > _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users From Pasquale.Maiorano at ssi.it Thu Jan 15 07:22:05 2015 From: Pasquale.Maiorano at ssi.it (Maiorano Pasquale) Date: Thu, 15 Jan 2015 16:22:05 +0100 Subject: [mapserver-users] postegres layer not visible Message-ID: <909214C1813780458B3E4EABE7D1568301D3141B@ssi-mail.ssi.it> Hi Jeff, I run the utility shp2img and It returned a strange error : Error executing query: the column "ID" does not exist .... I checked the table but the ID field is the primary Key of the table!! Where is the problem? Help me!! Regards, Pasquale -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.greenwood at gmail.com Thu Jan 15 10:40:59 2015 From: richard.greenwood at gmail.com (Richard Greenwood) Date: Thu, 15 Jan 2015 11:40:59 -0700 Subject: [mapserver-users] old/new Symbology In-Reply-To: <909214C1813780458B3E4EABE7D1568301D31419@ssi-mail.ssi.it> References: <909214C1813780458B3E4EABE7D1568301D31419@ssi-mail.ssi.it> Message-ID: I don't think that functionality exists in QGIS 2.7. I don't think it has existed since about QGIS 2.0. On Wed, Jan 14, 2015 at 9:24 AM, Maiorano Pasquale wrote: > Dear Sirs, > > > > Is anyone able to tell me how to set the *old symbology* instead of the > new one on the QGIS 2.7.0 before exporting to Pmap Server? > > > > Many thanks in advance. > > > > Pasquale Maiorano > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > -- Richard W. Greenwood, PLS www.greenwoodmap.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pasquale.Maiorano at ssi.it Fri Jan 16 03:30:25 2015 From: Pasquale.Maiorano at ssi.it (Maiorano Pasquale) Date: Fri, 16 Jan 2015 12:30:25 +0100 Subject: [mapserver-users] postgres layer not visible Message-ID: <909214C1813780458B3E4EABE7D156830741F089@ssi-mail.ssi.it> Hi there I'm deep in the bull-shit. Help me! I used the utility shp2img but I do not understand where the map file is wrong. Hereinafter are the three rows in the LAYER tag in the map file that "should allow" the connection to postgres: CONNECTION "dbname='gabon' host=localhost port=5432 user='postgres' password='nicoletta' sslmode=disable" CONNECTIONTYPE POSTGIS DATA 'the_geom FROM "public"."Fiumi_riproiettato" USING UNIQUE ID USING UNIQUE 5223' These three rows have been extracted from the map file produced by QGIS by means of "RT mapserver export" plugin. When I run the shp2img utility it replies that the ID column does not exist, but using the pgadmin, I see the column named ID and is also the primary key of the table "Fiumi_riproiettato"!!! Where is the mistake??? Please help me!!. Regards, Pasquale P.S.: QGIS: ver 2.7 RT MapServer export: ver 0.4.0 MapServer: ver. 6.0.3 -------------- next part -------------- An HTML attachment was scrubbed... URL: From wal3 at mindspring.com Fri Jan 16 04:46:27 2015 From: wal3 at mindspring.com (Worth Lutz) Date: Fri, 16 Jan 2015 07:46:27 -0500 Subject: [mapserver-users] postgres layer not visible In-Reply-To: <909214C1813780458B3E4EABE7D156830741F089@ssi-mail.ssi.it> References: <909214C1813780458B3E4EABE7D156830741F089@ssi-mail.ssi.it> Message-ID: <54B90823.2010905@mindspring.com> I just guessing but a few things to try: /DATA 'the_geom FROM "public"."Fiumi_riproiettato" USING UNIQUE "ID" USING UNIQUE 5223' ///DATA 'the_geom FROM "public"."Fiumi_riproiettato" USING UNIQUE "ID" USING SRID=5223' ///DATA 'the_geom FROM "public"."Fiumi_riproiettato" USING UNIQUE id USING UNIQUE 5223' // DATA 'the_geom FROM "public"."Fiumi_riproiettato" USING UNIQUE id USING SRID=5223' / //DATA 'the_geom FROM "public"."Fiumi_riproiettato" USING UNIQUE ID USING SRID=5223' // I've marked the changes in red. Again just guesses to try. Let us know what works. Good Luck! *Worth Lutz* ------------------ On 01/16/2015 06:30 AM, Maiorano Pasquale wrote: > /DATA 'the_geom FROM "public"."Fiumi_riproiettato" USING UNIQUE ID > USING UNIQUE 5223'/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pasquale.Maiorano at ssi.it Fri Jan 16 06:00:07 2015 From: Pasquale.Maiorano at ssi.it (Maiorano Pasquale) Date: Fri, 16 Jan 2015 15:00:07 +0100 Subject: [mapserver-users] postgres layer not visible Message-ID: <909214C1813780458B3E4EABE7D156830741F08A@ssi-mail.ssi.it> I tried to use the simple quote, the double quote, the lower case, the upper case: nothing change. The id/ID/Id column is unknown!! Help!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pasquale.Maiorano at ssi.it Fri Jan 16 06:23:22 2015 From: Pasquale.Maiorano at ssi.it (Maiorano Pasquale) Date: Fri, 16 Jan 2015 15:23:22 +0100 Subject: [mapserver-users] postgres layer not visible Message-ID: <909214C1813780458B3E4EABE7D156830741F08B@ssi-mail.ssi.it> Is there anyone that is able to publish on the web a simple QGIS project, composed of a couple of shapefile and stored in postgres, in MapServer? I am on Windows 7 platform. I need the map file generated by the RT MapServer export QGIS plugin, or better, the map file used by MapServer to show the related WebGis. Let me Know also the version of QGIS, MapServer and the "RT MapServer export" plugin. Many thanks in advance. Pasquale -------------- next part -------------- An HTML attachment was scrubbed... URL: From mapserver at schartz.net Fri Jan 16 06:54:07 2015 From: mapserver at schartz.net (Fergus McDonald) Date: Fri, 16 Jan 2015 09:54:07 -0500 Subject: [mapserver-users] Set LABELANGLE [attribute] via Mapscript (6.41) Message-ID: <20150116095407.0d037fbd@roxy> I might be missing something in the docs, but how does one set the labelangle for a mapscript labelObj to an attribute name, the equivalent of ANGLE [attribute] in the LABEL declaration of the MAP file? The angle property of labelObj can only be a float value. The layer object has a labelangleitem property mentioned in the main docs, but the "PHP Mapscript Migration Guide" says that this property was removed as of version 6. From bfraser at GeoAnalytic.com Fri Jan 16 09:28:58 2015 From: bfraser at GeoAnalytic.com (Brent Fraser) Date: Fri, 16 Jan 2015 10:28:58 -0700 Subject: [mapserver-users] postgres layer not visible In-Reply-To: <909214C1813780458B3E4EABE7D156830741F08A@ssi-mail.ssi.it> References: <909214C1813780458B3E4EABE7D156830741F08A@ssi-mail.ssi.it> Message-ID: <8c241e6cce7a40d0b3a6130af8ca324c@GeoAnalytic.com> Perhaps you could show us the "Create Table" statement from Postgres for your "Fiumi_riproiettato" table? Best Regards, Brent Fraser ---------------------------------------- From: "Maiorano Pasquale" Sent: Friday, January 16, 2015 6:53 AM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] postgres layer not visible I tried to use the simple quote, the double quote, the lower case, the upper case: nothing change. The id/ID/Id column is unknown!! Help!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steve.Lime at state.mn.us Fri Jan 16 14:06:54 2015 From: Steve.Lime at state.mn.us (Lime, Steve D (MNIT)) Date: Fri, 16 Jan 2015 22:06:54 +0000 Subject: [mapserver-users] Set LABELANGLE [attribute] via Mapscript (6.41) In-Reply-To: <20150116095407.0d037fbd@roxy> References: <20150116095407.0d037fbd@roxy> Message-ID: I believe it's done with the setBinding method. Labels and styles have that method. Steve -----Original Message----- From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Fergus McDonald Sent: Friday, January 16, 2015 8:54 AM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Set LABELANGLE [attribute] via Mapscript (6.41) I might be missing something in the docs, but how does one set the labelangle for a mapscript labelObj to an attribute name, the equivalent of ANGLE [attribute] in the LABEL declaration of the MAP file? The angle property of labelObj can only be a float value. The layer object has a labelangleitem property mentioned in the main docs, but the "PHP Mapscript Migration Guide" says that this property was removed as of version 6. _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users From Weisbend at WAPA.GOV Fri Jan 16 14:16:11 2015 From: Weisbend at WAPA.GOV (Weisbender, Eric) Date: Fri, 16 Jan 2015 22:16:11 +0000 Subject: [mapserver-users] ArcSDE 10.2.2 Support Message-ID: <9FE7B20682D2EE4CB9F40163E1EB4F083325FA10@afovsml1m.WAPA.INT> Hello List, We have some MapServer 6.2.1 applications pulling data from ArcSDE 10.0 and are upgrading to ArcSDE 10.2.2. I was wondering if it is a similar process where we just need to recompile MapServer/OGR against the ArcSDE 10.2.2 libraries or if ArcSDE 10.2.2 is even being supported yet. Thanks in advance for your help. Thanks, Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steve.Lime at state.mn.us Sat Jan 17 06:52:58 2015 From: Steve.Lime at state.mn.us (Lime, Steve D (MNIT)) Date: Sat, 17 Jan 2015 14:52:58 +0000 Subject: [mapserver-users] ArcSDE 10.2.2 Support In-Reply-To: <9FE7B20682D2EE4CB9F40163E1EB4F083325FA10@afovsml1m.WAPA.INT> References: <9FE7B20682D2EE4CB9F40163E1EB4F083325FA10@afovsml1m.WAPA.INT> Message-ID: Nothing on the MapServer SDE side has changed. You might be able to connect to a 10.2.2 SDE instance using the 10.0 client support you already have. I guess I'd try that before trying to recompile MapServer against the new client libs. Steve ________________________________________ From: mapserver-users-bounces at lists.osgeo.org [mapserver-users-bounces at lists.osgeo.org] on behalf of Weisbender, Eric [Weisbend at WAPA.GOV] Sent: Friday, January 16, 2015 4:16 PM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] ArcSDE 10.2.2 Support Hello List, We have some MapServer 6.2.1 applications pulling data from ArcSDE 10.0 and are upgrading to ArcSDE 10.2.2. I was wondering if it is a similar process where we just need to recompile MapServer/OGR against the ArcSDE 10.2.2 libraries or if ArcSDE 10.2.2 is even being supported yet. Thanks in advance for your help. Thanks, Eric From mapserver at schartz.net Sun Jan 18 07:27:26 2015 From: mapserver at schartz.net (Fergus McDonald) Date: Sun, 18 Jan 2015 10:27:26 -0500 Subject: [mapserver-users] Set LABELANGLE [attribute] via Mapscript (6.41) In-Reply-To: References: <20150116095407.0d037fbd@roxy> Message-ID: <20150118102726.3d28d838@roxy> Thanks Steve.. that was it. I was able to set it using (in Java): setBinding(MS_LABEL_BINDING_ENUM.MS_LABEL_BINDING_ANGLE.swigValue(), strAngleAttribute); It would be good maybe if there was a hint about this in the docs for labelObj.setAngle() On Fri, 16 Jan 2015 22:06:54 +0000 "Lime, Steve D (MNIT)" wrote: > I believe it's done with the setBinding method. Labels and styles > have that method. > > Steve > > -----Original Message----- > From: mapserver-users-bounces at lists.osgeo.org > [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Fergus > McDonald Sent: Friday, January 16, 2015 8:54 AM To: > mapserver-users at lists.osgeo.org Subject: [mapserver-users] Set > LABELANGLE [attribute] via Mapscript (6.41) > > I might be missing something in the docs, but how does one set the > labelangle for a mapscript labelObj to an attribute name, the > equivalent of ANGLE [attribute] in the LABEL declaration of the MAP > file? > > The angle property of labelObj can only be a float value. > > The layer object has a labelangleitem property mentioned in the main > docs, but the "PHP Mapscript Migration Guide" says that this property > was removed as of version 6. > _______________________________________________ mapserver-users > mailing list mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users From Pasquale.Maiorano at ssi.it Mon Jan 19 01:26:50 2015 From: Pasquale.Maiorano at ssi.it (Maiorano Pasquale) Date: Mon, 19 Jan 2015 10:26:50 +0100 Subject: [mapserver-users] postgres layer not visible Message-ID: <909214C1813780458B3E4EABE7D156830741F095@ssi-mail.ssi.it> Dear Brent Fraser and everybody, The "Create Table" statement from Postgres is the following: CREATE TABLE "Fiumi_riproiettato" ( gid serial NOT NULL, "Nome" character varying(80), "Luinghezza" integer, the_geom geometry(LineString), CONSTRAINT "Fiumi_riproiettato_pkey" PRIMARY KEY (gid) ) WITH ( OIDS=FALSE ); ALTER TABLE "Fiumi_riproiettato" OWNER TO postgres; I'm looking forward to hearing You, Pasquale -------------- next part -------------- An HTML attachment was scrubbed... URL: From jukka.rahkonen at maanmittauslaitos.fi Mon Jan 19 04:58:50 2015 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Mon, 19 Jan 2015 12:58:50 +0000 Subject: [mapserver-users] postgres layer not visible Message-ID: Hi, You wrote earlier: "When I run the shp2img utility it replies that the ID column does not exist, but using the pgadmin, I see the column named ID and is also the primary key of the table "Fiumi_riproiettato"!!!" I wonder how you can see column "ID" is the table is created as to have a column ans primary key in "gid serial NOT NULL". Do you really look at the same table with pgadmin? -Jukka Rahkonen- Maiorano Pasquale wrote: Dear Brent Fraser and everybody, The "Create Table" statement from Postgres is the following: CREATE TABLE "Fiumi_riproiettato" ( gid serial NOT NULL, "Nome" character varying(80), "Luinghezza" integer, the_geom geometry(LineString), CONSTRAINT "Fiumi_riproiettato_pkey" PRIMARY KEY (gid) ) WITH ( OIDS=FALSE ); ALTER TABLE "Fiumi_riproiettato" OWNER TO postgres; I'm looking forward to hearing You, Pasquale -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmckenna at gatewaygeomatics.com Mon Jan 19 05:05:15 2015 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Mon, 19 Jan 2015 09:05:15 -0400 Subject: [mapserver-users] postgres layer not visible In-Reply-To: <909214C1813780458B3E4EABE7D156830741F095@ssi-mail.ssi.it> References: <909214C1813780458B3E4EABE7D156830741F095@ssi-mail.ssi.it> Message-ID: <54BD010B.3010005@gatewaygeomatics.com> On 2015-01-19 5:26 AM, Maiorano Pasquale wrote: > > WITH ( > > OIDS=FALSE > This is your mistake. When creating tables in Postgres for use with MapServer/GDAL, I always always create with OIDS. (this can be set as the default in your postgresql.conf file as well) Please generate a new table with OIDS, and then use that generated ID field in your data statement for MapServer or GDAL. -jeff -- Jeff McKenna MapServer Consulting and Training Services http://www.gatewaygeomatics.com/ From wal3 at mindspring.com Mon Jan 19 05:36:49 2015 From: wal3 at mindspring.com (Worth Lutz) Date: Mon, 19 Jan 2015 08:36:49 -0500 Subject: [mapserver-users] postgres layer not visible In-Reply-To: <909214C1813780458B3E4EABE7D156830741F095@ssi-mail.ssi.it> References: <909214C1813780458B3E4EABE7D156830741F095@ssi-mail.ssi.it> Message-ID: <54BD0871.60606@mindspring.com> Your PRIMARY KEY is "gid" not ID. try: /DATA 'the_geom FROM "public"."Fiumi_riproiettato" USING UNIQUE gid USING SRID=5223'/ *Worth Lutz* ------------------ On 01/19/2015 04:26 AM, Maiorano Pasquale wrote: > > Dear Brent Fraser and everybody, > > The ?Create Table? statement from Postgres is the following: > > CREATE TABLE "Fiumi_riproiettato" > > ( > > gid serial NOT NULL, > > "Nome" character varying(80), > > "Luinghezza" integer, > > the_geom geometry(LineString), > > CONSTRAINT "Fiumi_riproiettato_pkey" PRIMARY KEY (gid) > > ) > > WITH ( > > OIDS=FALSE > > ); > > ALTER TABLE "Fiumi_riproiettato" > > OWNER TO postgres; > > I?m looking forward to hearing You, > > Pasquale > > > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From archerian at gmail.com Mon Jan 19 07:28:29 2015 From: archerian at gmail.com (Arun Cherian) Date: Mon, 19 Jan 2015 10:28:29 -0500 Subject: [mapserver-users] Help in plotting several tens of thousand 'pies' Message-ID: Hello, I was hoping the experience of the members here would help in something I was researching. A bit of background. We have cellular data for wireless operators in a DB. The data is referred to as a 'System' and consists of around 50k 'sites' and each site has 3 or more 'cells' on it. It would in a map perspective look like a small circle with several pies around it. So all in all looking at a few hundred thousand polygons to plot. We used to serve this data as a vector for smaller systems via GeoJSON and use Openlayers 2 to render on a slippery map. For a few hundred sites it was fine, no performance degradation or issues. When we started testing with larger real life samples, the browser would literally crawl. I understand it is because each vector feature adds to the DOM and there is a limit. We have used mapserver to provide an OSM map for our base layer, and I was thinking of serving the system vector data as raster/tiles. A few questions I have are below.Apologies for the long post. Any comment appreciated. 1. Is there a way to easily draw a pie? We store center, azimuth and other 'metadata' for the pie in the DB and create a polygon on the fly in Openlayers, is there a faster way to do it in mapserver when creating the raster? 2. Vector features can be 'clicked' or selected, can the same be done for raster layers, so we know which site/cell is selected? Based on the site clicked, we fetch data from another DB table to open a popup. 3. Client side users have the option to apply their own coloring scheme to the pies, how would that be done at the server side, sending a request for re-rendering the pies? Would this create a scenario where several users hit the server with a lot of re-render requests? Is this the right way to go about it? A lot of the neat features of vectors are because all the data is readily available on the client side, but that is also the reason for the performance hit when we load a few thousand sites via GeoJSON. Thanks, Arun -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaron at agrian.com Mon Jan 19 12:29:16 2015 From: aaron at agrian.com (Aaron Hunt) Date: Mon, 19 Jan 2015 15:29:16 -0500 Subject: [mapserver-users] Rasterlite Message-ID: <620DA8E7-3BBD-4F19-90DC-D23FFF6E48AE@agrian.com> Is there a way to connect a raster layer to a RasterLite database in Mapserver? Thank you for any help Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: From Andreas.Eichner at sid.sachsen.de Mon Jan 19 23:30:53 2015 From: Andreas.Eichner at sid.sachsen.de (Eichner, Andreas - SID) Date: Tue, 20 Jan 2015 07:30:53 +0000 Subject: [mapserver-users] Help in plotting several tens of thousand 'pies' In-Reply-To: References: Message-ID: <6F331135492B944D90731CE93743D5681BF913@FS-EX-DB102.fs.sachsen.de> > We used to > serve this data as a vector for smaller systems via GeoJSON and use > Openlayers 2 to render on a slippery map. For a few hundred sites it was > fine, no performance degradation or issues. When we started testing with > larger real life samples, the browser would literally crawl. I understand > it is because each vector feature adds to the DOM and there is a limit Do you need to display all at once? I've read that OpenLayers can use different strategies to fetch data. Retrieving everything when the layer is created is of course the simplest one. A more sophisticated solution would be to use a BBOX filter and load data on demand. But this only makes sense if not every feature is required at the same time. From Andreas.Eichner at sid.sachsen.de Mon Jan 19 23:32:37 2015 From: Andreas.Eichner at sid.sachsen.de (Eichner, Andreas - SID) Date: Tue, 20 Jan 2015 07:32:37 +0000 Subject: [mapserver-users] Rasterlite In-Reply-To: <620DA8E7-3BBD-4F19-90DC-D23FFF6E48AE@agrian.com> References: <620DA8E7-3BBD-4F19-90DC-D23FFF6E48AE@agrian.com> Message-ID: <6F331135492B944D90731CE93743D5681BF91F@FS-EX-DB102.fs.sachsen.de> Can be used via GDAL's RatserLite driver (http://www.gdal.org/frmt_rasterlite.html). > -----Urspr?ngliche Nachricht----- > Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users- > bounces at lists.osgeo.org] Im Auftrag von Aaron Hunt > Gesendet: Montag, 19. Januar 2015 21:29 > An: mapserver-users at lists.osgeo.org > Betreff: [mapserver-users] Rasterlite > > Is there a way to connect a raster layer to a RasterLite database in > Mapserver? > > Thank you for any help > > Aaron From Pasquale.Maiorano at ssi.it Tue Jan 20 01:59:37 2015 From: Pasquale.Maiorano at ssi.it (Maiorano Pasquale) Date: Tue, 20 Jan 2015 10:59:37 +0100 Subject: [mapserver-users] postgres layer not visible Message-ID: <909214C1813780458B3E4EABE7D156830741F096@ssi-mail.ssi.it> Dear Jeff, I implemented your advice and set the OIDS=true. Now the utility shp2img return the following: ... error executing query: ERRORE: find_SRID() could not find the corresponding SRID.... Take into account that the used SRID is directly returned by the QGIS plugin named "RT MapServer export. ". Any further idea to fix this new problem??? Regards, Pasquale -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steve.Lime at state.mn.us Tue Jan 20 12:19:56 2015 From: Steve.Lime at state.mn.us (Lime, Steve D (MNIT)) Date: Tue, 20 Jan 2015 20:19:56 +0000 Subject: [mapserver-users] Help in plotting several tens of thousand 'pies' In-Reply-To: <6F331135492B944D90731CE93743D5681BF913@FS-EX-DB102.fs.sachsen.de> References: <6F331135492B944D90731CE93743D5681BF913@FS-EX-DB102.fs.sachsen.de> Message-ID: Pies = Pie Chart? MapServer can do server-side pie charting -- http://mapserver.org/output/dynamic_charting.html, might that help? -----Original Message----- From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Eichner, Andreas - SID Sent: Tuesday, January 20, 2015 1:31 AM To: 'Arun Cherian'; mapserver-users at lists.osgeo.org Subject: Re: [mapserver-users] Help in plotting several tens of thousand 'pies' > We used to > serve this data as a vector for smaller systems via GeoJSON and use > Openlayers 2 to render on a slippery map. For a few hundred sites it > was fine, no performance degradation or issues. When we started > testing with larger real life samples, the browser would literally > crawl. I understand it is because each vector feature adds to the DOM > and there is a limit Do you need to display all at once? I've read that OpenLayers can use different strategies to fetch data. Retrieving everything when the layer is created is of course the simplest one. A more sophisticated solution would be to use a BBOX filter and load data on demand. But this only makes sense if not every feature is required at the same time. _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users From Steve.Lime at state.mn.us Wed Jan 21 07:47:27 2015 From: Steve.Lime at state.mn.us (Lime, Steve D (DNR)) Date: Wed, 21 Jan 2015 15:47:27 +0000 Subject: [mapserver-users] Rasterlite In-Reply-To: <620DA8E7-3BBD-4F19-90DC-D23FFF6E48AE@agrian.com> References: <620DA8E7-3BBD-4F19-90DC-D23FFF6E48AE@agrian.com> Message-ID: If your GDAL build supports the format then there should be a way to access it through MapServer. Key is syntax I'd guess. Maybe something like? LAYER ... TYPE RASTER DATA "RASTERLITE:multirasterdb.sqlite,table=raster1" ... END Steve From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Aaron Hunt Sent: Monday, January 19, 2015 2:29 PM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Rasterlite Is there a way to connect a raster layer to a RasterLite database in Mapserver? Thank you for any help Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: From mapserver at schartz.net Thu Jan 22 06:16:10 2015 From: mapserver at schartz.net (Fergus McDonald) Date: Thu, 22 Jan 2015 09:16:10 -0500 Subject: [mapserver-users] Set LABELANGLE [attribute] via Mapscript (6.41) In-Reply-To: <54C0E550.4020907@nmbu.no> References: <20150116095407.0d037fbd@roxy> <20150118102726.3d28d838@roxy> <54C0E550.4020907@nmbu.no> Message-ID: <20150122091610.3f7caf18@roxy> angle is mentioned as an attribute here, with a "TODO" http://mapserver.org/mapscript/mapscript.html#labelobj It doesn't specially say there is a setAngle() method, but you can see is exists in the generated code. On Thu, 22 Jan 2015 12:56:00 +0100 H?vard Tveite wrote: > Hi, > > I am not able to find anything about labelObj.setAngle() in > the current Mapserver docs. Could you point me in the right > direction? > > H?vard > > On 2015-01-18 16:27, Fergus McDonald wrote: > > Thanks Steve.. that was it. I was able to set it using (in Java): > > > > setBinding(MS_LABEL_BINDING_ENUM.MS_LABEL_BINDING_ANGLE.swigValue(), > > strAngleAttribute); > > > > It would be good maybe if there was a hint about this in the docs > > for labelObj.setAngle() > > > > > > On Fri, 16 Jan 2015 22:06:54 +0000 > > "Lime, Steve D (MNIT)" wrote: > > > >> I believe it's done with the setBinding method. Labels and styles > >> have that method. > >> > >> Steve > >> > >> -----Original Message----- > >> From: mapserver-users-bounces at lists.osgeo.org > >> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of > >> Fergus McDonald Sent: Friday, January 16, 2015 8:54 AM To: > >> mapserver-users at lists.osgeo.org Subject: [mapserver-users] Set > >> LABELANGLE [attribute] via Mapscript (6.41) > >> > >> I might be missing something in the docs, but how does one set the > >> labelangle for a mapscript labelObj to an attribute name, the > >> equivalent of ANGLE [attribute] in the LABEL declaration of the MAP > >> file? > >> > >> The angle property of labelObj can only be a float value. > >> > >> The layer object has a labelangleitem property mentioned in the > >> main docs, but the "PHP Mapscript Migration Guide" says that this > >> property was removed as of version 6. > >> _______________________________________________ mapserver-users > >> mailing list mapserver-users at lists.osgeo.org > >> http://lists.osgeo.org/mailman/listinfo/mapserver-users > > > > _______________________________________________ > > mapserver-users mailing list > > mapserver-users at lists.osgeo.org > > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > > From aaron at agrian.com Thu Jan 22 06:18:45 2015 From: aaron at agrian.com (Aaron Hunt) Date: Thu, 22 Jan 2015 09:18:45 -0500 Subject: [mapserver-users] Rasterlite In-Reply-To: References: <620DA8E7-3BBD-4F19-90DC-D23FFF6E48AE@agrian.com> Message-ID: <623E1A6A-C3E7-4E34-ADAC-78FE0397D2FA@agrian.com> Thank you very much, this is what I needed. Aaron Hunt CONFIDENTIALITY NOTICE: This email, as well as any attachments, contains information that is confidential and intended solely for the persons or company to which it is addressed. Any copying, retransmission, dissemination, distribution or other use of this information by persons or companies other than the intended recipients is prohibited. Unauthorized disclosure or other use of the information is subject to legal restrictions and penalties. Please notify sender immediately if receipt of this email is in error. Return the email to sender and delete the information, including attachments from your system. Thank you. Agrian Inc. > On Jan 21, 2015, at 10:47 AM, Lime, Steve D (DNR) wrote: > > If your GDAL build supports the format then there should be a way to access it through MapServer. Key is syntax I?d guess. Maybe something like? > > LAYER > ... > TYPE RASTER > DATA ?RASTERLITE:multirasterdb.sqlite,table=raster1? > ... > END > > Steve > > From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Aaron Hunt > Sent: Monday, January 19, 2015 2:29 PM > To: mapserver-users at lists.osgeo.org > Subject: [mapserver-users] Rasterlite > > Is there a way to connect a raster layer to a RasterLite database in Mapserver? > > Thank you for any help > > Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: From havard.tveite at nmbu.no Thu Jan 22 06:20:08 2015 From: havard.tveite at nmbu.no (=?windows-1252?Q?H=E5vard_Tveite?=) Date: Thu, 22 Jan 2015 15:20:08 +0100 Subject: [mapserver-users] [EXTERNAL] Re: Mapserver as WFS 1.1.0 client In-Reply-To: <549A76D4.7030809@skendata.de> References: <5492824F.5030003@skendata.de> <5497C113.2010300@skendata.de> <54999F32.7070100@skendata.de> <5499A31E.6070309@skendata.de> <5499A73F.9000009@skendata.de> <549A76D4.7030809@skendata.de> Message-ID: <54C10718.40308@nmbu.no> On 2014-12-24 9:18, Lars Fricke wrote: > Mike, > > you were right. It works exactly as you say. The reason I could not get it to work yesterday night was due to a wrong EPSG code, so nothing specific. Thank you very much for putting this solution under the Christmas tree for me. > > I wonder if this option should also be pointed out in the docs with the WFS description? WFS through OGR should now be better documented. H?vard > Blessed Christmas everybody! > > Cheers > > Lars > > Am 23.12.2014 um 19:19 schrieb Smith, Michael ERDC-RDE-CRREL-NH: >> Lars, >> >> You can create a layer for mapserver that is an OGR layer (part of the >> GDAL library). >> >> LAYER >> ... >> CONNECTIONTYPE OGR >> DATA "..." >> ... >> END >> >> >> The DATA definition can be a OGR VRT that points to a WFS 1.1.0 layer, See >> http://www.gdal.org/drv_wfs.html >> >> Mike >> >> On 12/23/14, 12:32 PM, "Lars Fricke" wrote: >> >>> Hello Michael, >>> >>> I'm not sure I understand what you mean? >>> >>> Best >>> >>> Lars >>> >>> >>> Am 23.12.2014 um 18:19 schrieb Smith, Michael ERDC-RDE-CRREL-NH: >>>> Lars, >>>> >>>> Could you add a gdal layer into mapserver and use gdal to make the wfs >>>> 1.1.0 request? >>>> >>>> Mike >>>> >> > > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > -- H?vard Tveite Department of Mathematical Sciences and Technology, NMBU Dr?bakveien 31, POBox 5003, N-1432 ?s, NORWAY Phone: +47 64965483 Fax: +47 64965401 http://www.nmbu.no/imt/ From havard.tveite at nmbu.no Thu Jan 22 06:51:56 2015 From: havard.tveite at nmbu.no (=?UTF-8?B?SMOldmFyZCBUdmVpdGU=?=) Date: Thu, 22 Jan 2015 15:51:56 +0100 Subject: [mapserver-users] Set LABELANGLE [attribute] via Mapscript (6.41) In-Reply-To: <20150122091610.3f7caf18@roxy> References: <20150116095407.0d037fbd@roxy> <20150118102726.3d28d838@roxy> <54C0E550.4020907@nmbu.no> <20150122091610.3f7caf18@roxy> Message-ID: <54C10E8C.905@nmbu.no> I would have thought that instead of "TODO" it should repeat the information on Angle in http://mapserver.org/mapfile/label.html. I can try to update the documentation, but I need someone to tell me what to write. H?vard On 2015-01-22 15:16, Fergus McDonald wrote: > angle is mentioned as an attribute here, with a "TODO" > > http://mapserver.org/mapscript/mapscript.html#labelobj > > It doesn't specially say there is a setAngle() method, but you can see > is exists in the generated code. > > On Thu, 22 Jan 2015 12:56:00 +0100 > H?vard Tveite wrote: > >> Hi, >> >> I am not able to find anything about labelObj.setAngle() in >> the current Mapserver docs. Could you point me in the right >> direction? >> >> H?vard >> >> On 2015-01-18 16:27, Fergus McDonald wrote: >>> Thanks Steve.. that was it. I was able to set it using (in Java): >>> >>> setBinding(MS_LABEL_BINDING_ENUM.MS_LABEL_BINDING_ANGLE.swigValue(), >>> strAngleAttribute); >>> >>> It would be good maybe if there was a hint about this in the docs >>> for labelObj.setAngle() >>> >>> >>> On Fri, 16 Jan 2015 22:06:54 +0000 >>> "Lime, Steve D (MNIT)" wrote: >>> >>>> I believe it's done with the setBinding method. Labels and styles >>>> have that method. >>>> >>>> Steve >>>> >>>> -----Original Message----- >>>> From: mapserver-users-bounces at lists.osgeo.org >>>> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of >>>> Fergus McDonald Sent: Friday, January 16, 2015 8:54 AM To: >>>> mapserver-users at lists.osgeo.org Subject: [mapserver-users] Set >>>> LABELANGLE [attribute] via Mapscript (6.41) >>>> >>>> I might be missing something in the docs, but how does one set the >>>> labelangle for a mapscript labelObj to an attribute name, the >>>> equivalent of ANGLE [attribute] in the LABEL declaration of the MAP >>>> file? >>>> >>>> The angle property of labelObj can only be a float value. >>>> >>>> The layer object has a labelangleitem property mentioned in the >>>> main docs, but the "PHP Mapscript Migration Guide" says that this >>>> property was removed as of version 6. >>>> _______________________________________________ mapserver-users >>>> mailing list mapserver-users at lists.osgeo.org >>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>> >>> _______________________________________________ >>> mapserver-users mailing list >>> mapserver-users at lists.osgeo.org >>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>> >> > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > -- H?vard Tveite Department of Mathematical Sciences and Technology, NMBU Dr?bakveien 31, POBox 5003, N-1432 ?s, NORWAY Phone: +47 64965483 Fax: +47 64965401 http://www.nmbu.no/imt/ From mapserver at schartz.net Thu Jan 22 11:06:35 2015 From: mapserver at schartz.net (Fergus McDonald) Date: Thu, 22 Jan 2015 14:06:35 -0500 Subject: [mapserver-users] Set LABELANGLE [attribute] via Mapscript (6.41) In-Reply-To: <54C10E8C.905@nmbu.no> References: <20150116095407.0d037fbd@roxy> <20150118102726.3d28d838@roxy> <54C0E550.4020907@nmbu.no> <20150122091610.3f7caf18@roxy> <54C10E8C.905@nmbu.no> Message-ID: <20150122140635.377f3758@roxy> I think it should at least say that the angle attribute of the object is the equivalent of the "ANGLE double" form in the map file LABEL declaration. Whereas, the "ANGLE [attribute]" form is implemented using the setBinding() method, and "ANGLE [auto|auto2|follow]" forms I assume are done using combinations of the autoangle and autofollow attributes, but more documentation would be helpful. On Thu, 22 Jan 2015 15:51:56 +0100 H?vard Tveite wrote: > I would have thought that instead of "TODO" it should repeat the > information on Angle in http://mapserver.org/mapfile/label.html. > I can try to update the documentation, but I need someone to tell > me what to write. > > H?vard > > On 2015-01-22 15:16, Fergus McDonald wrote: > > angle is mentioned as an attribute here, with a "TODO" > > > > http://mapserver.org/mapscript/mapscript.html#labelobj > > > > It doesn't specially say there is a setAngle() method, but you can > > see is exists in the generated code. > > > > On Thu, 22 Jan 2015 12:56:00 +0100 > > H?vard Tveite wrote: > > > >> Hi, > >> > >> I am not able to find anything about labelObj.setAngle() in > >> the current Mapserver docs. Could you point me in the right > >> direction? > >> > >> H?vard > >> > >> On 2015-01-18 16:27, Fergus McDonald wrote: > >>> Thanks Steve.. that was it. I was able to set it using (in Java): > >>> > >>> setBinding(MS_LABEL_BINDING_ENUM.MS_LABEL_BINDING_ANGLE.swigValue(), > >>> strAngleAttribute); > >>> > >>> It would be good maybe if there was a hint about this in the docs > >>> for labelObj.setAngle() > >>> > >>> > >>> On Fri, 16 Jan 2015 22:06:54 +0000 > >>> "Lime, Steve D (MNIT)" wrote: > >>> > >>>> I believe it's done with the setBinding method. Labels and styles > >>>> have that method. > >>>> > >>>> Steve > >>>> > >>>> -----Original Message----- > >>>> From: mapserver-users-bounces at lists.osgeo.org > >>>> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of > >>>> Fergus McDonald Sent: Friday, January 16, 2015 8:54 AM To: > >>>> mapserver-users at lists.osgeo.org Subject: [mapserver-users] Set > >>>> LABELANGLE [attribute] via Mapscript (6.41) > >>>> > >>>> I might be missing something in the docs, but how does one set > >>>> the labelangle for a mapscript labelObj to an attribute name, the > >>>> equivalent of ANGLE [attribute] in the LABEL declaration of the > >>>> MAP file? > >>>> > >>>> The angle property of labelObj can only be a float value. > >>>> > >>>> The layer object has a labelangleitem property mentioned in the > >>>> main docs, but the "PHP Mapscript Migration Guide" says that this > >>>> property was removed as of version 6. > >>>> _______________________________________________ mapserver-users > >>>> mailing list mapserver-users at lists.osgeo.org > >>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users > >>> > >>> _______________________________________________ > >>> mapserver-users mailing list > >>> mapserver-users at lists.osgeo.org > >>> http://lists.osgeo.org/mailman/listinfo/mapserver-users > >>> > >> > > > > _______________________________________________ > > mapserver-users mailing list > > mapserver-users at lists.osgeo.org > > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > > From Michel.Dastous at bentley.com Thu Jan 22 12:03:16 2015 From: Michel.Dastous at bentley.com (Michel.Dastous at bentley.com) Date: Thu, 22 Jan 2015 20:03:16 +0000 Subject: [mapserver-users] Union layers and WFS requests Message-ID: Hi All, We are actually testing the capabilities of the UNION layers especially in a WFS server context. We were able to perform WFS GetFeature request against a union layer, however as soon as we add a filtering criteria to our request It starts returns empty response. Performing the same request on the underlying request works perfectly. Here is the details about our map file definition and also sample WFS requests made. LAYER NAME 'unioned' TYPE POLYGON STATUS DEFAULT CONNECTIONTYPE UNION CONNECTION "layer1,layer2" PROCESSING "ITEMS=PKEY,PROJ_NAME" EXTENT 815927.781772741 639558.864791513 1248160.81380272 917014.748839214 METADATA "gml_featureid" "PKEY" "ows_enable_request" "*" "ows_extent" "815927.781772741 639558.864791513 1248160.81380272 917014.748839214" "ows_srs" "EPSG:2234" "ows_title" "unioned" "gml_include_items" "all" "gml_types" "auto" END # METADATA STYLEITEM "AUTO" # Define an empty class that will be filled at runtime from the color and # styles read from each source layer. CLASS END END LAYER CONNECTION "layer1.shp" CONNECTIONTYPE OGR EXTENT 815927.781772741 639558.864791513 1248160.81380272 917014.748839214 METADATA "gml_featureid" "PKEY" "ows_enable_request" "*" "ows_extent" "815927.781772741 639558.864791513 1248160.81380272 917014.748839214" "ows_srs" "EPSG:2234" "ows_title" "layer1" "gml_include_items" "all" "gml_types" "auto" END # METADATA NAME "layer1" PROJECTION "init=epsg:2234" END # PROJECTION STATUS ON TILEITEM "location" TYPE POLYGON UNITS METERS CLASS NAME "01 STIP" EXPRESSION ('[PROJ_CURRE]' eq '01_STIP') STYLE COLOR "#ffc80066" OPACITY 40 OUTLINECOLOR "#ffc80066" WIDTH 3 END # STYLE END # CLASS END # LAYER LAYER CONNECTION "layer2.shp" CONNECTIONTYPE OGR EXTENT 815927.781772741 639558.864791513 1248160.81380272 917014.748839214 METADATA "gml_featureid" "PKEY" "ows_enable_request" "*" "ows_extent" "815927.781772741 639558.864791513 1248160.81380272 917014.748839214" "ows_srs" "EPSG:2234" "ows_title" "layer2" "gml_include_items" "all" "gml_types" "auto" END # METADATA NAME "layer2" PROJECTION "init=epsg:2234" END # PROJECTION STATUS ON TILEITEM "location" TYPE POLYGON UNITS METERS CLASS NAME "01 STIP" EXPRESSION ('[PROJ_CURRE]' eq '01_STIP') STYLE COLOR "#ffc80066" OPACITY 40 OUTLINECOLOR "#ffc80066" WIDTH 3 END # STYLE END # CLASS END # LAYER Request against Layer1, return correct data. http://localhost/ms/Mapserv.exe?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&FILTER=PROJ_NAME0172-0417&RESULTTYPE=results&TYPENAME=layer1&PROPERTYNAME=(PROJ_NAME)&MAP=Internal/mastermap.map Layer2 works, return correct data.: http://localhost/ms/Mapserv.exe?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&FILTER=PROJ_NAME0172-0417&RESULTTYPE=results&TYPENAME=layer2&PROPERTYNAME=(PROJ_NAME)&MAP=Internal/mastermap.map Unioned with filter returns empty answer: http://localhost/ms/Mapserv.exe?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&FILTER=PROJ_NAME0172-0417&RESULTTYPE=results&TYPENAME=unioned&PROPERTYNAME=(PROJ_NAME)&MAP=Internal/mastermap.map Unioned without filter returns correct data.: http://localhost/MapRenderingEngine/Mapserv.exe?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&RESULTTYPE=results&TYPENAME=unioned&PROPERTYNAME=(PROJ_NAME)&MAP=Internal/mastermap.map So is this a known limitation or maybe a bug? Does anyone have any suggestion to work around this? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From fricke at gisberater.com Fri Jan 23 01:26:46 2015 From: fricke at gisberater.com (Lars Fricke) Date: Fri, 23 Jan 2015 10:26:46 +0100 Subject: [mapserver-users] [EXTERNAL] Re: Mapserver as WFS 1.1.0 client In-Reply-To: <54C10718.40308@nmbu.no> References: <5492824F.5030003@skendata.de> <5497C113.2010300@skendata.de> <54999F32.7070100@skendata.de> <5499A31E.6070309@skendata.de> <5499A73F.9000009@skendata.de> <549A76D4.7030809@skendata.de> <54C10718.40308@nmbu.no> Message-ID: <54C213D6.2060502@gisberater.com> H?vard, Good job, thank you. Now there is a fair chance to think of the OGR option for more formats. Cheers Lars Am 22.01.2015 um 15:20 schrieb H?vard Tveite: > On 2014-12-24 9:18, Lars Fricke wrote: >> Mike, >> >> you were right. It works exactly as you say. The reason I could not >> get it to work yesterday night was due to a wrong EPSG code, so >> nothing specific. Thank you very much for putting this solution under >> the Christmas tree for me. >> >> I wonder if this option should also be pointed out in the docs with >> the WFS description? > > WFS through OGR should now be better documented. > > H?vard > >> Blessed Christmas everybody! >> >> Cheers >> >> Lars >> >> Am 23.12.2014 um 19:19 schrieb Smith, Michael ERDC-RDE-CRREL-NH: >>> Lars, >>> >>> You can create a layer for mapserver that is an OGR layer (part of the >>> GDAL library). >>> >>> LAYER >>> ... >>> CONNECTIONTYPE OGR >>> DATA "..." >>> ... >>> END >>> >>> >>> The DATA definition can be a OGR VRT that points to a WFS 1.1.0 >>> layer, See >>> http://www.gdal.org/drv_wfs.html >>> >>> Mike >>> >>> On 12/23/14, 12:32 PM, "Lars Fricke" wrote: >>> >>>> Hello Michael, >>>> >>>> I'm not sure I understand what you mean? >>>> >>>> Best >>>> >>>> Lars >>>> >>>> >>>> Am 23.12.2014 um 18:19 schrieb Smith, Michael ERDC-RDE-CRREL-NH: >>>>> Lars, >>>>> >>>>> Could you add a gdal layer into mapserver and use gdal to make the >>>>> wfs >>>>> 1.1.0 request? >>>>> >>>>> Mike >>>>> >>> >> >> >> _______________________________________________ >> mapserver-users mailing list >> mapserver-users at lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/mapserver-users >> >> > From geographika at gmail.com Fri Jan 23 08:24:58 2015 From: geographika at gmail.com (geographika) Date: Fri, 23 Jan 2015 17:24:58 +0100 Subject: [mapserver-users] Display multiple classes using WMS Message-ID: <54C275DA.70507@gmail.com> Hi list, I'm trying to do something I thought would be quire simple, but seems may not be possible in MapServer. I have a client JavaScript application that uses MapServer as a WMS/WFS backend. The UI has a checkbox that allows the user to see the data with or without labels. With the deprecation of the ANNOTATION layer I started to update my MAPFILE LAYER definitions. Some of the DATA clauses are very complicated so I moved my LABEL class into the same layer as the line features which are also colour coded. I can switch between by LABEL class and the other classes using CLASSGROUP and the WMS STYLES parameter. E.g. in the MapFile: CLASSGROUP "default" CLASS NAME 'Complete' GROUP "default" ... END CLASS NAME 'Incomplete' GROUP "default" ... END # a single class containing labels for all features CLASS GROUP "labels" # hidden by default, but can be activated with STYLE ... END I can then use the STYLES property of the WMS server to hide/show labels by requesting the same layer twice with two different styles e.g. No labels: http://localhost/mapserver/?LAYERS=Mylayer......STYLES= Labels: http://localhost/mapserver/?LAYERS=Mylayer,MyLayer......STYLES=default,labels This works well, but has a major drawback that the database is queried twice for the same data, which in my case causes a performance issue. Is there anyway to do this in a single-pass query? It seems MapServer will only ever apply one class per feature. I could add a LABEL class to each default CLASS using includes, however I see no way of then turning these off, except maybe using MapScript? Any workarounds / pointers helpful. Regards, Seth -- web:http://geographika.co.uk twitter: @geographika -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmckenna at gatewaygeomatics.com Fri Jan 23 10:31:53 2015 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Fri, 23 Jan 2015 14:31:53 -0400 Subject: [mapserver-users] postgres layer not visible In-Reply-To: <909214C1813780458B3E4EABE7D156830741F096@ssi-mail.ssi.it> References: <909214C1813780458B3E4EABE7D156830741F096@ssi-mail.ssi.it> Message-ID: <54C29399.30800@gatewaygeomatics.com> Hi Pasquale, Did you resolve this issue? If I had to guess, it would be that this issue is caused by PostGIS using an older PROJ4 library for projections, that does not contain the EPSG (SRID) that you need (5223 or http://epsg.io/5223). You could use the commandline utility psql and check if your PostGIS installation includes that spatial reference, with a command such as: select srid,srtext from spatial_ref_sys where srid = '5223'; My guess is that this will return 0 rows for you. You could actually INSERT this missing SRID into that spatial reference table (by searching the PostGIS mailing list for that exact command), or, easier, don't use this missing SRID for now :) -jeff -- Jeff McKenna MapServer Consulting and Training Services http://www.gatewaygeomatics.com/ On 2015-01-20 5:59 AM, Maiorano Pasquale wrote: > Dear Jeff, > > I implemented your advice and set the OIDS=true. Now the utility > shp2img return the following: > > ? error executing query: ERRORE: find_SRID() could not find the > corresponding SRID?. Take into account that the used SRID is directly > returned by the QGIS plugin named ?RT MapServer export. ?. > > Any further idea to fix this new problem??? > > Regards, > > Pasquale > > > From jmckenna at gatewaygeomatics.com Fri Jan 23 10:37:20 2015 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Fri, 23 Jan 2015 14:37:20 -0400 Subject: [mapserver-users] postgres layer not visible In-Reply-To: <54C29399.30800@gatewaygeomatics.com> References: <909214C1813780458B3E4EABE7D156830741F096@ssi-mail.ssi.it> <54C29399.30800@gatewaygeomatics.com> Message-ID: <54C294E0.7000509@gatewaygeomatics.com> On 2015-01-23 2:31 PM, Jeff McKenna wrote: > Hi Pasquale, > > Did you resolve this issue? > > If I had to guess, it would be that this issue is caused by PostGIS > using an older PROJ4 library for projections, that does not contain the > EPSG (SRID) that you need (5223 or http://epsg.io/5223). > > You could use the commandline utility psql and check if your PostGIS > installation includes that spatial reference, with a command such as: > > select srid,srtext from spatial_ref_sys where srid = '5223'; > > My guess is that this will return 0 rows for you. > > You could actually INSERT this missing SRID into that spatial reference > table (by searching the PostGIS mailing list for that exact command), > or, easier, don't use this missing SRID for now :) > > -jeff > > > Actually that page (http://epsg.io/5223) already has a 'PostGIS' link on it with the command to use!!!! (below, in the "Export" section). You can run this command directly through pssql !!!! INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) values ( 5223, 'EPSG', 5223, '+proj=tmerc +lat_0=0 +lon_0=12 +k=0.9996 +x_0=500000 +y_0=500000 +datum=WGS84 +units=m +no_defs ', 'PROJCS["WGS 84 / Gabon TM",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",12],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",500000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","5223"]]'); -jeff -- Jeff McKenna MapServer Consulting and Training Services http://www.gatewaygeomatics.com/ From topdog at narginen.com Fri Jan 23 11:46:23 2015 From: topdog at narginen.com (Scout) Date: Fri, 23 Jan 2015 12:46:23 -0700 Subject: [mapserver-users] reverse the order of shapes of a layer Message-ID: <54C2A50F.90100@narginen.com> Hello, I am using phpmapscript with mapserver 6.4.1. I would like to be able to reverse the order of the shapes in a layer before drawing the map. I want to draw the map both ways, actually. I need it drawn right-side-up and up-side-down. It is simple to reverse the order of the layers of the map, just (in phpmapscript): ################## // make arrays to hold the current and reversed orders $layerOrder = array (); $layerOrder = $map->getlayersdrawingorder(); $reversed = array_reverse($layerOrder); // reverse the order for upside-down $r = $map->setlayersdrawingorder($reversed); // reset the order for upside-up $r = $map->setlayersdrawingorder($layerOrder); ################## Is there something equivalent for the shapes within a layer? Maybe a layer PROCESSING directive SQL call like: "select * from layer order by fid desc"? Or define the layer with OGR CONNECTIONTYPE and CONNECTION back to itself and a SQL call like above?? Maybe I need to build a new layer adding the shapes in reversed order? Thanks! From jmckenna at gatewaygeomatics.com Fri Jan 23 12:37:27 2015 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Fri, 23 Jan 2015 16:37:27 -0400 Subject: [mapserver-users] reverse the order of shapes of a layer In-Reply-To: <54C2A50F.90100@narginen.com> References: <54C2A50F.90100@narginen.com> Message-ID: <54C2B107.8040502@gatewaygeomatics.com> On 2015-01-23 3:46 PM, Scout wrote: > Hello, > > I am using phpmapscript with mapserver 6.4.1. > > I would like to be able to reverse the order of the shapes in a layer > before drawing the map. > I imagine you could use the sortshp utility for this (http://www.mapserver.org/utilities/sortshp.html) or even ogr2ogr with a switch like: -sql "SELECT * FROM filename ORDER BY fieldname DESC" -jeff -- Jeff McKenna MapServer Consulting and Training Services http://www.gatewaygeomatics.com/ From Steve.Lime at state.mn.us Fri Jan 23 13:00:35 2015 From: Steve.Lime at state.mn.us (Lime, Steve D (MNIT)) Date: Fri, 23 Jan 2015 21:00:35 +0000 Subject: [mapserver-users] reverse the order of shapes of a layer In-Reply-To: <54C2A50F.90100@narginen.com> References: <54C2A50F.90100@narginen.com> Message-ID: There isn't anything in MapServer that controls feature order. We rely on the backends to do that. I'd think it would be easiest just to set up two layers with different order by clauses. Steve -----Original Message----- From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Scout Sent: Friday, January 23, 2015 1:46 PM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] reverse the order of shapes of a layer Hello, I am using phpmapscript with mapserver 6.4.1. I would like to be able to reverse the order of the shapes in a layer before drawing the map. I want to draw the map both ways, actually. I need it drawn right-side-up and up-side-down. It is simple to reverse the order of the layers of the map, just (in phpmapscript): ################## // make arrays to hold the current and reversed orders $layerOrder = array (); $layerOrder = $map->getlayersdrawingorder(); $reversed = array_reverse($layerOrder); // reverse the order for upside-down $r = $map->setlayersdrawingorder($reversed); // reset the order for upside-up $r = $map->setlayersdrawingorder($layerOrder); ################## Is there something equivalent for the shapes within a layer? Maybe a layer PROCESSING directive SQL call like: "select * from layer order by fid desc"? Or define the layer with OGR CONNECTIONTYPE and CONNECTION back to itself and a SQL call like above?? Maybe I need to build a new layer adding the shapes in reversed order? Thanks! _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users From Steve.Toutant at inspq.qc.ca Mon Jan 26 06:31:43 2015 From: Steve.Toutant at inspq.qc.ca (Steve.Toutant at inspq.qc.ca) Date: Mon, 26 Jan 2015 09:31:43 -0500 Subject: [mapserver-users] Does WFS filter use spatial index? Message-ID: I'm using mapserver 6.4.1 and postgis 2.1 using OpenLayers 2.13.1 I draw a small polygon that I use for a within spatial filter of a WFS getfeature request. The problem is that mapserver is not sending this polygon to postgis, it is sending the extent of the mapfile as filter... The wfs POST Request (created and send by OpenLayers client) msGeometry-8081644.2511244 5835062.56996 -8081707.5505384 5834980.1612889 -8081638.2794815 5834913.2788892 -8081533.1785677 5834988.5215889 -8081644.2511244 5835062.56996 In Mapserver log, I see FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON ((-8081644.2511243997141719 5835062.5699599999934435, -8081707.5505384001880884 5834980.1612889003008604, -8081638.2794815003871918 5834913.2788891997188330, -8081533.1785677000880241 5834988.5215889001265168, -8081644.2511243997141719 5835062.5699599999934435))')) But, in postgis log I see this query, See the select * from msp.aq_v2_3857 where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857); See the polygon definition is different, postgis receive the extent defined in the mapfile EXTENT -9239517 5465442 -5565974 9349764 Why Mapserver is sending this polygon to postgis? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steve.Toutant at inspq.qc.ca Mon Jan 26 06:54:54 2015 From: Steve.Toutant at inspq.qc.ca (Steve.Toutant at inspq.qc.ca) Date: Mon, 26 Jan 2015 09:54:54 -0500 Subject: [mapserver-users] Mapserver doesn't send good filter to postgis Message-ID: Sorry my first post was with an inapprpriate title...... I'm using mapserver 6.4.1 and postgis 2.1 using OpenLayers 2.13.1 I draw a small polygon that I use for a within spatial filter of a WFS getfeature request. The problem is that mapserver is not sending this polygon to postgis, it is sending the extent of the mapfile as filter... The wfs POST Request (created and send by OpenLayers client) msGeometry-8081644.2511244 5835062.56996 -8081707.5505384 5834980.1612889 -8081638.2794815 5834913.2788892 -8081533.1785677 5834988.5215889 -8081644.2511244 5835062.56996 In Mapserver log, I see FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON ((-8081644.2511243997141719 5835062.5699599999934435, -8081707.5505384001880884 5834980.1612889003008604, -8081638.2794815003871918 5834913.2788891997188330, -8081533.1785677000880241 5834988.5215889001265168, -8081644.2511243997141719 5835062.5699599999934435))')) Then a few lines later, I see that it is not sending the polygon received as filter select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857); See the polygon definition is different, postgis receive the extent defined in the mapfile EXTENT -9239517 5465442 -5565974 9349764 And, in postgis log I see this query, See the select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857); Why Mapserver is not sending the polygon received as filter to postgis? Thanks! Steve Toutant, M. Sc. Analyste en g?omatique Secteur environnement Direction de la sant? environnementale et de la toxicologie Institut national de sant? publique du Qu?bec T?l.: 418 646-6777 poste 30015 T?l?c.: 418 644-4593 steve.toutant at inspq.qc.ca http://www.inspq.qc.ca http://www.monclimatmasante.qc.ca Pour me rejoindre par courrier Service de l'infrastructure et du r?seau Direction des technologies de l'information Minist?re de la S?curit? Publique 2525 boul. Laurier, 2e ?tage Tour Laurentides Qu?bec, G1V 2L2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steve.Lime at state.mn.us Mon Jan 26 07:14:56 2015 From: Steve.Lime at state.mn.us (Lime, Steve D (MNIT)) Date: Mon, 26 Jan 2015 15:14:56 +0000 Subject: [mapserver-users] Mapserver doesn't send good filter to postgis In-Reply-To: References: Message-ID: It's a limitation in older versions of MapServer where specific backend optimizations were scattered about the WMS/WFS code. Most of those optimizations address the most common use cases - I guess this wasn't one of them. It's surprising that at worst the extent of the supplied geometry isn't passed (I see a comment in the WFS code about this). The specific filter intersection test is applied on the MapServer side - the results are correct, performance can suffer though. This is being addresses in MapServer 7.0 where more complete filter translation functions are being supported (RFC 91). Steve From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Steve.Toutant at inspq.qc.ca Sent: Monday, January 26, 2015 8:55 AM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Mapserver doesn't send good filter to postgis Sorry my first post was with an inapprpriate title...... I'm using mapserver 6.4.1 and postgis 2.1 using OpenLayers 2.13.1 I draw a small polygon that I use for a within spatial filter of a WFS getfeature request. The problem is that mapserver is not sending this polygon to postgis, it is sending the extent of the mapfile as filter... The wfs POST Request (created and send by OpenLayers client) msGeometry-8081644.2511244 5835062.56996 -8081707.5505384 5834980.1612889 -8081638.2794815 5834913.2788892 -8081533.1785677 5834988.5215889 -8081644.2511244 5835062.56996 In Mapserver log, I see FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON ((-8081644.2511243997141719 5835062.5699599999934435, -8081707.5505384001880884 5834980.1612889003008604, -8081638.2794815003871918 5834913.2788891997188330, -8081533.1785677000880241 5834988.5215889001265168, -8081644.2511243997141719 5835062.5699599999934435))')) Then a few lines later, I see that it is not sending the polygon received as filter select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857); See the polygon definition is different, postgis receive the extent defined in the mapfile EXTENT -9239517 5465442 -5565974 9349764 And, in postgis log I see this query, See the select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857); Why Mapserver is not sending the polygon received as filter to postgis? Thanks! Steve Toutant, M. Sc. Analyste en g?omatique Secteur environnement Direction de la sant? environnementale et de la toxicologie Institut national de sant? publique du Qu?bec T?l.: 418 646-6777 poste 30015 T?l?c.: 418 644-4593 steve.toutant at inspq.qc.ca http://www.inspq.qc.ca http://www.monclimatmasante.qc.ca Pour me rejoindre par courrier Service de l'infrastructure et du r?seau Direction des technologies de l'information Minist?re de la S?curit? Publique 2525 boul. Laurier, 2e ?tage Tour Laurentides Qu?bec, G1V 2L2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steve.Toutant at inspq.qc.ca Mon Jan 26 07:38:06 2015 From: Steve.Toutant at inspq.qc.ca (Steve.Toutant at inspq.qc.ca) Date: Mon, 26 Jan 2015 10:38:06 -0500 Subject: [mapserver-users] Mapserver doesn't send good filter to postgis In-Reply-To: References: Message-ID: I understand the objective of rfc 91, but the most common use case would be to pass the supplied geometry..... If mapserver doesn't use the supplied geometry, that means that it doesn't support spatial filtering. Our data covers the whole country, not using the supplied geometry means we can't use mapserver as a wfs server.... Is there something we can do about it? A workaround we could use? "Lime, Steve D (MNIT)" 2015-01-26 10:14 A "Steve.Toutant at inspq.qc.ca" , "mapserver-users at lists.osgeo.org" cc Objet RE: [mapserver-users] Mapserver doesn't send good filter to postgis It?s a limitation in older versions of MapServer where specific backend optimizations were scattered about the WMS/WFS code. Most of those optimizations address the most common use cases ? I guess this wasn?t one of them. It?s surprising that at worst the extent of the supplied geometry isn?t passed (I see a comment in the WFS code about this). The specific filter intersection test is applied on the MapServer side ? the results are correct, performance can suffer though. This is being addresses in MapServer 7.0 where more complete filter translation functions are being supported (RFC 91). Steve From: mapserver-users-bounces at lists.osgeo.org [ mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Steve.Toutant at inspq.qc.ca Sent: Monday, January 26, 2015 8:55 AM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Mapserver doesn't send good filter to postgis Sorry my first post was with an inapprpriate title...... I'm using mapserver 6.4.1 and postgis 2.1 using OpenLayers 2.13.1 I draw a small polygon that I use for a within spatial filter of a WFS getfeature request. The problem is that mapserver is not sending this polygon to postgis, it is sending the extent of the mapfile as filter... The wfs POST Request (created and send by OpenLayers client) msGeometry-8081644.2511244 5835062.56996 -8081707.5505384 5834980.1612889 -8081638.2794815 5834913.2788892 -8081533.1785677 5834988.5215889 -8081644.2511244 5835062.56996 In Mapserver log, I see FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON ((-8081644.2511243997141719 5835062.5699599999934435, -8081707.5505384001880884 5834980.1612889003008604, -8081638.2794815003871918 5834913.2788891997188330, -8081533.1785677000880241 5834988.5215889001265168, -8081644.2511243997141719 5835062.5699599999934435))')) Then a few lines later, I see that it is not sending the polygon received as filter select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857); See the polygon definition is different, postgis receive the extent defined in the mapfile EXTENT -9239517 5465442 -5565974 9349764 And, in postgis log I see this query, See the select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857); Why Mapserver is not sending the polygon received as filter to postgis? Thanks! Steve Toutant, M. Sc. Analyste en g?omatique Secteur environnement Direction de la sant? environnementale et de la toxicologie Institut national de sant? publique du Qu?bec T?l.: 418 646-6777 poste 30015 T?l?c.: 418 644-4593 steve.toutant at inspq.qc.ca http://www.inspq.qc.ca http://www.monclimatmasante.qc.ca Pour me rejoindre par courrier Service de l'infrastructure et du r?seau Direction des technologies de l'information Minist?re de la S?curit? Publique 2525 boul. Laurier, 2e ?tage Tour Laurentides Qu?bec, G1V 2L2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fricke at gisberater.com Mon Jan 26 07:55:50 2015 From: fricke at gisberater.com (Lars Fricke) Date: Mon, 26 Jan 2015 16:55:50 +0100 Subject: [mapserver-users] Mapserver doesn't send good filter to postgis In-Reply-To: References: Message-ID: <54C66386.40501@gisberater.com> An HTML attachment was scrubbed... URL: From Steve.Lime at state.mn.us Mon Jan 26 07:56:01 2015 From: Steve.Lime at state.mn.us (Lime, Steve D (MNIT)) Date: Mon, 26 Jan 2015 15:56:01 +0000 Subject: [mapserver-users] Mapserver doesn't send good filter to postgis In-Reply-To: References: Message-ID: MapServer does use the supplied geometry, it's a matter of where the filter is applied - the database or in MapServer. This isn't a new limitation so others may have more experience with workarounds. Maybe try also setting a bbox in the filter based on the bbox of the geometry? Steve From: Steve.Toutant at inspq.qc.ca [mailto:Steve.Toutant at inspq.qc.ca] Sent: Monday, January 26, 2015 9:38 AM To: Lime, Steve D (MNIT) Cc: mapserver-users at lists.osgeo.org Subject: RE: [mapserver-users] Mapserver doesn't send good filter to postgis I understand the objective of rfc 91, but the most common use case would be to pass the supplied geometry..... If mapserver doesn't use the supplied geometry, that means that it doesn't support spatial filtering. Our data covers the whole country, not using the supplied geometry means we can't use mapserver as a wfs server.... Is there something we can do about it? A workaround we could use? "Lime, Steve D (MNIT)" > 2015-01-26 10:14 A "Steve.Toutant at inspq.qc.ca" >, "mapserver-users at lists.osgeo.org" > cc Objet RE: [mapserver-users] Mapserver doesn't send good filter to postgis It's a limitation in older versions of MapServer where specific backend optimizations were scattered about the WMS/WFS code. Most of those optimizations address the most common use cases - I guess this wasn't one of them. It's surprising that at worst the extent of the supplied geometry isn't passed (I see a comment in the WFS code about this). The specific filter intersection test is applied on the MapServer side - the results are correct, performance can suffer though. This is being addresses in MapServer 7.0 where more complete filter translation functions are being supported (RFC 91). Steve From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Steve.Toutant at inspq.qc.ca Sent: Monday, January 26, 2015 8:55 AM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Mapserver doesn't send good filter to postgis Sorry my first post was with an inapprpriate title...... I'm using mapserver 6.4.1 and postgis 2.1 using OpenLayers 2.13.1 I draw a small polygon that I use for a within spatial filter of a WFS getfeature request. The problem is that mapserver is not sending this polygon to postgis, it is sending the extent of the mapfile as filter... The wfs POST Request (created and send by OpenLayers client) msGeometry-8081644.2511244 5835062.56996 -8081707.5505384 5834980.1612889 -8081638.2794815 5834913.2788892 -8081533.1785677 5834988.5215889 -8081644.2511244 5835062.56996 In Mapserver log, I see FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON ((-8081644.2511243997141719 5835062.5699599999934435, -8081707.5505384001880884 5834980.1612889003008604, -8081638.2794815003871918 5834913.2788891997188330, -8081533.1785677000880241 5834988.5215889001265168, -8081644.2511243997141719 5835062.5699599999934435))')) Then a few lines later, I see that it is not sending the polygon received as filter select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857); See the polygon definition is different, postgis receive the extent defined in the mapfile EXTENT -9239517 5465442 -5565974 9349764 And, in postgis log I see this query, See the select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857); Why Mapserver is not sending the polygon received as filter to postgis? Thanks! Steve Toutant, M. Sc. Analyste en g?omatique Secteur environnement Direction de la sant? environnementale et de la toxicologie Institut national de sant? publique du Qu?bec T?l.: 418 646-6777 poste 30015 T?l?c.: 418 644-4593 steve.toutant at inspq.qc.ca http://www.inspq.qc.ca http://www.monclimatmasante.qc.ca Pour me rejoindre par courrier Service de l'infrastructure et du r?seau Direction des technologies de l'information Minist?re de la S?curit? Publique 2525 boul. Laurier, 2e ?tage Tour Laurentides Qu?bec, G1V 2L2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steve.Toutant at inspq.qc.ca Mon Jan 26 08:15:11 2015 From: Steve.Toutant at inspq.qc.ca (Steve.Toutant at inspq.qc.ca) Date: Mon, 26 Jan 2015 11:15:11 -0500 Subject: [mapserver-users] Mapserver doesn't send good filter to postgis In-Reply-To: References: Message-ID: sorry I'm confused, perhaps I misunderstand what you explained. I don't understand what you mean by "MapServer does use the supplied geometry, it?s a matter of where the filter is applied ? the database or in MapServer" In mapserver log I see FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON ((-8081644.2511243997141719 5835062.5699599999934435, -8081707.5505384001880884 5834980.1612889003008604, -8081638.2794815003871918 5834913.2788891997188330, -8081533.1785677000880241 5834988.5215889001265168, -8081644.2511243997141719 5835062.5699599999934435))')) So this is good, but A few lines later in the mapserver log, I see that it is not sending the supplied geometry as filter, it is sending the extent of the mapfile select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857); So it received the supplied geometry, but it is not using it.... If only BBOX can be used as a spatial operator, it is not good for our needs. We really need to know what features are inside a user defined polygon. "Lime, Steve D (MNIT)" 2015-01-26 10:56 A "Steve.Toutant at inspq.qc.ca" cc "mapserver-users at lists.osgeo.org" Objet RE: [mapserver-users] Mapserver doesn't send good filter to postgis MapServer does use the supplied geometry, it?s a matter of where the filter is applied ? the database or in MapServer. This isn?t a new limitation so others may have more experience with workarounds. Maybe try also setting a bbox in the filter based on the bbox of the geometry? Steve From: Steve.Toutant at inspq.qc.ca [mailto:Steve.Toutant at inspq.qc.ca] Sent: Monday, January 26, 2015 9:38 AM To: Lime, Steve D (MNIT) Cc: mapserver-users at lists.osgeo.org Subject: RE: [mapserver-users] Mapserver doesn't send good filter to postgis I understand the objective of rfc 91, but the most common use case would be to pass the supplied geometry..... If mapserver doesn't use the supplied geometry, that means that it doesn't support spatial filtering. Our data covers the whole country, not using the supplied geometry means we can't use mapserver as a wfs server.... Is there something we can do about it? A workaround we could use? "Lime, Steve D (MNIT)" 2015-01-26 10:14 A "Steve.Toutant at inspq.qc.ca" , " mapserver-users at lists.osgeo.org" cc Objet RE: [mapserver-users] Mapserver doesn't send good filter to postgis It?s a limitation in older versions of MapServer where specific backend optimizations were scattered about the WMS/WFS code. Most of those optimizations address the most common use cases ? I guess this wasn?t one of them. It?s surprising that at worst the extent of the supplied geometry isn?t passed (I see a comment in the WFS code about this). The specific filter intersection test is applied on the MapServer side ? the results are correct, performance can suffer though. This is being addresses in MapServer 7.0 where more complete filter translation functions are being supported (RFC 91). Steve From: mapserver-users-bounces at lists.osgeo.org [ mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Steve.Toutant at inspq.qc.ca Sent: Monday, January 26, 2015 8:55 AM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Mapserver doesn't send good filter to postgis Sorry my first post was with an inapprpriate title...... I'm using mapserver 6.4.1 and postgis 2.1 using OpenLayers 2.13.1 I draw a small polygon that I use for a within spatial filter of a WFS getfeature request. The problem is that mapserver is not sending this polygon to postgis, it is sending the extent of the mapfile as filter... The wfs POST Request (created and send by OpenLayers client) msGeometry-8081644.2511244 5835062.56996 -8081707.5505384 5834980.1612889 -8081638.2794815 5834913.2788892 -8081533.1785677 5834988.5215889 -8081644.2511244 5835062.56996 In Mapserver log, I see FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON ((-8081644.2511243997141719 5835062.5699599999934435, -8081707.5505384001880884 5834980.1612889003008604, -8081638.2794815003871918 5834913.2788891997188330, -8081533.1785677000880241 5834988.5215889001265168, -8081644.2511243997141719 5835062.5699599999934435))')) Then a few lines later, I see that it is not sending the polygon received as filter select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857); See the polygon definition is different, postgis receive the extent defined in the mapfile EXTENT -9239517 5465442 -5565974 9349764 And, in postgis log I see this query, See the select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 5465442))',3857); Why Mapserver is not sending the polygon received as filter to postgis? Thanks! Steve Toutant, M. Sc. Analyste en g?omatique Secteur environnement Direction de la sant? environnementale et de la toxicologie Institut national de sant? publique du Qu?bec T?l.: 418 646-6777 poste 30015 T?l?c.: 418 644-4593 steve.toutant at inspq.qc.ca http://www.inspq.qc.ca http://www.monclimatmasante.qc.ca Pour me rejoindre par courrier Service de l'infrastructure et du r?seau Direction des technologies de l'information Minist?re de la S?curit? Publique 2525 boul. Laurier, 2e ?tage Tour Laurentides Qu?bec, G1V 2L2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From woodbri at swoodbridge.com Mon Jan 26 08:31:41 2015 From: woodbri at swoodbridge.com (Stephen Woodbridge) Date: Mon, 26 Jan 2015 11:31:41 -0500 Subject: [mapserver-users] Mapserver doesn't send good filter to postgis In-Reply-To: References: Message-ID: <54C66BED.7090503@swoodbridge.com> Steve T., mapserver gets back all the geometries from postgis and then filters them in mapserver against the geometry. Mapserver passes the BBOX for the mapfile to postgis as you noticed which is not very efficient, but you can override that to the BBOX of the window using the BBOX substitution variable in the SQL, but this might not be what you want if you geometry is off screen. I'm not aware of any way to pass the BBOX of the geometry. Steve L - can we do this? So currently, your wfs requests are getting filtered against the geometry. And there is room for efficiency improvements. -Steve W On 1/26/2015 11:15 AM, Steve.Toutant at inspq.qc.ca wrote: > sorry I'm confused, perhaps I misunderstand what you explained. I don't > understand what you mean by "MapServer does use the supplied geometry, > it?s a matter of where the filter is applied ? the database or in > MapServer" > > In mapserver log I see > > FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON > ((-8081644.2511243997141719 5835062.5699599999934435, > -8081707.5505384001880884 5834980.1612889003008604, > -8081638.2794815003871918 5834913.2788891997188330, > -8081533.1785677000880241 5834988.5215889001265168, > -8081644.2511243997141719 5835062.5699599999934435))')) > > So this is good, but > A few lines later in the mapserver log, I see that it is not sending the > supplied geometry as filter, it is sending the extent of the mapfile > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > 5465442))',3857); > > So it received the supplied geometry, but it is not using it.... > > If only BBOX can be used as a spatial operator, it is not good for our > needs. We really need to know what features are inside a user defined > polygon. > > > > > *"Lime, Steve D (MNIT)" * > > 2015-01-26 10:56 > > > A > "Steve.Toutant at inspq.qc.ca" > cc > "mapserver-users at lists.osgeo.org" > Objet > RE: [mapserver-users] Mapserver doesn't send good filter to postgis > > > > > > > > > > > MapServer does use the supplied geometry, it?s a matter of where the > filter is applied ? the database or in MapServer. This isn?t a new > limitation so others may have more experience with workarounds. Maybe > try also setting a bbox in the filter based on the bbox of the geometry? > > Steve > > *From:* Steve.Toutant at inspq.qc.ca [mailto:Steve.Toutant at inspq.qc.ca] * > Sent:* Monday, January 26, 2015 9:38 AM* > To:* Lime, Steve D (MNIT)* > Cc:* mapserver-users at lists.osgeo.org* > Subject:* RE: [mapserver-users] Mapserver doesn't send good filter to > postgis > > I understand the objective of rfc 91, but the most common use case would > be to pass the supplied geometry..... > > If mapserver doesn't use the supplied geometry, that means that it > doesn't support spatial filtering. > > Our data covers the whole country, not using the supplied geometry means > we can't use mapserver as a wfs server.... > > Is there something we can do about it? A workaround we could use? > > > *"Lime, Steve D (MNIT)" <**_Steve.Lime at state.mn.us_* > *>* > > 2015-01-26 10:14 > > > A > "_Steve.Toutant at inspq.qc.ca_ " > <_Steve.Toutant at inspq.qc.ca_ >, > "_mapserver-users at lists.osgeo.org_ > " > <_mapserver-users at lists.osgeo.org_ > > > cc > > Objet > RE: [mapserver-users] Mapserver doesn't send good filter to postgis > > > > > > > > > > > > It?s a limitation in older versions of MapServer where specific backend > optimizations were scattered about the WMS/WFS code. Most of those > optimizations address the most common use cases ? I guess this wasn?t > one of them. It?s surprising that at worst the extent of the supplied > geometry isn?t passed (I see a comment in the WFS code about this). The > specific filter intersection test is applied on the MapServer side ? the > results are correct, performance can suffer though. > > This is being addresses in MapServer 7.0 where more complete filter > translation functions are being supported (RFC 91). > > Steve > * > From:* _mapserver-users-bounces at lists.osgeo.org_ > > [_mailto:mapserver-users-bounces at lists.osgeo.org_] *On Behalf Of > *_Steve.Toutant at inspq.qc.ca_ * > Sent:* Monday, January 26, 2015 8:55 AM* > To:* _mapserver-users at lists.osgeo.org_ > * > Subject:* [mapserver-users] Mapserver doesn't send good filter to postgis > > Sorry my first post was with an inapprpriate title...... > > I'm using mapserver 6.4.1 and postgis 2.1 > > using OpenLayers 2.13.1 I draw a small polygon that I use for a within > spatial filter of a WFS getfeature request. The problem is that > mapserver is not sending this polygon to postgis, it is sending the > extent of the mapfile as filter... > > The wfs POST Request (created and send by OpenLayers client) > xmlns:ogc="_http://www.opengis.net/ogc_">msGeometry xmlns:gml="_http://www.opengis.net/gml_" > srsName="urn:ogc:def:crs:EPSG::3857">-8081644.2511244 > 5835062.56996 -8081707.5505384 5834980.1612889 -8081638.2794815 > 5834913.2788892 -8081533.1785677 5834988.5215889 -8081644.2511244 > 5835062.56996 > > > In Mapserver log, I see > FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON > ((-8081644.2511243997141719 5835062.5699599999934435, > -8081707.5505384001880884 5834980.1612889003008604, > -8081638.2794815003871918 5834913.2788891997188330, > -8081533.1785677000880241 5834988.5215889001265168, > -8081644.2511243997141719 5835062.5699599999934435))')) > > Then a few lines later, I see that it is not sending the polygon > received as filter > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > 5465442))',3857); > > See the polygon definition is different, postgis receive the extent > defined in the mapfile > EXTENT -9239517 5465442 -5565974 9349764 > > > And, in postgis log I see this query, See the > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > 5465442))',3857); > > > Why Mapserver is not sending the polygon received as filter to postgis? > > > Thanks! > > /Steve Toutant, M. Sc./ > Analyste en g?omatique > Secteur environnement > Direction de la sant? environnementale et de la toxicologie > Institut national de sant? publique du Qu?bec > T?l.: 418 646-6777 poste 30015 > T?l?c.: 418 644-4593_ > __steve.toutant at inspq.qc.ca_ _ > __http://www.inspq.qc.ca_ _ > __http://www.monclimatmasante.qc.ca_ > > /Pour me rejoindre par courrier/ > Service de l'infrastructure et du r?seau > Direction des technologies de l'information > Minist?re de la S?curit? Publique > 2525 boul. Laurier, 2e ?tage > Tour Laurentides > Qu?bec, G1V 2L2 > > > > > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > From Steve.Toutant at inspq.qc.ca Mon Jan 26 11:12:57 2015 From: Steve.Toutant at inspq.qc.ca (Steve.Toutant at inspq.qc.ca) Date: Mon, 26 Jan 2015 14:12:57 -0500 Subject: [mapserver-users] Mapserver doesn't send good filter to postgis In-Reply-To: <54C66BED.7090503@swoodbridge.com> References: <54C66BED.7090503@swoodbridge.com> Message-ID: Thanks for your explanation Stephen. I'm sure there were good reasons to do that, but it is a weird way of filtering. I Cannot use the bbox of the window but as you suggest, passing the bbox of the geometry could be a workaround. If someone as an idea on how we could pass the bbox of the geometry to mapserver or any other ideas it would be much appreciated. Is this issue will really be improved in mapserver 7 for postgis and oracle? When is it scheduled? thanks again for your help! steve Stephen Woodbridge @lists.osgeo.org Envoy? par : mapserver-users-bounces at lists.osgeo.org 2015-01-26 11:31 A mapserver-users at lists.osgeo.org cc Objet Re: [mapserver-users] Mapserver doesn't send good filter to postgis Steve T., mapserver gets back all the geometries from postgis and then filters them in mapserver against the geometry. Mapserver passes the BBOX for the mapfile to postgis as you noticed which is not very efficient, but you can override that to the BBOX of the window using the BBOX substitution variable in the SQL, but this might not be what you want if you geometry is off screen. I'm not aware of any way to pass the BBOX of the geometry. Steve L - can we do this? So currently, your wfs requests are getting filtered against the geometry. And there is room for efficiency improvements. -Steve W On 1/26/2015 11:15 AM, Steve.Toutant at inspq.qc.ca wrote: > sorry I'm confused, perhaps I misunderstand what you explained. I don't > understand what you mean by "MapServer does use the supplied geometry, > it?s a matter of where the filter is applied ? the database or in > MapServer" > > In mapserver log I see > > FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON > ((-8081644.2511243997141719 5835062.5699599999934435, > -8081707.5505384001880884 5834980.1612889003008604, > -8081638.2794815003871918 5834913.2788891997188330, > -8081533.1785677000880241 5834988.5215889001265168, > -8081644.2511243997141719 5835062.5699599999934435))')) > > So this is good, but > A few lines later in the mapserver log, I see that it is not sending the > supplied geometry as filter, it is sending the extent of the mapfile > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > 5465442))',3857); > > So it received the supplied geometry, but it is not using it.... > > If only BBOX can be used as a spatial operator, it is not good for our > needs. We really need to know what features are inside a user defined > polygon. > > > > > *"Lime, Steve D (MNIT)" * > > 2015-01-26 10:56 > > > A > "Steve.Toutant at inspq.qc.ca" > cc > "mapserver-users at lists.osgeo.org" > Objet > RE: [mapserver-users] Mapserver doesn't send good filter to postgis > > > > > > > > > > > MapServer does use the supplied geometry, it?s a matter of where the > filter is applied ? the database or in MapServer. This isn?t a new > limitation so others may have more experience with workarounds. Maybe > try also setting a bbox in the filter based on the bbox of the geometry? > > Steve > > *From:* Steve.Toutant at inspq.qc.ca [mailto:Steve.Toutant at inspq.qc.ca] * > Sent:* Monday, January 26, 2015 9:38 AM* > To:* Lime, Steve D (MNIT)* > Cc:* mapserver-users at lists.osgeo.org* > Subject:* RE: [mapserver-users] Mapserver doesn't send good filter to > postgis > > I understand the objective of rfc 91, but the most common use case would > be to pass the supplied geometry..... > > If mapserver doesn't use the supplied geometry, that means that it > doesn't support spatial filtering. > > Our data covers the whole country, not using the supplied geometry means > we can't use mapserver as a wfs server.... > > Is there something we can do about it? A workaround we could use? > > > *"Lime, Steve D (MNIT)" <**_Steve.Lime at state.mn.us_* > *>* > > 2015-01-26 10:14 > > > A > "_Steve.Toutant at inspq.qc.ca_ < mailto:Steve.Toutant at inspq.qc.ca>" > <_Steve.Toutant at inspq.qc.ca_ >, > "_mapserver-users at lists.osgeo.org_ > " > <_mapserver-users at lists.osgeo.org_ > > > cc > > Objet > RE: [mapserver-users] Mapserver doesn't send good filter to postgis > > > > > > > > > > > > It?s a limitation in older versions of MapServer where specific backend > optimizations were scattered about the WMS/WFS code. Most of those > optimizations address the most common use cases ? I guess this wasn?t > one of them. It?s surprising that at worst the extent of the supplied > geometry isn?t passed (I see a comment in the WFS code about this). The > specific filter intersection test is applied on the MapServer side ? the > results are correct, performance can suffer though. > > This is being addresses in MapServer 7.0 where more complete filter > translation functions are being supported (RFC 91). > > Steve > * > From:* _mapserver-users-bounces at lists.osgeo.org_ > > [_mailto:mapserver-users-bounces at lists.osgeo.org_] *On Behalf Of > *_Steve.Toutant at inspq.qc.ca_ * > Sent:* Monday, January 26, 2015 8:55 AM* > To:* _mapserver-users at lists.osgeo.org_ > * > Subject:* [mapserver-users] Mapserver doesn't send good filter to postgis > > Sorry my first post was with an inapprpriate title...... > > I'm using mapserver 6.4.1 and postgis 2.1 > > using OpenLayers 2.13.1 I draw a small polygon that I use for a within > spatial filter of a WFS getfeature request. The problem is that > mapserver is not sending this polygon to postgis, it is sending the > extent of the mapfile as filter... > > The wfs POST Request (created and send by OpenLayers client) > xmlns:ogc="_http://www.opengis.net/ogc_">msGeometry xmlns:gml="_http://www.opengis.net/gml_" > srsName="urn:ogc:def:crs:EPSG::3857">-8081644.2511244 > 5835062.56996 -8081707.5505384 5834980.1612889 -8081638.2794815 > 5834913.2788892 -8081533.1785677 5834988.5215889 -8081644.2511244 > 5835062.56996 > > > In Mapserver log, I see > FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON > ((-8081644.2511243997141719 5835062.5699599999934435, > -8081707.5505384001880884 5834980.1612889003008604, > -8081638.2794815003871918 5834913.2788891997188330, > -8081533.1785677000880241 5834988.5215889001265168, > -8081644.2511243997141719 5835062.5699599999934435))')) > > Then a few lines later, I see that it is not sending the polygon > received as filter > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > 5465442))',3857); > > See the polygon definition is different, postgis receive the extent > defined in the mapfile > EXTENT -9239517 5465442 -5565974 9349764 > > > And, in postgis log I see this query, See the > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > 5465442))',3857); > > > Why Mapserver is not sending the polygon received as filter to postgis? > > > Thanks! > > /Steve Toutant, M. Sc./ > Analyste en g?omatique > Secteur environnement > Direction de la sant? environnementale et de la toxicologie > Institut national de sant? publique du Qu?bec > T?l.: 418 646-6777 poste 30015 > T?l?c.: 418 644-4593_ > __steve.toutant at inspq.qc.ca_ _ > __http://www.inspq.qc.ca_ _ > __http://www.monclimatmasante.qc.ca_ > > /Pour me rejoindre par courrier/ > Service de l'infrastructure et du r?seau > Direction des technologies de l'information > Minist?re de la S?curit? Publique > 2525 boul. Laurier, 2e ?tage > Tour Laurentides > Qu?bec, G1V 2L2 > > > > > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From woodbri at swoodbridge.com Mon Jan 26 13:10:29 2015 From: woodbri at swoodbridge.com (Stephen Woodbridge) Date: Mon, 26 Jan 2015 16:10:29 -0500 Subject: [mapserver-users] Mapserver doesn't send good filter to postgis In-Reply-To: References: <54C66BED.7090503@swoodbridge.com> Message-ID: <54C6AD45.9030108@swoodbridge.com> On 1/26/2015 2:12 PM, Steve.Toutant at inspq.qc.ca wrote: > Thanks for your explanation Stephen. > I'm sure there were good reasons to do that, but it is a weird way of > filtering. It is a legacy issue the RFC 91 I think is trying to clean up. Mapserver started with rasters and shapefiles, so everything had to be done in mapserver. As it grew to support more data sources things have changes and we are trying to push this kind of filtering back into the data sources where it can be done efficiently, while still allow other data sources that do not support the native filtering to work also work by having a generic filing ability still built into mapserver. Steve W > I Cannot use the bbox of the window but as you suggest, passing the bbox > of the geometry could be a workaround. > > If someone as an idea on how we could pass the bbox of the geometry to > mapserver or any other ideas it would be much appreciated. > > Is this issue will really be improved in mapserver 7 for postgis and > oracle? When is it scheduled? > > thanks again for your help! > > steve > > > > > *Stephen Woodbridge @lists.osgeo.org* > Envoy? par : mapserver-users-bounces at lists.osgeo.org > > 2015-01-26 11:31 > > > A > mapserver-users at lists.osgeo.org > cc > > Objet > Re: [mapserver-users] Mapserver doesn't send good filter to postgis > > > > > > > > > > > Steve T., > > mapserver gets back all the geometries from postgis and then filters > them in mapserver against the geometry. > > Mapserver passes the BBOX for the mapfile to postgis as you noticed > which is not very efficient, but you can override that to the BBOX of > the window using the BBOX substitution variable in the SQL, but this > might not be what you want if you geometry is off screen. > > I'm not aware of any way to pass the BBOX of the geometry. > > Steve L - can we do this? > > So currently, your wfs requests are getting filtered against the > geometry. And there is room for efficiency improvements. > > -Steve W > > On 1/26/2015 11:15 AM, Steve.Toutant at inspq.qc.ca wrote: > > sorry I'm confused, perhaps I misunderstand what you explained. I don't > > understand what you mean by "MapServer does use the supplied geometry, > > it?s a matter of where the filter is applied ? the database or in > > MapServer" > > > > In mapserver log I see > > > > FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON > > ((-8081644.2511243997141719 5835062.5699599999934435, > > -8081707.5505384001880884 5834980.1612889003008604, > > -8081638.2794815003871918 5834913.2788891997188330, > > -8081533.1785677000880241 5834988.5215889001265168, > > -8081644.2511243997141719 5835062.5699599999934435))')) > > > > So this is good, but > > A few lines later in the mapserver log, I see that it is not sending the > > supplied geometry as filter, it is sending the extent of the mapfile > > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > > 5465442))',3857); > > > > So it received the supplied geometry, but it is not using it.... > > > > If only BBOX can be used as a spatial operator, it is not good for our > > needs. We really need to know what features are inside a user defined > > polygon. > > > > > > > > > > *"Lime, Steve D (MNIT)" * > > > > 2015-01-26 10:56 > > > > > > A > > "Steve.Toutant at inspq.qc.ca" > > cc > > "mapserver-users at lists.osgeo.org" > > > Objet > > RE: [mapserver-users] Mapserver doesn't send good > filter to postgis > > > > > > > > > > > > > > > > > > > > > > MapServer does use the supplied geometry, it?s a matter of where the > > filter is applied ? the database or in MapServer. This isn?t a new > > limitation so others may have more experience with workarounds. Maybe > > try also setting a bbox in the filter based on the bbox of the geometry? > > > > Steve > > > > *From:* Steve.Toutant at inspq.qc.ca [mailto:Steve.Toutant at inspq.qc.ca] * > > Sent:* Monday, January 26, 2015 9:38 AM* > > To:* Lime, Steve D (MNIT)* > > Cc:* mapserver-users at lists.osgeo.org* > > Subject:* RE: [mapserver-users] Mapserver doesn't send good filter to > > postgis > > > > I understand the objective of rfc 91, but the most common use case would > > be to pass the supplied geometry..... > > > > If mapserver doesn't use the supplied geometry, that means that it > > doesn't support spatial filtering. > > > > Our data covers the whole country, not using the supplied geometry means > > we can't use mapserver as a wfs server.... > > > > Is there something we can do about it? A workaround we could use? > > > > > > *"Lime, Steve D (MNIT)" <**_Steve.Lime at state.mn.us_* > > *>* > > > > 2015-01-26 10:14 > > > > > > A > > "_Steve.Toutant at inspq.qc.ca_ > " > > <_Steve.Toutant at inspq.qc.ca_ >, > > "_mapserver-users at lists.osgeo.org_ > > " > > <_mapserver-users at lists.osgeo.org_ > > > > > cc > > > > Objet > > RE: [mapserver-users] Mapserver doesn't send good > filter to postgis > > > > > > > > > > > > > > > > > > > > > > > > It?s a limitation in older versions of MapServer where specific backend > > optimizations were scattered about the WMS/WFS code. Most of those > > optimizations address the most common use cases ? I guess this wasn?t > > one of them. It?s surprising that at worst the extent of the supplied > > geometry isn?t passed (I see a comment in the WFS code about this). The > > specific filter intersection test is applied on the MapServer side ? the > > results are correct, performance can suffer though. > > > > This is being addresses in MapServer 7.0 where more complete filter > > translation functions are being supported (RFC 91). > > > > Steve > > * > > From:* _mapserver-users-bounces at lists.osgeo.org_ > > > > [_mailto:mapserver-users-bounces at lists.osgeo.org_] *On Behalf Of > > *_Steve.Toutant at inspq.qc.ca_ * > > Sent:* Monday, January 26, 2015 8:55 AM* > > To:* _mapserver-users at lists.osgeo.org_ > > * > > Subject:* [mapserver-users] Mapserver doesn't send good filter to postgis > > > > Sorry my first post was with an inapprpriate title...... > > > > I'm using mapserver 6.4.1 and postgis 2.1 > > > > using OpenLayers 2.13.1 I draw a small polygon that I use for a within > > spatial filter of a WFS getfeature request. The problem is that > > mapserver is not sending this polygon to postgis, it is sending the > > extent of the mapfile as filter... > > > > The wfs POST Request (created and send by OpenLayers client) > > > > xmlns:ogc="_http://www.opengis.net/ogc_">msGeometry > xmlns:gml="_http://www.opengis.net/gml_" > > > srsName="urn:ogc:def:crs:EPSG::3857">-8081644.2511244 > > 5835062.56996 -8081707.5505384 5834980.1612889 -8081638.2794815 > > 5834913.2788892 -8081533.1785677 5834988.5215889 -8081644.2511244 > > > 5835062.56996 > > > > > > In Mapserver log, I see > > FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON > > ((-8081644.2511243997141719 5835062.5699599999934435, > > -8081707.5505384001880884 5834980.1612889003008604, > > -8081638.2794815003871918 5834913.2788891997188330, > > -8081533.1785677000880241 5834988.5215889001265168, > > -8081644.2511243997141719 5835062.5699599999934435))')) > > > > Then a few lines later, I see that it is not sending the polygon > > received as filter > > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > > 5465442))',3857); > > > > See the polygon definition is different, postgis receive the extent > > defined in the mapfile > > EXTENT -9239517 5465442 -5565974 9349764 > > > > > > And, in postgis log I see this query, See the > > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > > 5465442))',3857); > > > > > > Why Mapserver is not sending the polygon received as filter to postgis? > > > > > > Thanks! > > > > /Steve Toutant, M. Sc./ > > Analyste en g?omatique > > Secteur environnement > > Direction de la sant? environnementale et de la toxicologie > > Institut national de sant? publique du Qu?bec > > T?l.: 418 646-6777 poste 30015 > > T?l?c.: 418 644-4593_ > > __steve.toutant at inspq.qc.ca_ _ > > __http://www.inspq.qc.ca_ _ > > __http://www.monclimatmasante.qc.ca_ > > > > /Pour me rejoindre par courrier/ > > Service de l'infrastructure et du r?seau > > Direction des technologies de l'information > > Minist?re de la S?curit? Publique > > 2525 boul. Laurier, 2e ?tage > > Tour Laurentides > > Qu?bec, G1V 2L2 > > > > > > > > > > > > _______________________________________________ > > mapserver-users mailing list > > mapserver-users at lists.osgeo.org > > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > > From Steve.Toutant at inspq.qc.ca Mon Jan 26 13:18:16 2015 From: Steve.Toutant at inspq.qc.ca (Steve.Toutant at inspq.qc.ca) Date: Mon, 26 Jan 2015 16:18:16 -0500 Subject: [mapserver-users] Mapserver doesn't send good filter to postgis In-Reply-To: <54C6AD45.9030108@swoodbridge.com> References: <54C66BED.7090503@swoodbridge.com> <54C6AD45.9030108@swoodbridge.com> Message-ID: Until mapserver 7, Do you know if tinyows is doing things the same way? I tried but could not get tinyows working yet. Stephen Woodbridge 2015-01-26 16:10 A Steve.Toutant at inspq.qc.ca cc mapserver-users at lists.osgeo.org, mapserver-users-bounces at lists.osgeo.org Objet Re: [mapserver-users] Mapserver doesn't send good filter to postgis On 1/26/2015 2:12 PM, Steve.Toutant at inspq.qc.ca wrote: > Thanks for your explanation Stephen. > I'm sure there were good reasons to do that, but it is a weird way of > filtering. It is a legacy issue the RFC 91 I think is trying to clean up. Mapserver started with rasters and shapefiles, so everything had to be done in mapserver. As it grew to support more data sources things have changes and we are trying to push this kind of filtering back into the data sources where it can be done efficiently, while still allow other data sources that do not support the native filtering to work also work by having a generic filing ability still built into mapserver. Steve W > I Cannot use the bbox of the window but as you suggest, passing the bbox > of the geometry could be a workaround. > > If someone as an idea on how we could pass the bbox of the geometry to > mapserver or any other ideas it would be much appreciated. > > Is this issue will really be improved in mapserver 7 for postgis and > oracle? When is it scheduled? > > thanks again for your help! > > steve > > > > > *Stephen Woodbridge @lists.osgeo.org* > Envoy? par : mapserver-users-bounces at lists.osgeo.org > > 2015-01-26 11:31 > > > A > mapserver-users at lists.osgeo.org > cc > > Objet > Re: [mapserver-users] Mapserver doesn't send good filter to postgis > > > > > > > > > > > Steve T., > > mapserver gets back all the geometries from postgis and then filters > them in mapserver against the geometry. > > Mapserver passes the BBOX for the mapfile to postgis as you noticed > which is not very efficient, but you can override that to the BBOX of > the window using the BBOX substitution variable in the SQL, but this > might not be what you want if you geometry is off screen. > > I'm not aware of any way to pass the BBOX of the geometry. > > Steve L - can we do this? > > So currently, your wfs requests are getting filtered against the > geometry. And there is room for efficiency improvements. > > -Steve W > > On 1/26/2015 11:15 AM, Steve.Toutant at inspq.qc.ca wrote: > > sorry I'm confused, perhaps I misunderstand what you explained. I don't > > understand what you mean by "MapServer does use the supplied geometry, > > it?s a matter of where the filter is applied ? the database or in > > MapServer" > > > > In mapserver log I see > > > > FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON > > ((-8081644.2511243997141719 5835062.5699599999934435, > > -8081707.5505384001880884 5834980.1612889003008604, > > -8081638.2794815003871918 5834913.2788891997188330, > > -8081533.1785677000880241 5834988.5215889001265168, > > -8081644.2511243997141719 5835062.5699599999934435))')) > > > > So this is good, but > > A few lines later in the mapserver log, I see that it is not sending the > > supplied geometry as filter, it is sending the extent of the mapfile > > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > > 5465442))',3857); > > > > So it received the supplied geometry, but it is not using it.... > > > > If only BBOX can be used as a spatial operator, it is not good for our > > needs. We really need to know what features are inside a user defined > > polygon. > > > > > > > > > > *"Lime, Steve D (MNIT)" * > > > > 2015-01-26 10:56 > > > > > > A > > "Steve.Toutant at inspq.qc.ca" > > cc > > "mapserver-users at lists.osgeo.org" > > > Objet > > RE: [mapserver-users] Mapserver doesn't send good > filter to postgis > > > > > > > > > > > > > > > > > > > > > > MapServer does use the supplied geometry, it?s a matter of where the > > filter is applied ? the database or in MapServer. This isn?t a new > > limitation so others may have more experience with workarounds. Maybe > > try also setting a bbox in the filter based on the bbox of the geometry? > > > > Steve > > > > *From:* Steve.Toutant at inspq.qc.ca [mailto:Steve.Toutant at inspq.qc.ca] * > > Sent:* Monday, January 26, 2015 9:38 AM* > > To:* Lime, Steve D (MNIT)* > > Cc:* mapserver-users at lists.osgeo.org* > > Subject:* RE: [mapserver-users] Mapserver doesn't send good filter to > > postgis > > > > I understand the objective of rfc 91, but the most common use case would > > be to pass the supplied geometry..... > > > > If mapserver doesn't use the supplied geometry, that means that it > > doesn't support spatial filtering. > > > > Our data covers the whole country, not using the supplied geometry means > > we can't use mapserver as a wfs server.... > > > > Is there something we can do about it? A workaround we could use? > > > > > > *"Lime, Steve D (MNIT)" <**_Steve.Lime at state.mn.us_* > > *>* > > > > 2015-01-26 10:14 > > > > > > A > > "_Steve.Toutant at inspq.qc.ca_ > " > > <_Steve.Toutant at inspq.qc.ca_ >, > > "_mapserver-users at lists.osgeo.org_ > > " > > <_mapserver-users at lists.osgeo.org_ > > > > > cc > > > > Objet > > RE: [mapserver-users] Mapserver doesn't send good > filter to postgis > > > > > > > > > > > > > > > > > > > > > > > > It?s a limitation in older versions of MapServer where specific backend > > optimizations were scattered about the WMS/WFS code. Most of those > > optimizations address the most common use cases ? I guess this wasn?t > > one of them. It?s surprising that at worst the extent of the supplied > > geometry isn?t passed (I see a comment in the WFS code about this). The > > specific filter intersection test is applied on the MapServer side ? the > > results are correct, performance can suffer though. > > > > This is being addresses in MapServer 7.0 where more complete filter > > translation functions are being supported (RFC 91). > > > > Steve > > * > > From:* _mapserver-users-bounces at lists.osgeo.org_ > > > > [_mailto:mapserver-users-bounces at lists.osgeo.org_] *On Behalf Of > > *_Steve.Toutant at inspq.qc.ca_ * > > Sent:* Monday, January 26, 2015 8:55 AM* > > To:* _mapserver-users at lists.osgeo.org_ > > * > > Subject:* [mapserver-users] Mapserver doesn't send good filter to postgis > > > > Sorry my first post was with an inapprpriate title...... > > > > I'm using mapserver 6.4.1 and postgis 2.1 > > > > using OpenLayers 2.13.1 I draw a small polygon that I use for a within > > spatial filter of a WFS getfeature request. The problem is that > > mapserver is not sending this polygon to postgis, it is sending the > > extent of the mapfile as filter... > > > > The wfs POST Request (created and send by OpenLayers client) > > > > xmlns:ogc="_http://www.opengis.net/ogc_">msGeometry > xmlns:gml="_http://www.opengis.net/gml_" > > > srsName="urn:ogc:def:crs:EPSG::3857">-8081644.2511244 > > 5835062.56996 -8081707.5505384 5834980.1612889 -8081638.2794815 > > 5834913.2788892 -8081533.1785677 5834988.5215889 -8081644.2511244 > > > 5835062.56996 > > > > > > In Mapserver log, I see > > FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON > > ((-8081644.2511243997141719 5835062.5699599999934435, > > -8081707.5505384001880884 5834980.1612889003008604, > > -8081638.2794815003871918 5834913.2788891997188330, > > -8081533.1785677000880241 5834988.5215889001265168, > > -8081644.2511243997141719 5835062.5699599999934435))')) > > > > Then a few lines later, I see that it is not sending the polygon > > received as filter > > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > > 5465442))',3857); > > > > See the polygon definition is different, postgis receive the extent > > defined in the mapfile > > EXTENT -9239517 5465442 -5565974 9349764 > > > > > > And, in postgis log I see this query, See the > > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > > 5465442))',3857); > > > > > > Why Mapserver is not sending the polygon received as filter to postgis? > > > > > > Thanks! > > > > /Steve Toutant, M. Sc./ > > Analyste en g?omatique > > Secteur environnement > > Direction de la sant? environnementale et de la toxicologie > > Institut national de sant? publique du Qu?bec > > T?l.: 418 646-6777 poste 30015 > > T?l?c.: 418 644-4593_ > > __steve.toutant at inspq.qc.ca_ _ > > __http://www.inspq.qc.ca_ _ > > __http://www.monclimatmasante.qc.ca_ < http://www.monclimatmasante.qc.ca/> > > > > /Pour me rejoindre par courrier/ > > Service de l'infrastructure et du r?seau > > Direction des technologies de l'information > > Minist?re de la S?curit? Publique > > 2525 boul. Laurier, 2e ?tage > > Tour Laurentides > > Qu?bec, G1V 2L2 > > > > > > > > > > > > _______________________________________________ > > mapserver-users mailing list > > mapserver-users at lists.osgeo.org > > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jukka.rahkonen at maanmittauslaitos.fi Mon Jan 26 14:05:59 2015 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Mon, 26 Jan 2015 22:05:59 +0000 Subject: [mapserver-users] Mapserver doesn't send good filter to postgis In-Reply-To: References: <54C66BED.7090503@swoodbridge.com> <54C6AD45.9030108@swoodbridge.com>, Message-ID: <52ef4028cc9c4346a516c436536aed73@C119S212VM022.msvyvi.vaha.local> Hi, TinyOWS is creating good SQL requests as far as I know. Send me some complete HTTP POST GetFeature so I can modify it and see from my TinyOWS and PostGIS logs what really happens. -Jukka Rahkonen- ________________________________ Steve Toutant wrote: Until mapserver 7, Do you know if tinyows is doing things the same way? I tried but could not get tinyows working yet. Stephen Woodbridge 2015-01-26 16:10 A Steve.Toutant at inspq.qc.ca cc mapserver-users at lists.osgeo.org, mapserver-users-bounces at lists.osgeo.org Objet Re: [mapserver-users] Mapserver doesn't send good filter to postgis On 1/26/2015 2:12 PM, Steve.Toutant at inspq.qc.ca wrote: > Thanks for your explanation Stephen. > I'm sure there were good reasons to do that, but it is a weird way of > filtering. It is a legacy issue the RFC 91 I think is trying to clean up. Mapserver started with rasters and shapefiles, so everything had to be done in mapserver. As it grew to support more data sources things have changes and we are trying to push this kind of filtering back into the data sources where it can be done efficiently, while still allow other data sources that do not support the native filtering to work also work by having a generic filing ability still built into mapserver. Steve W > I Cannot use the bbox of the window but as you suggest, passing the bbox > of the geometry could be a workaround. > > If someone as an idea on how we could pass the bbox of the geometry to > mapserver or any other ideas it would be much appreciated. > > Is this issue will really be improved in mapserver 7 for postgis and > oracle? When is it scheduled? > > thanks again for your help! > > steve > > > > > *Stephen Woodbridge @lists.osgeo.org* > Envoy? par : mapserver-users-bounces at lists.osgeo.org > > 2015-01-26 11:31 > > > A > mapserver-users at lists.osgeo.org > cc > > Objet > Re: [mapserver-users] Mapserver doesn't send good filter to postgis > > > > > > > > > > > Steve T., > > mapserver gets back all the geometries from postgis and then filters > them in mapserver against the geometry. > > Mapserver passes the BBOX for the mapfile to postgis as you noticed > which is not very efficient, but you can override that to the BBOX of > the window using the BBOX substitution variable in the SQL, but this > might not be what you want if you geometry is off screen. > > I'm not aware of any way to pass the BBOX of the geometry. > > Steve L - can we do this? > > So currently, your wfs requests are getting filtered against the > geometry. And there is room for efficiency improvements. > > -Steve W > > On 1/26/2015 11:15 AM, Steve.Toutant at inspq.qc.ca wrote: > > sorry I'm confused, perhaps I misunderstand what you explained. I don't > > understand what you mean by "MapServer does use the supplied geometry, > > it?s a matter of where the filter is applied ? the database or in > > MapServer" > > > > In mapserver log I see > > > > FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON > > ((-8081644.2511243997141719 5835062.5699599999934435, > > -8081707.5505384001880884 5834980.1612889003008604, > > -8081638.2794815003871918 5834913.2788891997188330, > > -8081533.1785677000880241 5834988.5215889001265168, > > -8081644.2511243997141719 5835062.5699599999934435))')) > > > > So this is good, but > > A few lines later in the mapserver log, I see that it is not sending the > > supplied geometry as filter, it is sending the extent of the mapfile > > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > > 5465442))',3857); > > > > So it received the supplied geometry, but it is not using it.... > > > > If only BBOX can be used as a spatial operator, it is not good for our > > needs. We really need to know what features are inside a user defined > > polygon. > > > > > > > > > > *"Lime, Steve D (MNIT)" * > > > > 2015-01-26 10:56 > > > > > > A > > "Steve.Toutant at inspq.qc.ca" > > cc > > "mapserver-users at lists.osgeo.org" > > > Objet > > RE: [mapserver-users] Mapserver doesn't send good > filter to postgis > > > > > > > > > > > > > > > > > > > > > > MapServer does use the supplied geometry, it?s a matter of where the > > filter is applied ? the database or in MapServer. This isn?t a new > > limitation so others may have more experience with workarounds. Maybe > > try also setting a bbox in the filter based on the bbox of the geometry? > > > > Steve > > > > *From:* Steve.Toutant at inspq.qc.ca [mailto:Steve.Toutant at inspq.qc.ca] * > > Sent:* Monday, January 26, 2015 9:38 AM* > > To:* Lime, Steve D (MNIT)* > > Cc:* mapserver-users at lists.osgeo.org* > > Subject:* RE: [mapserver-users] Mapserver doesn't send good filter to > > postgis > > > > I understand the objective of rfc 91, but the most common use case would > > be to pass the supplied geometry..... > > > > If mapserver doesn't use the supplied geometry, that means that it > > doesn't support spatial filtering. > > > > Our data covers the whole country, not using the supplied geometry means > > we can't use mapserver as a wfs server.... > > > > Is there something we can do about it? A workaround we could use? > > > > > > *"Lime, Steve D (MNIT)" <**_Steve.Lime at state.mn.us_* > > *>* > > > > 2015-01-26 10:14 > > > > > > A > > "_Steve.Toutant at inspq.qc.ca_ > " > > <_Steve.Toutant at inspq.qc.ca_ >, > > "_mapserver-users at lists.osgeo.org_ > > " > > <_mapserver-users at lists.osgeo.org_ > > > > > cc > > > > Objet > > RE: [mapserver-users] Mapserver doesn't send good > filter to postgis > > > > > > > > > > > > > > > > > > > > > > > > It?s a limitation in older versions of MapServer where specific backend > > optimizations were scattered about the WMS/WFS code. Most of those > > optimizations address the most common use cases ? I guess this wasn?t > > one of them. It?s surprising that at worst the extent of the supplied > > geometry isn?t passed (I see a comment in the WFS code about this). The > > specific filter intersection test is applied on the MapServer side ? the > > results are correct, performance can suffer though. > > > > This is being addresses in MapServer 7.0 where more complete filter > > translation functions are being supported (RFC 91). > > > > Steve > > * > > From:* _mapserver-users-bounces at lists.osgeo.org_ > > > > [_mailto:mapserver-users-bounces at lists.osgeo.org_] *On Behalf Of > > *_Steve.Toutant at inspq.qc.ca_ * > > Sent:* Monday, January 26, 2015 8:55 AM* > > To:* _mapserver-users at lists.osgeo.org_ > > * > > Subject:* [mapserver-users] Mapserver doesn't send good filter to postgis > > > > Sorry my first post was with an inapprpriate title...... > > > > I'm using mapserver 6.4.1 and postgis 2.1 > > > > using OpenLayers 2.13.1 I draw a small polygon that I use for a within > > spatial filter of a WFS getfeature request. The problem is that > > mapserver is not sending this polygon to postgis, it is sending the > > extent of the mapfile as filter... > > > > The wfs POST Request (created and send by OpenLayers client) > > > > xmlns:ogc="_http://www.opengis.net/ogc_">msGeometry > xmlns:gml="_http://www.opengis.net/gml_" > > > srsName="urn:ogc:def:crs:EPSG::3857">-8081644.2511244 > > 5835062.56996 -8081707.5505384 5834980.1612889 -8081638.2794815 > > 5834913.2788892 -8081533.1785677 5834988.5215889 -8081644.2511244 > > > 5835062.56996 > > > > > > In Mapserver log, I see > > FLTLayerApplyPlainFilterToLayer(): ([shape] within fromText('POLYGON > > ((-8081644.2511243997141719 5835062.5699599999934435, > > -8081707.5505384001880884 5834980.1612889003008604, > > -8081638.2794815003871918 5834913.2788891997188330, > > -8081533.1785677000880241 5834988.5215889001265168, > > -8081644.2511243997141719 5835062.5699599999934435))')) > > > > Then a few lines later, I see that it is not sending the polygon > > received as filter > > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > > 5465442))',3857); > > > > See the polygon definition is different, postgis receive the extent > > defined in the mapfile > > EXTENT -9239517 5465442 -5565974 9349764 > > > > > > And, in postgis log I see this query, See the > > select ....... where geom_p && ST_GeomFromText('POLYGON((-9239517 > > 5465442,-9239517 9349764,-5565974 9349764,-5565974 5465442,-9239517 > > 5465442))',3857); > > > > > > Why Mapserver is not sending the polygon received as filter to postgis? > > > > > > Thanks! > > > > /Steve Toutant, M. Sc./ > > Analyste en g?omatique > > Secteur environnement > > Direction de la sant? environnementale et de la toxicologie > > Institut national de sant? publique du Qu?bec > > T?l.: 418 646-6777 poste 30015 > > T?l?c.: 418 644-4593_ > > __steve.toutant at inspq.qc.ca_ _ > > __http://www.inspq.qc.ca_ _ > > __http://www.monclimatmasante.qc.ca_ > > > > /Pour me rejoindre par courrier/ > > Service de l'infrastructure et du r?seau > > Direction des technologies de l'information > > Minist?re de la S?curit? Publique > > 2525 boul. Laurier, 2e ?tage > > Tour Laurentides > > Qu?bec, G1V 2L2 > > > > > > > > > > > > _______________________________________________ > > mapserver-users mailing list > > mapserver-users at lists.osgeo.org > > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > > > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From geo.graefin at web.de Fri Jan 30 02:54:50 2015 From: geo.graefin at web.de (geo.graefin at web.de) Date: Fri, 30 Jan 2015 11:54:50 +0100 Subject: [mapserver-users] change htdocs directory Message-ID: An HTML attachment was scrubbed... URL: From geo.graefin at web.de Fri Jan 30 09:04:46 2015 From: geo.graefin at web.de (geo.graefin at web.de) Date: Fri, 30 Jan 2015 18:04:46 +0100 Subject: [mapserver-users] change htdocs directory In-Reply-To: References: , Message-ID: An HTML attachment was scrubbed... URL: From geo.graefin at web.de Fri Jan 30 10:10:24 2015 From: geo.graefin at web.de (geo.graefin at web.de) Date: Fri, 30 Jan 2015 19:10:24 +0100 Subject: [mapserver-users] change htdocs directory In-Reply-To: References: , Message-ID: An HTML attachment was scrubbed... URL: From boolean10001 at yahoo.com Fri Jan 30 11:40:29 2015 From: boolean10001 at yahoo.com (Carlos Ruiz) Date: Fri, 30 Jan 2015 19:40:29 +0000 (UTC) Subject: [mapserver-users] change htdocs directory In-Reply-To: References: Message-ID: <1166695537.726664.1422646829104.JavaMail.yahoo@mail.yahoo.com> TC, If you want to change the root document path, then inside httpd.conf you must change the DocumentRoot value. MS4W has it like this: DocumentRoot "/ms4w/Apache/htdocs" So you could change it to DocumentRoot "/ms4w/geomoose" Then http://localhost will lead you to the /ms4w/geomoose contents. Remember always to restart the Apache service after modifying httpd.conf If you want to add a path to be reached by an URL (i.e. http;//localhost/geomoose), then you have to create a file called "httpd_geomoose" inside the httpd.d directory with the following configuration: Alias /geomoose "/ms4w/apps/geomoose/" ? AllowOverride None ? Options Indexes FollowSymLinks Multiviews ? Order allow,deny ? Allow from all Then restart Apache service. It is important that the file name starts with "httpd_", because Apache looks for this pattern when it starts to load its configuration. Another thing you have to watch (I think this can be happening to you) is that if you add a slash to the alias in the httpd_xxx file (i.e. Alias /geomoose/), then you have to call the URL with the slash at the end, otherwise it doesn't work, you will receive the HTTP 1.1 404 error. That is why I prefeer to remove it from alias. Try this ! Mtro. Carlos Ruiz From: "geo.graefin at web.de" To: TC Haddad ; mapserver-users at lists.osgeo.org Sent: Friday, January 30, 2015 12:10 PM Subject: Re: [mapserver-users] change htdocs directory Unfortunately, it still does not work."http://localhost" displays the ms4w start page, but "http://localhost/geomoose2/geomoose.html" is empty (error 404).?Can you help me again? Thank you in advance!?Gesendet:?Freitag, 30. Januar 2015 um 18:11 Uhr Von:?"TC Haddad" An:?geo.graefin at web.de Betreff:?Re: Re: [mapserver-users] change htdocs directoryWell, the URL you must use will have to contain the name of the alias that you put in http.d ?so if your alias is called "geomoose" then your URL would be ?http://localhost/geomoose/ ?Here is the example http.d file that comes with Geomoose for MS4W web mercator demo (http://www.geomoose.org/downloads/GeoMOOSE-2.7.1-MS4W.zip) ?-------------- fwd ----------------------- >> Alias /geomoose2/ "/ms4w/apps/geomoose2/htdocs/" ? AllowOverride None ? Options Indexes FollowSymLinks Multiviews ? Order allow,deny ? Allow from all ------------------------------------------------ ?In this example the alias is called geomoose2, so the URL will be http://localhost/geomoose2/?Normally all you have to do with the package above is unzip the contents into the MS4W directory and restart Apache. The package assumes that you did not mess with the other parts of MS4W... ?Tanya??On Fri, Jan 30, 2015 at 9:04 AM, wrote: Hi Tanya, thank you for your answer!?I created the file with content as decribed in the instruction of README_HTTPD.txt and restarted the Apache, but still I can not go to the changed htdocs directory.?Anything else what I have to do???Gesendet:?Freitag, 30. Januar 2015 um 17:54 Uhr Von:?"TC Haddad" An:?geo.graefin at web.de Betreff:?Re: [mapserver-users] change htdocs directoryHi Geograefin you have to put a file in ?ms4w/httpd.d/ ?with your geomoose home location . leace the regular Apache http.conf file alone. ?look at the other httpd example files in ms4w for example of the syntax. ?Tanya?On Fri, Jan 30, 2015 at 2:54 AM, wrote: Hello,?I installed the package MS4W 3.0.6. Now I will change the directory from "ms4w/Apache/htdocs" to "ms4w/apps/geomoose/htdocs". Where I have to change the directory settings? A change in the httpd.conf file (ms4w/Apache/conf) did not lead to success.?I would be very grateful if you help me!?Thank you!?Geograefin _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users _______________________________________________ mapserver-users mailing list mapserver-users at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From geo.graefin at web.de Sat Jan 31 04:42:52 2015 From: geo.graefin at web.de (geo.graefin at web.de) Date: Sat, 31 Jan 2015 13:42:52 +0100 Subject: [mapserver-users] change htdocs directory In-Reply-To: <1166695537.726664.1422646829104.JavaMail.yahoo@mail.yahoo.com> References: , <1166695537.726664.1422646829104.JavaMail.yahoo@mail.yahoo.com> Message-ID: An HTML attachment was scrubbed... URL: From equiros at unex.es Mon Jan 26 12:05:56 2015 From: equiros at unex.es (=?UTF-8?Q?Elia_Quir=C3=B3s_Rosado?=) Date: Mon, 26 Jan 2015 20:05:56 -0000 Subject: [mapserver-users] Fwd: Unable to load example 1.9 of mapserver tutorial In-Reply-To: References: Message-ID: Hi, I have a big problem with the exercise 1.9 of mapserver tutorial. When I click in the dynamic window a new png file is generated in my local tmp/ms_tmp/ path but it is not loaded at the browser. I have been one week trying to change, directories, paths, browser configurations... but nothing works. Could anyone be so kind and tell me how can I solve the problem? I have attached a screenshot of what is happening. Thank you for your help best regards [image: Im?genes integradas 1] ------------------------------------------------------------------------------------------------------------------------------------------------ Elia Quir?s Rosado Escuela Polit?cnica Universidad de Extremadura Tel?fono: 927257195 ext. 51525 Grupo de Investigaci?n Kraken: http://www.unex.es/investigacion/grupos/kraken/estructura/personal ResearcherID: C-3301-2013 ------------------------------------------------------------------------------------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 368427 bytes Desc: not available URL: