[mapserver-users] Mapserver and MapScript performance issue

2011-09-09 Thread Hawk AA
Hi,

 

First of all, thank you for Mapserver and all of the documentation. It’s
really a great product.

 

I’m having some performance issues when querying on a column in MapScript.

 

I use the following code:

 

$oResult = @$oLayerObject-queryByAttributes($strField, $strSearchString,
MS_SINGLE);

 

Where $strField can for instance be “Point_ID” and $strSearchString can be
something like “HEG1” . I only need one result, as the column is the primary
key for the table, and is unique. 

 

The tables I’m searching through is of MapInfo *.tab format, has about
50’000 records, and the actual columns are indexed.

 

Each lookup with PHP MapScript takes about 1.5 seconds. I’ve uploaded the
data into a PostGIS-database, and I can find the actual record in about 0.03
seconds.

 

My mapfile definition of the layers looks like this:

 

LAYER

   NAME Traseer

   PROJECTION

  init=epsg:32632

   END

   GROUP TelMe

   METADATA

   wfs_title
Traseer

   wfs_srs
EPSG:32632

   gml_featureid
Trace_ID

   gml_include_items
Trace_ID,Type

   END

   TYPE LINE

   CONNECTIONTYPE OGR

   CONNECTION TM_Nett/TM_Traces.TAB

   STYLEITEM AUTO

   maxscaledenom 30

   TEMPLATE ttt_query.html

   DUMP TRUE

   CLASS

   NAME Traseer

   SYMBOL
default-circle

   COLOR 255 0 0

   #SIZE 6

   END

END # Layer

 

 

LAYER

   NAME Punkter

   GROUP TelMe

   METADATA

   wfs_title
Punkter

   wfs_srs
EPSG:32632

   gml_featureid
Point_ID

   gml_include_itemsall

   gml_exclude_items
rowid#

   wms_title
Punkter

   wms_srs
EPSG:32632

   END

   PROJECTION

  init=epsg:32632

   END

   DUMP TRUE

   TYPE POINT

   CONNECTIONTYPE OGR

   CONNECTION TM_Nett/TM_Points.TAB

   CLASSITEM Type

   CLASS

   maxscaledenom 1000

   TEMPLATE ttt_query.html

   EXPRESSION TRASE SPLIT

   NAME Trasedeling

   STYLE

 SYMBOL 'circle' 

 SIZE 8

 COLOR -1 -1 -1 #Usynlig

   END

   END

   CLASS

   maxscaledenom 3000

   TEMPLATE ttt_query.html

   EXPRESSION /NEXANS WTC*/

   NAME WTC-Bokser

   STYLE

 SYMBOL 'square'

 SIZE 12

 COLOR 255 128 0 #Orange

   OUTLINECOLOR
0 0 0

   END

   END

   CLASS

   maxscaledenom 1

   TEMPLATE ttt_query.html

   EXPRESSION /NODE*/

   NAME Node

   STYLE

   

[mapserver-users] getFeatureInfo html with special characters in datasource

2011-09-09 Thread Jörg Thomsen

hi,

I'd like to get a html-feature-info like

Niedersachsen
167

I get both, 'Niedersachsen' and '167' from the same table-column of the 
database and I need the line break between them. When I use 
'Niedersachsenbr167' in the Atrributes, mapserver changes the brackets 
into the html-entities and i get

'Niedersachsenlt;brgt;167'
which is shown as 'Niedersachsenbr167' in the browser-window.

Are there any special-characters I can use in the database or is there 
an other solution?


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


Re: [mapserver-users] Re: Mapserver unnecessary slow with Spatialite

2011-09-09 Thread Rahkonen Jukka
Even Rouault wrote:
 30. August 2011 23:28

 I've just added support for spatialite views in GDAL trunk 
 (r23011). Spatial 
 index of the base table is used to speed up spatial queries 
 on the view.
 
 On your example, to create the spatial view :
 
 ogrinfo berlin.sqlite -sql create view 
 osm_line_highway_not_null as select 
 OGC_FID AS ROWID, GEOMETRY, osm_id ,highway,ref,name, tunnel 
 from osm_line 
 where highway is not null
 
 ogrinfo berlin.sqlite -sql INSERT INTO 
 views_geometry_columns (view_name, 
 view_geometry, view_rowid, f_table_name, f_geometry_column) VALUES 
 ('osm_line_highway_not_null', 'GEOMETRY', 'ROWID', 
 'osm_line', 'GEOMETRY')
 
 Note: you must call the primary key ROWID if you want QGIS to 
 be able to 
 display the view on the map. I'm not sure why this is 
 necessary (the OGR 
 driver works with other names), may be a limitation of the 
 qgis spatialite 
 driver.
 
 And then you can use  osm_line_highway_not_null as a regular 
 layer for 
 mapserver.

I have done some speed tests with fresh Mapserver Windows build (date 
09.09.2011) installed from
http://www.gisinternals.com/sdk/PackageList.aspx?file=release-1500-gdal-mapserver.zip
and the gdal binaries from the same package.

Results are somehow baffling. Good news is that with the new build does support 
the use of Spatialite views as Mapserver layers that the views are really a bit 
faster to use than having DATA as SELECT...FROM...WHERE.. in the mapfile. 
Feels good so far. But when I switched back to standard MS4W I measured that 
Mapserver was more than two times faster with the old binaries than with the 
new ones.
A closer analysis showed that new binaries were considerably faster in 
rendering the most heavy layer roadsclose_03 but much slower with all the 
othet layers. 

Results with MS4W
=
 rendering using outputformat named png (AGG/PNG).
 WMS/WFS set-up and query, 0.000s
 Layer 0 (landuse_layer1), 0.531s
 Layer 1 (landuse_layer2), 0.481s
 Layer 2 (landuse_layer3), 0.501s
 Layer 3 (landuse_layer4), 0.550s
 Layer 4 (landuse_layer5), 0.491s
 Layer 5 (landuse_layer6), 0.281s
 Layer 7 (sports), 0.430s
 Layer 10 (railways_03), 0.301s
 Layer 18 (roadsclose_03), 5.398s
 Layer 27 (places_01), 0.250s
 Drawing Label Cache, 0.010s
 total time: 9.244s

Results with the dev-binaries
=
 rendering using outputformat named png (AGG/PNG).
 WMS/WFS set-up and query, 0.000s
 Layer 0 (landuse_layer1), 1.753s
 Layer 1 (landuse_layer2), 2.554s
 Layer 2 (landuse_layer3), 1.762s
 Layer 3 (landuse_layer4), 1.733s
 Layer 4 (landuse_layer5), 2.543s
 Layer 5 (landuse_layer6), 1.793s
 Layer 7 (sports), 2.163s
 Layer 10 (railways_03), 1.732s
 Layer 18 (roadsclose_03), 1.753s
 Layer 27 (places_01), 1.732s
 Drawing Label Cache, 0.000s
 total time: 19.518s


I can mail a link for downloading the whole test set-up with data and mapfiles 
if someone gets interested.

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


AW: [mapserver-users] getFeatureInfo html with special characters indatasource

2011-09-09 Thread Arnd Wippermann
Hi,

Perhaps you can use [yourFIELD_raw]. It shouldn't encode HTML.

http://mapserver.org/mapfile/template.html
[attribute name],[attrribute name_esc],[attribute item name_raw]


Or you can use javascript in your templates to solve this

!-- Mapserver Template --
script
var ret = [yourFIELD].split( ).join(br);
document.write(ret);
/script
 
Arnd

-Ursprüngliche Nachricht-
Von: mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] Im Auftrag von Jörg Thomsen
Gesendet: Freitag, 9. September 2011 12:01
An: mapserver-users@lists.osgeo.org
Betreff: [mapserver-users] getFeatureInfo html with special characters
indatasource

hi,

I'd like to get a html-feature-info like

Niedersachsen
167

I get both, 'Niedersachsen' and '167' from the same table-column of the
database and I need the line break between them. When I use
'Niedersachsenbr167' in the Atrributes, mapserver changes the brackets
into the html-entities and i get 'Niedersachsenlt;brgt;167'
which is shown as 'Niedersachsenbr167' in the browser-window.

Are there any special-characters I can use in the database or is there an
other solution?

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

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


RE: [mapserver-users] MapScript WMS request

2011-09-09 Thread Fawcett, David (MPCA)
Puneet, 

As far as I know, OpenLayers still has support for a layer based on MapServer 
CGI.  Because MapServer can also serve up WMS well, this layer type isn't 
necessarily recommended or as well supported.  

http://dev.openlayers.org/docs/files/OpenLayers/Layer/MapServer-js.html

David.

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mr. Puneet Kishor
Sent: Thursday, September 08, 2011 9:32 PM
To: Daniel Morissette
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] MapScript WMS request


On Sep 8, 2011, at 8:28 PM, Daniel Morissette wrote:

 On 11-09-08 09:02 PM, Mr. Puneet Kishor wrote:
 
 On Sep 8, 2011, at 7:43 PM, Daniel Morissette wrote:
 
 Maybe call $map-save(/tmp/my.map) in your script after the map and layer 
 have been populated and paste the result... that may give us a hint...
 
 
 wow! this is a super-awesome debugging technique. I have sent you the map 
 file off list to not pollute the entire list serve.
 
 
 I was able to reproduce the issue with the copy of the mapfile you sent 
 off-list.
 
 It turns out that mappostgis.c's msPostGISLayerGetExtent() is hardcoded to 
 always return
 
 {minx = -2500, miny = -2500, maxx = 2500, maxy = 2500}
 
 ...and then it returns MS_SUCCESS.
 
 I think this function should either be left unimplemented (this way MapServer 
 would fallback on other mechanisms), or return MS_FAILURE to indicate to the 
 calling code that it didn't do anything useful.
 
 A quick search indicates an open ticket about the issue:
 
 http://trac.osgeo.org/mapserver/ticket/3585
 
 You could bump the ticket and hope someone works on it at the FOSS4G code 
 sprint next week.
 
 The short term fix for you would be to set the ows_extent metadata in your 
 layer:
 
METADATA
  ows_extent -180 -90 180 90
   ...
END
 


Thanks Daniel. I will bump the ticket. For now, see below --

Using the my.map file I sent you, with no further modifications to it, I am 
able to successfully get an image back via 
[http://localhost.local/cgi-bin/gmna?SERVICE=WMSVERSION=1.1.1REQUEST=GetMapBBOX=-180,-90,180,90SRS=EPSG:4326WIDTH=1200HEIGHT=600LAYERS=gmnaSTYLES=FORMAT=image/pngTRANSPARENT=true]

Note, no further modifications is required, that is, not even the ows_extent 
-180 -90 180 90 bit in the layer METADATA. and I still get a good image.


However, if I use the following program to access the same map file, I get the 
spurious minx = -2500, miny = -2500, maxx = 2500, maxy = 2500 
in the GetCapabilities.

Finally, if I add the ows_extent -180 -90 180 90 line in the layer METADATA 
in the my.map file, the GetCapabilities returns the correct bounds now, 
however, the image is still blank.

#!/opt/local/bin/perl

use strict;
use mapscript;

my $wms = new mapscript::OWSRequest();
$wms-setParameter(SERVICE, WMS );
$wms-setParameter(VERSION, 1.1.1 );
$wms-setParameter(REQUEST, GetMap );
$wms-setParameter(BBOX, -180,-90,180,90 );
$wms-setParameter(LAYERS, gmna);
$wms-setParameter(SRS, EPSG:4326);
$wms-setParameter(WIDTH, 1200);
$wms-setParameter(HEIGHT, 600);
$wms-setParameter(FORMAT, image/png);
$wms-setParameter(TRANSPARENT, true);

my $map = new 
mapscript::mapObj(/Users/punkish/Sites/test/mapscript/my.map);

if(!$map) {
warn New mapObj() error: $mapscript::ms_error-{message}\n;
}

my $io = mapscript::msIO_installStdoutToBuffer();
my $dispatch_out = $map-OWSDispatch( $wms );
printf %s\n, mapscript::msIO_getStdoutBufferString();

I have now spent an enormous amount of time on this, and for now, I have to 
move on. This is just not working out. Maybe I will try some other technique, 
perhaps this mode=tile to see if I can get MapServer powered maps in my apps.

Thanks much for your help. If you (or anyone else) can come up with a bright 
idea, I will be happy to try it.

Puneet.

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


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


Re: [mapserver-users] MapScript WMS request

2011-09-09 Thread Mr. Puneet Kishor

On Sep 9, 2011, at 8:39 AM, Fawcett, David (MPCA) wrote:

 Puneet, 
 
 As far as I know, OpenLayers still has support for a layer based on MapServer 
 CGI.  Because MapServer can also serve up WMS well, this layer type isn't 
 necessarily recommended or as well supported.  
 
 http://dev.openlayers.org/docs/files/OpenLayers/Layer/MapServer-js.html



Indeed David. Because, going by the docs, the MapServer CGI calls are 
discouraged (or so it seems), I'd rather not invest in that path. This is a 
long term project that I am working on, so the foundations have to be very 
robust. Besides, I may or may not use OL. While I like OL a lot, I am also 
looking at other frameworks (Gmaps, Leaflet, Polymaps), and it would be wise to 
decouple the backend from the front-end as much as possible.

I have no issues with using WMS, but I just am unable to get MapServer WMS to 
work via MapScript. And, yes, I do have to use MapScript if I can help it -- my 
layer classification is generated on demand, and MapScript is the easiest way I 
can think of for doing that.

I did find yesterday that `mode=tile` works really well, but I am trying to 
make that work with MapScript. A separate email thread for that question.




 
 David.
 
 -Original Message-
 From: mapserver-users-boun...@lists.osgeo.org 
 [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mr. Puneet 
 Kishor
 Sent: Thursday, September 08, 2011 9:32 PM
 To: Daniel Morissette
 Cc: mapserver-users@lists.osgeo.org
 Subject: Re: [mapserver-users] MapScript WMS request
 
 
 On Sep 8, 2011, at 8:28 PM, Daniel Morissette wrote:
 
 On 11-09-08 09:02 PM, Mr. Puneet Kishor wrote:
 
 On Sep 8, 2011, at 7:43 PM, Daniel Morissette wrote:
 
 Maybe call $map-save(/tmp/my.map) in your script after the map and 
 layer have been populated and paste the result... that may give us a 
 hint...
 
 
 wow! this is a super-awesome debugging technique. I have sent you the map 
 file off list to not pollute the entire list serve.
 
 
 I was able to reproduce the issue with the copy of the mapfile you sent 
 off-list.
 
 It turns out that mappostgis.c's msPostGISLayerGetExtent() is hardcoded to 
 always return
 
 {minx = -2500, miny = -2500, maxx = 2500, maxy = 2500}
 
 ...and then it returns MS_SUCCESS.
 
 I think this function should either be left unimplemented (this way 
 MapServer would fallback on other mechanisms), or return MS_FAILURE to 
 indicate to the calling code that it didn't do anything useful.
 
 A quick search indicates an open ticket about the issue:
 
 http://trac.osgeo.org/mapserver/ticket/3585
 
 You could bump the ticket and hope someone works on it at the FOSS4G code 
 sprint next week.
 
 The short term fix for you would be to set the ows_extent metadata in your 
 layer:
 
   METADATA
 ows_extent -180 -90 180 90
  ...
   END
 
 
 
 Thanks Daniel. I will bump the ticket. For now, see below --
 
 Using the my.map file I sent you, with no further modifications to it, I am 
 able to successfully get an image back via 
 [http://localhost.local/cgi-bin/gmna?SERVICE=WMSVERSION=1.1.1REQUEST=GetMapBBOX=-180,-90,180,90SRS=EPSG:4326WIDTH=1200HEIGHT=600LAYERS=gmnaSTYLES=FORMAT=image/pngTRANSPARENT=true]
 
 Note, no further modifications is required, that is, not even the 
 ows_extent -180 -90 180 90 bit in the layer METADATA. and I still get a 
 good image.
 
 
 However, if I use the following program to access the same map file, I get 
 the spurious minx = -2500, miny = -2500, maxx = 2500, maxy = 
 2500 in the GetCapabilities.
 
 Finally, if I add the ows_extent -180 -90 180 90 line in the layer 
 METADATA in the my.map file, the GetCapabilities returns the correct bounds 
 now, however, the image is still blank.
 
   #!/opt/local/bin/perl
   
   use strict;
   use mapscript;
   
   my $wms = new mapscript::OWSRequest();
   $wms-setParameter(SERVICE, WMS );
   $wms-setParameter(VERSION, 1.1.1 );
   $wms-setParameter(REQUEST, GetMap );
   $wms-setParameter(BBOX, -180,-90,180,90 );
   $wms-setParameter(LAYERS, gmna);
   $wms-setParameter(SRS, EPSG:4326);
   $wms-setParameter(WIDTH, 1200);
   $wms-setParameter(HEIGHT, 600);
   $wms-setParameter(FORMAT, image/png);
   $wms-setParameter(TRANSPARENT, true);
   
   my $map = new 
 mapscript::mapObj(/Users/punkish/Sites/test/mapscript/my.map);
   
   if(!$map) {
   warn New mapObj() error: $mapscript::ms_error-{message}\n;
   }
   
   my $io = mapscript::msIO_installStdoutToBuffer();
   my $dispatch_out = $map-OWSDispatch( $wms );
   printf %s\n, mapscript::msIO_getStdoutBufferString();
 
 I have now spent an enormous amount of time on this, and for now, I have to 
 move on. This is just not working out. Maybe I will try some other technique, 
 perhaps this mode=tile to see if I can get MapServer powered maps in my apps.
 
 Thanks much for your help. If you (or anyone 

[mapserver-users] Use EXTENT to crop an image within a map file

2011-09-09 Thread Enzmann, Alexander R.
Is it possible to only use a subset of an image that is referenced in a 
mapfile?  In the mapfile below there are two FAA sectional charts.  There are 
borders on the charts that I don't want on the final composite image.

If the EXTENT actually clipped the image before rendering, I could get what 
I'm looking for, but it only seems to be used to determine overlap with the 
bounds of the output image (and not always then).

I'm sure I could use something like gdal_translate to preprocess all of the 
charts, but that a really tedious sort of task and results in extra images 
lying around.  Would prefer to use source images and have the mapfile pull the 
correct bits out of them.

The charts are available at: 
http://aeronav.faa.gov/index.asp?xml=aeronav/applications/VFR/chartlist_sect

Xander

#
# MapServer map file for FAA Sectional Raster charts (test case w/ only two 
charts)
#
MAP
  NAME FAA Sectional Raster
  IMAGETYPE PNG
  SIZE 256 256
  DEBUG OFF
  UNITS DD
  SHAPEPATH /MapData/FAA/SectionalRaster

  PROJECTION init=epsg:4269 END

 WEB
METADATA
  wms_srs EPSG:900913 EPSG:4326
  ows_enable_request *
END
  END

  LAYER
NAME LA North DATA Los Angeles 89 North.tif
STATUS ON TYPE RASTER DUMP TRUE PROJECTION auto END
  END

  LAYER
NAME LA South DATA Los Angeles 89 South.tif
STATUS ON TYPE RASTER DUMP TRUE
PROJECTION +proj=lcc +lat_1=38.7 +lat_2=33.3 +lat_0=34.16667 
+lon_0=-118.5 END
EXTENT -122 32 -119 34 END
  END

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


RE: [mapserver-users] MapScript WMS request

2011-09-09 Thread Fawcett, David (MPCA)
Puneet, 

Using MapServer CGI and layer.MapServer would not set you up well for other 
client libraries, so I see your point.  It can be viable though.

In this app (just an imagemap, not OL), there are no attribute values 
associated with the spatial data.  The classes are generated on-the-fly and the 
county id's for each class are passed in as URL vars.  Same thing for the 
legend.  This allows flexibility for compounds who's emissions may vary from 
tens of pounds to millions of pounds.

This approach may not work for your case, but it is another way to slice it...

http://www.pca.state.mn.us/index.php/topics/environmental-data/eda-environmental-data-access/eda-air-quality-searches/eda-air-quality-search-emissions-by-county-data.html

David.

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mr. Puneet Kishor
Sent: Friday, September 09, 2011 9:35 AM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] MapScript WMS request


On Sep 9, 2011, at 8:39 AM, Fawcett, David (MPCA) wrote:

 Puneet, 
 
 As far as I know, OpenLayers still has support for a layer based on MapServer 
 CGI.  Because MapServer can also serve up WMS well, this layer type isn't 
 necessarily recommended or as well supported.  
 
 http://dev.openlayers.org/docs/files/OpenLayers/Layer/MapServer-js.html



Indeed David. Because, going by the docs, the MapServer CGI calls are 
discouraged (or so it seems), I'd rather not invest in that path. This is a 
long term project that I am working on, so the foundations have to be very 
robust. Besides, I may or may not use OL. While I like OL a lot, I am also 
looking at other frameworks (Gmaps, Leaflet, Polymaps), and it would be wise to 
decouple the backend from the front-end as much as possible.

I have no issues with using WMS, but I just am unable to get MapServer WMS to 
work via MapScript. And, yes, I do have to use MapScript if I can help it -- my 
layer classification is generated on demand, and MapScript is the easiest way I 
can think of for doing that.

I did find yesterday that `mode=tile` works really well, but I am trying to 
make that work with MapScript. A separate email thread for that question.




 
 David.
 
 -Original Message-
 From: mapserver-users-boun...@lists.osgeo.org 
 [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mr. Puneet 
 Kishor
 Sent: Thursday, September 08, 2011 9:32 PM
 To: Daniel Morissette
 Cc: mapserver-users@lists.osgeo.org
 Subject: Re: [mapserver-users] MapScript WMS request
 
 
 On Sep 8, 2011, at 8:28 PM, Daniel Morissette wrote:
 
 On 11-09-08 09:02 PM, Mr. Puneet Kishor wrote:
 
 On Sep 8, 2011, at 7:43 PM, Daniel Morissette wrote:
 
 Maybe call $map-save(/tmp/my.map) in your script after the map and 
 layer have been populated and paste the result... that may give us a 
 hint...
 
 
 wow! this is a super-awesome debugging technique. I have sent you the map 
 file off list to not pollute the entire list serve.
 
 
 I was able to reproduce the issue with the copy of the mapfile you sent 
 off-list.
 
 It turns out that mappostgis.c's msPostGISLayerGetExtent() is hardcoded to 
 always return
 
 {minx = -2500, miny = -2500, maxx = 2500, maxy = 2500}
 
 ...and then it returns MS_SUCCESS.
 
 I think this function should either be left unimplemented (this way 
 MapServer would fallback on other mechanisms), or return MS_FAILURE to 
 indicate to the calling code that it didn't do anything useful.
 
 A quick search indicates an open ticket about the issue:
 
 http://trac.osgeo.org/mapserver/ticket/3585
 
 You could bump the ticket and hope someone works on it at the FOSS4G code 
 sprint next week.
 
 The short term fix for you would be to set the ows_extent metadata in your 
 layer:
 
   METADATA
 ows_extent -180 -90 180 90
  ...
   END
 
 
 
 Thanks Daniel. I will bump the ticket. For now, see below --
 
 Using the my.map file I sent you, with no further modifications to it, I am 
 able to successfully get an image back via 
 [http://localhost.local/cgi-bin/gmna?SERVICE=WMSVERSION=1.1.1REQUEST=GetMapBBOX=-180,-90,180,90SRS=EPSG:4326WIDTH=1200HEIGHT=600LAYERS=gmnaSTYLES=FORMAT=image/pngTRANSPARENT=true]
 
 Note, no further modifications is required, that is, not even the 
 ows_extent -180 -90 180 90 bit in the layer METADATA. and I still get a 
 good image.
 
 
 However, if I use the following program to access the same map file, I get 
 the spurious minx = -2500, miny = -2500, maxx = 2500, maxy = 
 2500 in the GetCapabilities.
 
 Finally, if I add the ows_extent -180 -90 180 90 line in the layer 
 METADATA in the my.map file, the GetCapabilities returns the correct bounds 
 now, however, the image is still blank.
 
   #!/opt/local/bin/perl
   
   use strict;
   use mapscript;
   
   my $wms = new mapscript::OWSRequest();
   $wms-setParameter(SERVICE, WMS );
   

Re: [mapserver-users] MapScript WMS request

2011-09-09 Thread Mr. Puneet Kishor
David,


On Sep 9, 2011, at 9:47 AM, Fawcett, David (MPCA) wrote:

 Puneet, 
 
 Using MapServer CGI and layer.MapServer would not set you up well for other 
 client libraries, so I see your point.  It can be viable though.
 
 In this app (just an imagemap, not OL), there are no attribute values 
 associated with the spatial data.  The classes are generated on-the-fly and 
 the county id's for each class are passed in as URL vars.  Same thing for the 
 legend.  This allows flexibility for compounds who's emissions may vary from 
 tens of pounds to millions of pounds.
 
 This approach may not work for your case, but it is another way to slice it...


Possibly. See, it is crucially important for me to be able to generate classes 
on the fly, and with a lot of flexibility. Not just that, the criteria for 
generating the classes can change. So, what I am doing actually is setting up a 
separate application that does nothing but respond with class information. The 
mapping application (and, any other application, for that matter), would query 
this class generating application and make the classes as per the latest 
information. Hence, my need for MapScripting. Well, there are other reasons as 
well, but this is an important one.


 
 http://www.pca.state.mn.us/index.php/topics/environmental-data/eda-environmental-data-access/eda-air-quality-searches/eda-air-quality-search-emissions-by-county-data.html



By the way, the app above is not working. I get broken images, and the 
following errors in the web inspector (that might help you troubleshoot)


GET http://www.pca.state.mn.us/oea/css/master.css 404 (Not Found)

emissions.cfm:28 ReferenceError: Can't find variable: urchinTracker

GET http://maps.pca.state.mn.us/cgi-bin/mapserv? ..snipped.. A server with the 
specified hostname could not be found.

GET http://maps.pca.state.mn.us/cgi-bin/mapserv? ..snipped.. A server with the 
specified hostname could not be found.

GET 
http://cf.pca.state.mn.us/data/edaAir/artwork/edaP2results_edaAmbientResultsPollutantsJuly_04.gif
 404 (Not Found)

master-print.cssGET http://www.pca.state.mn.us/oea/css/master-print.css 404 
(Not Found)




 
 David.
 
 -Original Message-
 From: mapserver-users-boun...@lists.osgeo.org 
 [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mr. Puneet 
 Kishor
 Sent: Friday, September 09, 2011 9:35 AM
 To: mapserver-users@lists.osgeo.org
 Subject: Re: [mapserver-users] MapScript WMS request
 
 
 On Sep 9, 2011, at 8:39 AM, Fawcett, David (MPCA) wrote:
 
 Puneet, 
 
 As far as I know, OpenLayers still has support for a layer based on 
 MapServer CGI.  Because MapServer can also serve up WMS well, this layer 
 type isn't necessarily recommended or as well supported.  
 
 http://dev.openlayers.org/docs/files/OpenLayers/Layer/MapServer-js.html
 
 
 
 Indeed David. Because, going by the docs, the MapServer CGI calls are 
 discouraged (or so it seems), I'd rather not invest in that path. This is a 
 long term project that I am working on, so the foundations have to be very 
 robust. Besides, I may or may not use OL. While I like OL a lot, I am also 
 looking at other frameworks (Gmaps, Leaflet, Polymaps), and it would be wise 
 to decouple the backend from the front-end as much as possible.
 
 I have no issues with using WMS, but I just am unable to get MapServer WMS to 
 work via MapScript. And, yes, I do have to use MapScript if I can help it -- 
 my layer classification is generated on demand, and MapScript is the easiest 
 way I can think of for doing that.
 
 I did find yesterday that `mode=tile` works really well, but I am trying to 
 make that work with MapScript. A separate email thread for that question.
 
 
 
 
 
 David.
 
 -Original Message-
 From: mapserver-users-boun...@lists.osgeo.org 
 [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mr. Puneet 
 Kishor
 Sent: Thursday, September 08, 2011 9:32 PM
 To: Daniel Morissette
 Cc: mapserver-users@lists.osgeo.org
 Subject: Re: [mapserver-users] MapScript WMS request
 
 
 On Sep 8, 2011, at 8:28 PM, Daniel Morissette wrote:
 
 On 11-09-08 09:02 PM, Mr. Puneet Kishor wrote:
 
 On Sep 8, 2011, at 7:43 PM, Daniel Morissette wrote:
 
 Maybe call $map-save(/tmp/my.map) in your script after the map and 
 layer have been populated and paste the result... that may give us a 
 hint...
 
 
 wow! this is a super-awesome debugging technique. I have sent you the map 
 file off list to not pollute the entire list serve.
 
 
 I was able to reproduce the issue with the copy of the mapfile you sent 
 off-list.
 
 It turns out that mappostgis.c's msPostGISLayerGetExtent() is hardcoded to 
 always return
 
 {minx = -2500, miny = -2500, maxx = 2500, maxy = 2500}
 
 ...and then it returns MS_SUCCESS.
 
 I think this function should either be left unimplemented (this way 
 MapServer would fallback on other mechanisms), or return MS_FAILURE to 
 indicate to the calling code that it didn't do anything 

RE: [mapserver-users] MapScript WMS request

2011-09-09 Thread Fawcett, David (MPCA)
DNS issue, should be fixed by Monday...   ; ('

-Original Message-
From: Mr. Puneet Kishor [mailto:punk.k...@gmail.com] 
Sent: Friday, September 09, 2011 10:00 AM
To: Fawcett, David (MPCA)
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] MapScript WMS request

David,


On Sep 9, 2011, at 9:47 AM, Fawcett, David (MPCA) wrote:

 Puneet, 
 
 Using MapServer CGI and layer.MapServer would not set you up well for other 
 client libraries, so I see your point.  It can be viable though.
 
 In this app (just an imagemap, not OL), there are no attribute values 
 associated with the spatial data.  The classes are generated on-the-fly and 
 the county id's for each class are passed in as URL vars.  Same thing for the 
 legend.  This allows flexibility for compounds who's emissions may vary from 
 tens of pounds to millions of pounds.
 
 This approach may not work for your case, but it is another way to slice it...


Possibly. See, it is crucially important for me to be able to generate classes 
on the fly, and with a lot of flexibility. Not just that, the criteria for 
generating the classes can change. So, what I am doing actually is setting up a 
separate application that does nothing but respond with class information. The 
mapping application (and, any other application, for that matter), would query 
this class generating application and make the classes as per the latest 
information. Hence, my need for MapScripting. Well, there are other reasons as 
well, but this is an important one.


 
 http://www.pca.state.mn.us/index.php/topics/environmental-data/eda-environmental-data-access/eda-air-quality-searches/eda-air-quality-search-emissions-by-county-data.html



By the way, the app above is not working. I get broken images, and the 
following errors in the web inspector (that might help you troubleshoot)


GET http://www.pca.state.mn.us/oea/css/master.css 404 (Not Found)

emissions.cfm:28 ReferenceError: Can't find variable: urchinTracker

GET http://maps.pca.state.mn.us/cgi-bin/mapserv? ..snipped.. A server with the 
specified hostname could not be found.

GET http://maps.pca.state.mn.us/cgi-bin/mapserv? ..snipped.. A server with the 
specified hostname could not be found.

GET 
http://cf.pca.state.mn.us/data/edaAir/artwork/edaP2results_edaAmbientResultsPollutantsJuly_04.gif
 404 (Not Found)

master-print.cssGET http://www.pca.state.mn.us/oea/css/master-print.css 404 
(Not Found)




 
 David.
 
 -Original Message-
 From: mapserver-users-boun...@lists.osgeo.org 
 [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mr. Puneet 
 Kishor
 Sent: Friday, September 09, 2011 9:35 AM
 To: mapserver-users@lists.osgeo.org
 Subject: Re: [mapserver-users] MapScript WMS request
 
 
 On Sep 9, 2011, at 8:39 AM, Fawcett, David (MPCA) wrote:
 
 Puneet, 
 
 As far as I know, OpenLayers still has support for a layer based on 
 MapServer CGI.  Because MapServer can also serve up WMS well, this layer 
 type isn't necessarily recommended or as well supported.  
 
 http://dev.openlayers.org/docs/files/OpenLayers/Layer/MapServer-js.html
 
 
 
 Indeed David. Because, going by the docs, the MapServer CGI calls are 
 discouraged (or so it seems), I'd rather not invest in that path. This is a 
 long term project that I am working on, so the foundations have to be very 
 robust. Besides, I may or may not use OL. While I like OL a lot, I am also 
 looking at other frameworks (Gmaps, Leaflet, Polymaps), and it would be wise 
 to decouple the backend from the front-end as much as possible.
 
 I have no issues with using WMS, but I just am unable to get MapServer WMS to 
 work via MapScript. And, yes, I do have to use MapScript if I can help it -- 
 my layer classification is generated on demand, and MapScript is the easiest 
 way I can think of for doing that.
 
 I did find yesterday that `mode=tile` works really well, but I am trying to 
 make that work with MapScript. A separate email thread for that question.
 
 
 
 
 
 David.
 
 -Original Message-
 From: mapserver-users-boun...@lists.osgeo.org 
 [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mr. Puneet 
 Kishor
 Sent: Thursday, September 08, 2011 9:32 PM
 To: Daniel Morissette
 Cc: mapserver-users@lists.osgeo.org
 Subject: Re: [mapserver-users] MapScript WMS request
 
 
 On Sep 8, 2011, at 8:28 PM, Daniel Morissette wrote:
 
 On 11-09-08 09:02 PM, Mr. Puneet Kishor wrote:
 
 On Sep 8, 2011, at 7:43 PM, Daniel Morissette wrote:
 
 Maybe call $map-save(/tmp/my.map) in your script after the map and 
 layer have been populated and paste the result... that may give us a 
 hint...
 
 
 wow! this is a super-awesome debugging technique. I have sent you the map 
 file off list to not pollute the entire list serve.
 
 
 I was able to reproduce the issue with the copy of the mapfile you sent 
 off-list.
 
 It turns out that mappostgis.c's msPostGISLayerGetExtent() is hardcoded to 
 always return
 
 {minx = -2500, miny =