[mapserver-users] Question on MapServer tutorials

2009-11-03 Thread graham_allan
Dear all,

 

I'm currently trying to follow the MapServer tutorials
http://mapserver.org/tutorial/example1-1.html#example1-1  by Pericles S.
Nacionales, I have successful downloaded and installed both the tutorial
data and MS4W http://maptools.org/ms4w/  distribution but when I try the
URL in the first example
http://mapserver.org/tutorial/example1-1.html#example1-1  I get the
following error:

 

msLoadMap(): Unable to access file.
(/ms4w/apps/tutorial/htdocs/example1-1.map) 

 

I'm running Windows Vista and have amended the example1-1.map file in
C:\ms4w\apps\tutorial\mapfiles as required.

 

If I amend the URL to: 

 

http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/mapfiles/exampl
e1-1.map
http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/mapfiles/examp
le1-1.maplayer=statesmode=map layer=statesmode=map

 

The map is displayed as shown in the tutorial, however, I'm not sure if the
problem is due to a configuration error on may part or whether the URL in
the tutorial is wrong (this seems unlikely).

 

Does anybody know which configuration files/options I need to amend?

 

 

 

 

Thanks

 

 

Graham

 



Crowder  Co Ltd, Registered Office: Post Office House, 99-105 Argyle Street, 
Birkenhead, Merseyside, CH41 6AD. 
Telephone: 0151 647 7772
Registered in England and Wales, No. 3003604. VAT No. GB618952020
This e-mail is confidential and intended solely for the use of the individual 
to whom it is addressed.  Any views or opinions presented are solely those of 
the author and do not necessarily represent those of Crowder  Co Ltd. If you 
are not the intended recipient of this e-mail you may not copy, use, forward or 
disclose its contents to any other person ; please delete the message and 
attachments from your system.

For more information visit our web site at http://www.crowderconsult.co.uk

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


Re: [mapserver-users] Question on MapServer tutorials

2009-11-03 Thread Alan Boudreault
Hi Graham,

The map parameter is always an absolute path to the mapfile. Not a relative or 
a web path (alias) neither. Currently, you are using a Unix system path. You 
should use the proper Windows path in the URL:

http://...?map=C:\ms4w\apps\tutorial\mapfiles\a_mapfile.mapotherOption=...

Alan

On November 3, 2009 06:47:54 am graham_allan wrote:
 Dear all,
 
 
 
 I'm currently trying to follow the MapServer tutorials
 http://mapserver.org/tutorial/example1-1.html#example1-1  by Pericles S.
 Nacionales, I have successful downloaded and installed both the tutorial
 data and MS4W http://maptools.org/ms4w/  distribution but when I try the
 URL in the first example
 http://mapserver.org/tutorial/example1-1.html#example1-1  I get the
 following error:
 
 
 
 msLoadMap(): Unable to access file.
 (/ms4w/apps/tutorial/htdocs/example1-1.map)
 
 
 
 I'm running Windows Vista and have amended the example1-1.map file in
 C:\ms4w\apps\tutorial\mapfiles as required.
 
 
 
 If I amend the URL to:
 
 
 
 http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/mapfiles/examp
 l e1-1.map
 http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/mapfiles/exam
 p le1-1.maplayer=statesmode=map layer=statesmode=map
 
 
 
 The map is displayed as shown in the tutorial, however, I'm not sure if the
 problem is due to a configuration error on may part or whether the URL in
 the tutorial is wrong (this seems unlikely).
 
 
 
 Does anybody know which configuration files/options I need to amend?
 
 
 
 
 
 
 
 
 
 Thanks
 
 
 
 
 
 Graham
 
 
 
 
 
 Crowder  Co Ltd, Registered Office: Post Office House, 99-105 Argyle
  Street, Birkenhead, Merseyside, CH41 6AD. Telephone: 0151 647 7772
 Registered in England and Wales, No. 3003604. VAT No. GB618952020
 This e-mail is confidential and intended solely for the use of the
  individual to whom it is addressed.  Any views or opinions presented are
  solely those of the author and do not necessarily represent those of
  Crowder  Co Ltd. If you are not the intended recipient of this e-mail you
  may not copy, use, forward or disclose its contents to any other person ;
  please delete the message and attachments from your system.
 
 For more information visit our web site at http://www.crowderconsult.co.uk
 

-- 
Alan Boudreault
Mapgears
http://www.mapgears.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] getFeatureinfourl phpmapscript

2009-11-03 Thread Thambirajah Sunthararajah
I am Sunthararajah

I am developing WebGIS APPLICATION MapServer ,phpmapscript and 
Postgresql/postgis


I am unable get feature information of feature. Any body provide working sample 
for me please-getFeatureinfoURL in phpmapscript


I want to submit this project to complete my M.Sc  please help me

Thanks
Sunthar


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


[mapserver-users] Starting with TIGER Line Data and MapServer

2009-11-03 Thread Monali Lodha
Hi,

We are working on displaying the TIGER Data using MapServer.
This is our first time with MapServer, and we would appreciate your
help in the following areas:
1. We could run the Itasca Demo Application. However, we could not
integrate our shapefiles with the sample Mapfile. We have read the
Mapfile documentation at the MapServer site. Any pointers on creating
Mapfile?

2. We have chosen a single state for our initial demo. However, the
number of shapefiles is almost 300. How should we incorporate all
these in the Mapfile?


Any suggestions are welcome.
Thanks.

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


Re: [mapserver-users] Starting with TIGER Line Data and MapServer

2009-11-03 Thread Stephen Woodbridge

Monali Lodha wrote:

Hi,

We are working on displaying the TIGER Data using MapServer.
This is our first time with MapServer, and we would appreciate your
help in the following areas:
1. We could run the Itasca Demo Application. However, we could not
integrate our shapefiles with the sample Mapfile. We have read the
Mapfile documentation at the MapServer site. Any pointers on creating
Mapfile?


IIRC, Itasca Demo data is in some State Plain projection and Tiger 
Shapefiles are in geographic (unprojected) state.



2. We have chosen a single state for our initial demo. However, the
number of shapefiles is almost 300. How should we incorporate all
these in the Mapfile?


Look at using TILEINDEX

http://mapserver.org/optimization/index.html#optimization


Any suggestions are welcome.
Thanks.

Monali
Monali
___
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


[mapserver-users] Tcl Mapscript

2009-11-03 Thread Thiago Tiedtke
Hi,

Could anyone tell me if it is possible to compile the mapserver (current
version) to support the tclmapscript?

The support for this interface is stoped? The last version supported (in
source tree mapscript/tc/README) is mapserver 3.5!

I need to use the mapserver interface+postgres/postgis BD in a Tcl/Tk UI.

Could anyone tell me some steps to generate the libraries (.dll for windows
and .so for linux).

Thanks on advance.

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


Re: [mapserver-users] Starting with TIGER Line Data and MapServer

2009-11-03 Thread Dan Little
A few questions for you.

Regarding #1
Were all of your shapes in the same projection as the Itasca demo? If not, 
their coordinates may have been far outside of the extents of the map.

Regarding #2
Do you have 300 shapefiles, meaning you have 300 layers you wish to display?  
If so, you might want to take a look at an alternate solution than the Itasca 
demo.  For example (toots own horn) GeoMOOSE is designed to allow multiple 
mapfiles to be used within a single application.   It makes the management of 
the large number of layers much more palatable.  We also have a number of users 
that are at the same level of layer management as you are and could give more 
suggestions on how to best manage that data for use in a Web GIS.


- Original Message 
 From: Monali Lodha monalilo...@gmail.com
 To: mapserver-users@lists.osgeo.org
 Sent: Tue, November 3, 2009 8:14:38 AM
 Subject: [mapserver-users] Starting with TIGER Line Data and MapServer
 
 Hi,
 
 We are working on displaying the TIGER Data using MapServer.
 This is our first time with MapServer, and we would appreciate your
 help in the following areas:
 1. We could run the Itasca Demo Application. However, we could not
 integrate our shapefiles with the sample Mapfile. We have read the
 Mapfile documentation at the MapServer site. Any pointers on creating
 Mapfile?
 
 2. We have chosen a single state for our initial demo. However, the
 number of shapefiles is almost 300. How should we incorporate all
 these in the Mapfile?
 
 
 Any suggestions are welcome.
 Thanks.
 
 Monali
 Monali
 ___
 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] Starting with TIGER Line Data and MapServer

2009-11-03 Thread Monali Lodha
Thanks Stephen and Dan!

@Stephen
The recent Tiger Shapefiles come with .prj files and do have a
projection. Could there be a different issue then?

@Dan
 Regarding #1
 Were all of your shapes in the same projection as the Itasca demo? If not, 
 their coordinates may have been far outside of the extents of the map.
Yes, we used the data for Itasca County.

 Regarding #2
 Do you have 300 shapefiles, meaning you have 300 layers you wish to display?  
 If so, you might want to take a look at an alternate solution than the Itasca 
 demo.  For example (toots own horn) GeoMOOSE is designed to allow multiple 
 mapfiles to be used within a single application.   It makes the management of 
 the large number of layers much more palatable.  We also have a number of 
 users that are at the same level of layer management as you are and could 
 give more suggestions on how to best manage that data for use in a Web GIS.

No. We have a few (10-15) layers. However, the shapefiles
corresponding to each layer are different for every county. I shall
also forward my query in the GeoMoose mailing list. Thanks!
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] Starting with TIGER Line Data and MapServer

2009-11-03 Thread Fawcett, David
Is the projection of the TIGER files and the output projection of the Itasca 
Demo the same?  I am guessing that Itasca uses UTM Zone 15N (EPSG 26915) and 
that the TIGER data might be in a geographic spatial reference system (EPSG 
3624?).  

If this is the case, you will need to define the input projection for your 
TIGER layers and make sure that you have an output projection set at the MAP 
level.  In other words, even if all of the data sets have specified 
projections, you will need to tell MapServer what the input projections for 
each layer are if you need MapServer to utilize layers with different spatial 
reference systems.

David. 

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Monali Lodha
Sent: Tuesday, November 03, 2009 9:45 AM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Starting with TIGER Line Data and MapServer

Thanks Stephen and Dan!

@Stephen
The recent Tiger Shapefiles come with .prj files and do have a
projection. Could there be a different issue then?

@Dan
 Regarding #1
 Were all of your shapes in the same projection as the Itasca demo? If not, 
 their coordinates may have been far outside of the extents of the map.
Yes, we used the data for Itasca County.

 Regarding #2
 Do you have 300 shapefiles, meaning you have 300 layers you wish to display?  
 If so, you might want to take a look at an alternate solution than the Itasca 
 demo.  For example (toots own horn) GeoMOOSE is designed to allow multiple 
 mapfiles to be used within a single application.   It makes the management of 
 the large number of layers much more palatable.  We also have a number of 
 users that are at the same level of layer management as you are and could 
 give more suggestions on how to best manage that data for use in a Web GIS.

No. We have a few (10-15) layers. However, the shapefiles
corresponding to each layer are different for every county. I shall
also forward my query in the GeoMoose mailing list. Thanks!
___
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] Designing a wrapper around mapserv which can be used with fcgi

2009-11-03 Thread Andy Colson

Andy Colson wrote:

Adrian Popa wrote:

Hello everyone,

I am currently using a wrapper around mapserv which receives the URL 
parameters, builds the map file (actually I only need to set some 
filters in the map file, but the filters need to be built after 
running some SQL queries with the passed in parameters). After the 
map file is built, mapserv is called (as a shell script), and the map 
gets sent to the user. Currently this wrapper is written in perl - so 
it's not terribly fast as a cgi process.


While this approach works, it is terribly inefficient. I would like 
to use mapserv as a fcgi process (or something faster than plain 
cgi). My question is - how can I /should I build a wrapper around 
mapserv that can customize the MAP file on the fly and run as a 
fcgi process?


Any ideas on where I should start? An example of such a wrapper?

Also, I suspect I can send parameters to mapserver and use some sort 
of variables in the map file to set up my filters - but I haven't 
seen an example. Can someone point me to such a documentation?


Thanks,
Adrian


Have you seen mapscript?  You can use mapserver directly from perl.  
And perl can do fast-cgi.  Here is a little, ad-hoc, non-tested, perl 
fcgi:



#!/usr/bin/perl

use strict;
use mapscript;
use FCGI;


my $request = FCGI::Request( );
while($request-Accept() = 0)
{
my($req, $x, $at, $xmap, $xpin, $sid, $y, $q);

$req = new mapscript::OWSRequest();
$req-loadParams();

$xmap = $req-getValueByName('map');
$xpin = $req-getValueByName('pin');

my $map = new mapscript::mapObj( /maps/$xmap.map );
if (! $map)
{
#print STDERR - Error loading map: $xmap.map\n;
print(Content-type: text/text\r\n\r\n);
print cant load $xmap.map;
$request-Finish();
next;
}

mapscript::msIO_installStdoutToBuffer();

$x = $map-OWSDispatch( $req );
if ($x)
{
print STDERR OWSDispatch: $x\n;
my $errObj = new mapscript::errorObj();
while ($errObj) {
print STDERR ERROR: 
$errObj-{code}:$errObj-{message}:$errObj-{routine} \n;

$errObj = $errObj-next();
}
}

my $content_type = 
mapscript::msIO_stripStdoutBufferContentType();


$x = mapscript::msIO_getStdoutBufferBytes();


print(Content-type: $content_type\r\n\r\n);
if (mapscript::msGetVersionInt() = 50500)
{
print $$x;
} else {
print $x;
}

mapscript::msIO_resetHandlers();
$request-Finish();
}



I'd recommend using mapserver 5.6.0.

-Andy





Adrian Popa wrote:
 Thank you,

 I will look into it. I guess through mapscript I can redefine the
 parameters that get sent to mapserver? Or do I rewrite the whole map?



You can load a map into memory (I assume you were already doing that). 
You said ..perl.. receives the URL parameters ...and... builds the map 
file.



I assume your perl does: use mapscript?

and at some point: my $map = new mapscript::mapObj( /maps/$xmap.map );

You kind of imbed mapserver into your perl script, and can call its 
functions and what not.  After you load the map you can do things to it, 
in memory.


In my example above, I'm using the WMS features ($map-OWSDispatch), but 
you can also generate an image:


my $img = $map-draw();
$img-save('x.jpg', $mapscript::MS_JPG);

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


Re: [mapserver-users] Starting with TIGER Line Data and MapServer

2009-11-03 Thread Stephen Woodbridge

Monali Lodha wrote:

Thanks Stephen and Dan!

@Stephen
The recent Tiger Shapefiles come with .prj files and do have a
projection. Could there be a different issue then?


Mapserver does NOT look at the *.prj file. You have to do that yourself 
and set the PROJECTION ... END blocks appropriately in mapserver.



@Dan

Regarding #1
Were all of your shapes in the same projection as the Itasca demo? If not, 
their coordinates may have been far outside of the extents of the map.

Yes, we used the data for Itasca County.


SO you need to set the PROJECTION block in the MAP section AND each 
LAYER needs to have a PROJECTION block. The one in the MAP section 
defines the output projection to use and the ones in the LAYER define 
what the source data's projection is (these can be determinged from the 
*.prj file).



Regarding #2
Do you have 300 shapefiles, meaning you have 300 layers you wish to display?  
If so, you might want to take a look at an alternate solution than the Itasca 
demo.  For example (toots own horn) GeoMOOSE is designed to allow multiple 
mapfiles to be used within a single application.   It makes the management of 
the large number of layers much more palatable.  We also have a number of users 
that are at the same level of layer management as you are and could give more 
suggestions on how to best manage that data for use in a Web GIS.


No. We have a few (10-15) layers. However, the shapefiles
corresponding to each layer are different for every county. I shall
also forward my query in the GeoMoose mailing list. Thanks!


Typically all county files for a given layer have identical structure in 
TIGER so you can group them together using a TILEINDEX in the mapfile.


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


[mapserver-users] uDig and MapServer WFS

2009-11-03 Thread graham_allan
Dear All,

 

I'm trying to use uDig in connection with MapServer's WFS capability.  I
have set up a .map file that contains all the information needed for a WFS
according to the instructions in the MapServer user guide
http://mapserver.org/ogc/wfs_server.html and can get the XML in response
to a get capabilities:

 

http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/labuan/mapfiles/labuan_w
fs.mapSERVICE=wfsVERSION=1.0.0REQUEST=GetCapabilities 

 

But if I open the service using uDig although I can select layers and they
apper in the layers view, no data is displayed and the table view contains 0
records and the layer count is 0.

 

If I use the same map file and open the layers as a WMS then I can see the
data

 

Does anybody have any suggestion regarding what I'm doing wrong?

 

 

Thanks

 

 

Graham

 

 

 

# objects.

MAP

  NAME   LABUAN_WFS

  STATUS ON

  IMAGETYPE  PNG

  EXTENT 607726.651900  578442.812605 630101.446005  597763.786700

  SIZE   800 600

  IMAGECOLOR 255 255 255

  

#  PROJECTION

#  proj=omerc

#  lat_0=4

#  lonc=115

#  alpha=53.3158204722

#  k=0.99984

#  x_0=590476.87

#  y_0=442857.65

#  ellps=evrstSS

#  units=m

#  no_defs

#  END



PROJECTION

init=epsg:29873

END

 



#

# Start of web interface definition

#

WEB

#

# On Windows systems, /tmp and /tmp/ms_tmp/ should be created at
the root 

# of the drive where the .MAP file resides.

#

  IMAGEPATH C:/ms4w/tmp/ms_tmp/ 

  IMAGEURL /ms_tmp/

  METADATA

wfs_title   Labuan_WMS

wfs_onlineresource
http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/ms4w/apps/labuan/mapfiles/labua
n_wfs.map

wfs_srs   EPSG:29873

wfs_schemas_location
http://schemas.opengeospatial.net;

  END

END

 

  # Layer objects are defined beneath the map object.  You need at least one

  # layer defined in your map file before you can display a map...  You can

  # define as many layers as you'd like although a limit is typically
hard-coded

  # in map.h in the MapServer source.  The default limit is set at 100.
You'd

  # have to have a very specialized application to need more than 100 layers
in

  # your application.

  # Start of LAYER DEFINITIONS -

LAYER

   NAME DMA

   METADATA

 wfs_titleDMA

 gml_include_items all

 gml_featureid OBJECTID

   END

   TYPE POLYGON

   CONNECTIONTYPE ogr

   CONNECTION C:\ms4w\apps\labuan\labuan.mdb

   DATA DMA

   STATUS ON

   DUMP TRUE

   CLASS

 NAME dma

 STYLE

   COLOR 255 204 255

   OUTLINECOLOR 153 000 153

 END

   END

END



LAYER

   NAME Pipeline

METADATA

 wfs_titlePipeline

 gml_include_items all

 gml_featureid OBJECTID

   END

   TYPE LINE

   CONNECTIONTYPE ogr

   CONNECTION C:\ms4w\apps\labuan\labuan.mdb

   DATA Pipeline

   STATUS ON

   PROJECTION

 init=epsg:42304

   END

 

   DUMP TRUE

   CLASS

 NAME Pipeline

 STYLE

   COLOR 051 153 255

 END

   END

END



LAYER

   NAME Meter

METADATA

 wfs_titleMeter

 gml_include_items all

 gml_featureid OBJECTID

   END

   TYPE POINT

   CONNECTIONTYPE ogr

   CONNECTION C:\ms4w\apps\labuan\labuan.mdb

   DATA Meter

   STATUS ON

   DUMP TRUE

   CLASS

 NAME Meter

 STYLE

   COLOR 051 000 153

 END

 SIZE 10

   END

END



LAYER

   NAME DMA

   TYPE LINE

   CONNECTIONTYPE ogr

   CONNECTION C:\ms4w\apps\labuan\labuan.mdb

   DATA DMA

   STATUS OFF

   CLASS


Re: [mapserver-users] uDig and MapServer WFS

2009-11-03 Thread Barend Köbben
Hi,

I have found that a uDig/Mapserver combination is especially picky on data
that has no clear extent. Try explicitely mentioning the extent, by
including 
ows_extent xmin ymin xmax ymax
or 
wfs_extent xmin ymin xmax ymax
in the METADATA section of each LAYER definition

Hope this helps,

-- 
Barend Köbben
International Institute for Geo-Information
Sciences and Earth Observation (ITC)
PO Box 6, 7500AA Enschede, The Netherlands
+31 (0)53 4874253


On 03-11-09 18:36, graham_allan graham.al...@crowderconsult.co.uk wrote:

 Dear All,
  
 I¹m trying to use uDig in connection with MapServer¹s WFS capability.  I have
 set up a .map file that contains all the information needed for a WFS
 according to the instructions in the MapServer user guide
 http://mapserver.org/ogc/wfs_server.html and can get the XML in response to
 a get capabilities:
  
 http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/labuan/mapfiles/labuan_wfs
 .mapSERVICE=wfsVERSION=1.0.0REQUEST=GetCapabilities
  
 But if I open the service using uDig although I can select layers and they
 apper in the layers view, no data is displayed and the table view contains 0
 records and the layer count is 0.
  
 If I use the same map file and open the layers as a WMS then I can see the
 data
  
 Does anybody have any suggestion regarding what I¹m doing wrong?
  
  
 Thanks
  
  
 Graham
  
  
  
 # objects.
 MAP
  NAME   LABUAN_WFS
  STATUS ON
   IMAGETYPE  PNG
  EXTENT 607726.651900 578442.812605 630101.446005  597763.786700
  SIZE   800 600
   IMAGECOLOR 255 255 255
   
 #  PROJECTION
 #  proj=omerc
 #  lat_0=4
 #  lonc=115
 #  alpha=53.3158204722
 #  k=0.99984
 #  x_0=590476.87
 #  y_0=442857.65
 #  ellps=evrstSS
 #  units=m
 #  no_defs
 #  END
 
 PROJECTION
 init=epsg:29873
 END
  
 
 #
 # Start of web interface definition
 #
 WEB
 #
 # On Windows systems, /tmp and /tmp/ms_tmp/ should be created at
 the root 
 # of the drive where the .MAP file resides.
 #
  IMAGEPATH C:/ms4w/tmp/ms_tmp/
  IMAGEURL /ms_tmp/
  METADATA
 wfs_title  Labuan_WMS
 wfs_onlineresource
 http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/ms4w/apps/labuan/mapfiles/labuan_
 wfs.map
 wfs_srs  EPSG:29873
 wfs_schemas_location
 http://schemas.opengeospatial.net;
  END
 END
  
   # Layer objects are defined beneath the map object.  You need at least one
   # layer defined in your map file before you can display a map...  You can
   # define as many layers as you'd like although a limit is typically
 hard-coded
   # in map.h in the MapServer source.  The default limit is set at 100.  You'd
   # have to have a very specialized application to need more than 100 layers
 in
   # your application.
   # Start of LAYER DEFINITIONS -
 LAYER
   NAME DMA
   METADATA
 wfs_titleDMA
 gml_include_items all
 gml_featureid OBJECTID
END
   TYPE POLYGON
   CONNECTIONTYPE ogr
   CONNECTION C:\ms4w\apps\labuan\labuan.mdb
   DATA DMA
   STATUS ON
   DUMP TRUE
   CLASS
  NAME dma
  STYLE
   COLOR 255 204 255
   OUTLINECOLOR 153 000 153
  END
   END
 END
 
 LAYER
   NAME Pipeline
METADATA
 wfs_titlePipeline
 gml_include_items all
 gml_featureid OBJECTID
END
   TYPE LINE
   CONNECTIONTYPE ogr
   CONNECTION C:\ms4w\apps\labuan\labuan.mdb
   DATA Pipeline
   STATUS ON
   PROJECTION
 init=epsg:42304
   END
  
   DUMP TRUE
   CLASS
  NAME Pipeline
  STYLE
   COLOR 051 153 255
  END
   END
 END
 
 LAYER
   NAME Meter
METADATA
 wfs_titleMeter
 gml_include_items all
 gml_featureid OBJECTID
END
   TYPE POINT
   CONNECTIONTYPE ogr
   CONNECTION C:\ms4w\apps\labuan\labuan.mdb
   DATA Meter
   STATUS ON
   DUMP TRUE
 

Re: [mapserver-users] Question on MapServer tutorials

2009-11-03 Thread Alan Boudreault
Graham,

After verification, it seems that apache is able to handle path like 
/ms4w/dir1 without the C:/. It is supposed to assume that the hard drive 
asked is the same that the web server is running.

Alan

On November 3, 2009 07:04:54 am Alan Boudreault wrote:
 Hi Graham,
 
 The map parameter is always an absolute path to the mapfile. Not a relative
  or a web path (alias) neither. Currently, you are using a Unix system
  path. You should use the proper Windows path in the URL:
 
 http://...?map=C:\ms4w\apps\tutorial\mapfiles\a_mapfile.mapotherOption=...
 
 Alan
 
 On November 3, 2009 06:47:54 am graham_allan wrote:
  Dear all,
 
 
 
  I'm currently trying to follow the MapServer tutorials
  http://mapserver.org/tutorial/example1-1.html#example1-1  by Pericles
  S. Nacionales, I have successful downloaded and installed both the
  tutorial data and MS4W http://maptools.org/ms4w/  distribution but when
  I try the URL in the first example
  http://mapserver.org/tutorial/example1-1.html#example1-1  I get the
  following error:
 
 
 
  msLoadMap(): Unable to access file.
  (/ms4w/apps/tutorial/htdocs/example1-1.map)
 
 
 
  I'm running Windows Vista and have amended the example1-1.map file in
  C:\ms4w\apps\tutorial\mapfiles as required.
 
 
 
  If I amend the URL to:
 
 
 
  http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/mapfiles/exa
 mp l e1-1.map
  http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/mapfiles/ex
 am p le1-1.maplayer=statesmode=map layer=statesmode=map
 
 
 
  The map is displayed as shown in the tutorial, however, I'm not sure if
  the problem is due to a configuration error on may part or whether the
  URL in the tutorial is wrong (this seems unlikely).
 
 
 
  Does anybody know which configuration files/options I need to amend?
 
 
 
 
 
 
 
 
 
  Thanks
 
 
 
 
 
  Graham
 
 
 
 
 
  Crowder  Co Ltd, Registered Office: Post Office House, 99-105 Argyle
   Street, Birkenhead, Merseyside, CH41 6AD. Telephone: 0151 647 7772
  Registered in England and Wales, No. 3003604. VAT No. GB618952020
  This e-mail is confidential and intended solely for the use of the
   individual to whom it is addressed.  Any views or opinions presented are
   solely those of the author and do not necessarily represent those of
   Crowder  Co Ltd. If you are not the intended recipient of this e-mail
  you may not copy, use, forward or disclose its contents to any other
  person ; please delete the message and attachments from your system.
 
  For more information visit our web site at
  http://www.crowderconsult.co.uk
 

-- 
Alan Boudreault
Mapgears
http://www.mapgears.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Help with NQuery error (CGI)

2009-11-03 Thread Paul james
Thanks Steve...
Trying execute a query point like that:
http://localhost/cgi-bin-last/mapserv.exe?map=C:/map.mapmode=queryLAYERS=UFmapext=-56.798017578125+-14.26017890625+-56.578291015625+-14.04045234375imgext=-56.798017578125+-14.26017890625+-56.578291015625+-14.04045234375map_size=1217+680imgxy=1217+680img.x=608.5img.y=340

 generated that error :

msMSSQL2008LayerGetShape(): Query error. Error executing MSSQL2008 SQL
statement: SELECT convert(varchar(max), oid),convert(varchar(max),
codigouf),convert(varchar(max), codigoregiao),convert(varchar(max),
nomeuf),convert(varchar(max),
siglauf),the_geom.STAsBinary(),convert(varchar(20), oid) from viwgeo_uf
WHERE
the_geom.STIntersects(Geometry::STGeomFromText('POLYGON((-56.6879924952826
-14.1504774265924,-56.6879924952826 -14.1504774265924,-56.6879924952826
-14.1504774265924,-56.6879924952826 -14.1504774265924,-56.6879924952826
-14.1504774265924))',0)) = 1

System.FormatException: 24305: The Polygon input is not valid because the
ring does not have enough distinct points. Each ring of a polygon must
contain at least three distinct points. System.FormatException: at
Microsoft.SqlServer.Types.Validator.Execute(Transition transition) at
Microsoft.SqlServer.Types.Validator.EndFigure() at
Microsoft.SqlServer.Types.ForwardingGeoDataSink.EndFigure() at
Microsoft.SqlServer.Types.OpenGisWktReader.ParseLineStringText() at
Microsoft.SqlServer.Types.OpenGisWktReader.ParsePolygonText() at
Microsoft.SqlServer.Types.OpenGisWktReader.ParseTaggedText(OpenGisType type)
at Microsoft.SqlServer.Types.OpenGisWktReader.Read(OpenGisType type, Int32
srid) at Microsoft.SqlServer.Types.SqlGeometry.GeometryFromText(OpenGisType
type, SqlChars text, Int32 srid) at
Microsoft.SqlServer.Types.SqlGeometry.STGeom


Paul


On Fri, Oct 30, 2009 at 2:48 PM, Steve Lime steve.l...@dnr.state.mn.uswrote:

 Probably. Does a point query work? I reassigned the ticket to the keeper
 of the SQLServer
 driver in hopes that it gets attention.

 Curiously, have you tried 5.6 at all with SQLServer?

 Steve

  On 10/30/2009 at 12:22 PM, in message
 33fad6880910301022s40c76f88ha011362964e21...@mail.gmail.com, Paul
  james
 paulj...@gmail.com wrote:
  I think so...
  Is it related with that ticket?
  http://trac.osgeo.org/mapserver/ticket/3058
 
  Paul
 
  On Fri, Oct 30, 2009 at 1:53 PM, Steve Lime
 steve.l...@dnr.state.mn.uswrote:
 
  Odd. Unfortunately I can't debug anything related to MSSQL2008,
 perhaps
  the driver isn't
  supporting functions necessary to complete a query?
 
  Steve
 
   On 10/30/2009 at 6:33 AM, in message
  33fad6880910300433i342c619am99935a6078966...@mail.gmail.com, Paul
   james
  paulj...@gmail.com wrote:
   Hey Steve...
  
   Yes I had...
   QUERYMAP
COLOR 255 0 0
SIZE -1 -1
STATUS ON
STYLE hilite
   END
  
   With Status OFF I got that :
   Content-type: text/html
  
   Using MSSQL2008
  
   Paul
  
  
   On Thu, Oct 29, 2009 at 6:13 PM, Steve Lime
  steve.l...@dnr.state.mn.uswrote:
  
   Do you have a querymap object configured with status on? I would
  guess
   so in order to see that
   error. What happens if you set STATUS OFF in the querymap?
  
On 10/29/2009 at 7:57 AM, in message
   33fad6880910290557m71ee3fdatd470590e3256f...@mail.gmail.com,
 Paul
   james
   paulj...@gmail.com wrote:
 Hello guys...
Ím got this error when trying to execute a Nquery :
   
  
  
  
 
 
 

 http://localhost/cgi-bin-54/mapserv.exe?map=Map.mapmode=nqueryLAYERS=TESTmape

 
 
   x
  
   
  
  
  
 
 
 

 t=-58.358076171875+-11.42570625+-57.193525390625+-10.37101875imgext=-58.35807
 
   61718
   
  
  
  
 
 
 

 75+-11.42570625+-57.193525390625+-10.37101875map_size=1221+762imgxy=1221+762i
 
   mgb
ox=0+0+1221+762
   
msDrawMap(): Image handling error. Failed to draw layer named
   'TEST'.
   
But, If I execute the same url with mode=map, the image is
   generated
fine... What this error means?
   
   
TEST Layer
   
 LAYER
  NAME TEST
  GROUP TE
  TYPE polygon
  STATUS ON
  CONNECTIONTYPE PLUGIN
  PLUGIN msplugin_mssql2008.dll
  CONNECTION server=X;Integrated
   Security=false;database=X;uid=X;pwd=X
  DATA the_geom from viw USING UNIQUE oid USING SRID=0
  CLASS
   TEMPLATE template.html
   NAME X
   STYLE
OUTLINECOLOR 150 150 150
WIDTH 1
   END
  END
 END
   
Thanks
   
Paul
  
 

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


AW: [mapserver-users] Query feature using openlayers and mapserver

2009-11-03 Thread Arnd Wippermann
Hi,

Look for the visibility of your querylayer and decide what to do

map.events.register('click', map, function (e) 
{
var flag=map.getLayersBy(name, querylayer)[0].visibility;

if(flag)
{
var url = http://localhost/cgi-bin/mapserv.exe;
  + ?map=map/file/directory.map 
  + REQUEST=GetFeatureInfo
  + VERSION=1.1.1
  + EXCEPTIONS=application/vnd.ogc.se_xml
  + BBOX= 
  + map.getExtent().toBBOX()
  + X= + e.xy.x
  + Y= + e.xy.y
  + INFO_FORMAT=text/html
  + QUERY_LAYERS=querylayer
  + LAYERS=querylayer
  + FEATURE_COUNT=1
  + SRS=EPSG:4269
  + STYLES=
  + WIDTH= + map.size.w
  + HEIGHT= + map.size.h;
window.open(url, getfeatureinfo,
location=0,status=0,scrollbars=1,width=600,height=400);
}
}); 

Regards,
Arnd

-Ursprüngliche Nachricht-
Von: mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] Im Auftrag von Aypes
Gesendet: Dienstag, 3. November 2009 02:50
An: mapserver-users@lists.osgeo.org
Betreff: Re: [mapserver-users] Query feature using openlayers and mapserver


I have solved the problem. There is the function code in my html:
 map.events.register('click', map, function (e) {
var url = http://localhost/cgi-bin/mapserv.exe;
  + ?map=map/file/directory.map 
  + REQUEST=GetFeatureInfo
  + VERSION=1.1.1
  + EXCEPTIONS=application/vnd.ogc.se_xml
  + BBOX= 
  + map.getExtent().toBBOX()
  + X= + e.xy.x
  + Y= + e.xy.y
  + INFO_FORMAT=text/html
  + QUERY_LAYERS=querylayer
  + LAYERS=querylayer
  + FEATURE_COUNT=1
  + SRS=EPSG:4269
  + STYLES=
  + WIDTH= + map.size.w
  + HEIGHT= + map.size.h;
window.open(url,
  getfeatureinfo,
  location=0,status=0,scrollbars=1,width=600,height=400
);

But if I turn off the layer, I click on the map, a new window still come
out. That is not the problem. The problem is the turned off layer can still
be queried. I want that the turned off layer is not queryable. 
New window can still come out without any information. Please give me a
hand.


Thanks,
Aypes
--
View this message in context:
http://n2.nabble.com/Query-feature-using-openlayers-and-mapserver-tp3910093p
3936077.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
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: AW: [mapserver-users] Query feature using openlayers and mapserver

2009-11-03 Thread Aypes



Arnd Wippermann wrote:
 
 Hi,
 
 Look for the visibility of your querylayer and decide what to do
 
 map.events.register('click', map, function (e) 
 {
 var flag=map.getLayersBy(name, querylayer)[0].visibility;
 
 if(flag)
 {
 var url = http://localhost/cgi-bin/mapserv.exe;
   + ?map=map/file/directory.map 
   + REQUEST=GetFeatureInfo
   + VERSION=1.1.1
   + EXCEPTIONS=application/vnd.ogc.se_xml
   + BBOX= 
   + map.getExtent().toBBOX()
   + X= + e.xy.x
   + Y= + e.xy.y
   + INFO_FORMAT=text/html
   + QUERY_LAYERS=querylayer
   + LAYERS=querylayer
   + FEATURE_COUNT=1
   + SRS=EPSG:4269
   + STYLES=
   + WIDTH= + map.size.w
   + HEIGHT= + map.size.h;
 window.open(url, getfeatureinfo,
 location=0,status=0,scrollbars=1,width=600,height=400);
 }
 }); 
 
 Regards,
 Arnd
 
 -Ursprüngliche Nachricht-
 Von: mapserver-users-boun...@lists.osgeo.org
 [mailto:mapserver-users-boun...@lists.osgeo.org] Im Auftrag von Aypes
 Gesendet: Dienstag, 3. November 2009 02:50
 An: mapserver-users@lists.osgeo.org
 
 
Arnd Wippermann,

Thanks for your answer. I get your idea, but it does not work.
It said map.getLayersBy(...) is null or not an object.
I want to ask in [map.getLayersBy(name, querylayer)[0].visibility], what
is the name?
If I create a layer like that:
var ABC_layer = new OpenLayers.Layer.MapServer( ABC WMS,  
http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/Apache/htdocs/map.map;,
{layers: 'ABC'} );
The name is ABC WMS, ABC or ABC_layer?

Actually I have written in this way:
.function (e) {
if (ABC_layer.visibility == true) { 
var url.
It works but this part of codes only for one layer only. If there are many
layers, the html file would be looked clumsy.


Thanks,
Aypes
-- 
View this message in context: 
http://n2.nabble.com/Query-feature-using-openlayers-and-mapserver-tp3910093p3943083.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Designing a wrapper around mapserv which can be used with fcgi

2009-11-03 Thread Adrian Popa

Thank you Andy for explaining.

Actually my wrapper is very hard-core, meaning I don't use mapscript 
(because I had to build it quickly and didn't have time to research 
which was the best approach). Now I have more time and I'd like to tune 
things up, so I will definitely start studying mapscript (If you have a 
link to a good tutorial/function reference for it I am in your debt).


My wrapper just copied over a template map file, edited it (rewrites 
some filters) and then it set

$ENV{'QUERY_STRING'} = $ENV{'QUERY_STRING'}.map=$file;

...and then called

print `/var/www/cgi-bin/mapserv`;


It's barbaric, I know, but it worked for me. :)
It will take a bit of rewrite to add fcgi support and mapscript, but in 
the long run it will be more mantainable... :)


Thanks again,
Adrian

Andy Colson wrote:

Andy Colson wrote:

Adrian Popa wrote:

Hello everyone,

I am currently using a wrapper around mapserv which receives the 
URL parameters, builds the map file (actually I only need to set 
some filters in the map file, but the filters need to be built 
after running some SQL queries with the passed in parameters). 
After the map file is built, mapserv is called (as a shell script), 
and the map gets sent to the user. Currently this wrapper is 
written in perl - so it's not terribly fast as a cgi process.


While this approach works, it is terribly inefficient. I would like 
to use mapserv as a fcgi process (or something faster than plain 
cgi). My question is - how can I /should I build a wrapper around 
mapserv that can customize the MAP file on the fly and run as a 
fcgi process?


Any ideas on where I should start? An example of such a wrapper?

Also, I suspect I can send parameters to mapserver and use some 
sort of variables in the map file to set up my filters - but I 
haven't seen an example. Can someone point me to such a documentation?


Thanks,
Adrian


Have you seen mapscript?  You can use mapserver directly from perl.  
And perl can do fast-cgi.  Here is a little, ad-hoc, non-tested, 
perl fcgi:



#!/usr/bin/perl

use strict;
use mapscript;
use FCGI;


my $request = FCGI::Request( );
while($request-Accept() = 0)
{
my($req, $x, $at, $xmap, $xpin, $sid, $y, $q);

$req = new mapscript::OWSRequest();
$req-loadParams();

$xmap = $req-getValueByName('map');
$xpin = $req-getValueByName('pin');

my $map = new mapscript::mapObj( /maps/$xmap.map );
if (! $map)
{
#print STDERR - Error loading map: $xmap.map\n;
print(Content-type: text/text\r\n\r\n);
print cant load $xmap.map;
$request-Finish();
next;
}

mapscript::msIO_installStdoutToBuffer();

$x = $map-OWSDispatch( $req );
if ($x)
{
print STDERR OWSDispatch: $x\n;
my $errObj = new mapscript::errorObj();
while ($errObj) {
print STDERR ERROR: 
$errObj-{code}:$errObj-{message}:$errObj-{routine} \n;

$errObj = $errObj-next();
}
}

my $content_type = 
mapscript::msIO_stripStdoutBufferContentType();


$x = mapscript::msIO_getStdoutBufferBytes();


print(Content-type: $content_type\r\n\r\n);
if (mapscript::msGetVersionInt() = 50500)
{
print $$x;
} else {
print $x;
}

mapscript::msIO_resetHandlers();
$request-Finish();
}



I'd recommend using mapserver 5.6.0.

-Andy





Adrian Popa wrote:
 Thank you,

 I will look into it. I guess through mapscript I can redefine the
 parameters that get sent to mapserver? Or do I rewrite the whole map?



You can load a map into memory (I assume you were already doing that). 
You said ..perl.. receives the URL parameters ...and... builds the 
map file.



I assume your perl does: use mapscript?

and at some point: my $map = new mapscript::mapObj( /maps/$xmap.map );

You kind of imbed mapserver into your perl script, and can call its 
functions and what not.  After you load the map you can do things to 
it, in memory.


In my example above, I'm using the WMS features ($map-OWSDispatch), 
but you can also generate an image:


my $img = $map-draw();
$img-save('x.jpg', $mapscript::MS_JPG);

-Andy




--
--- 
Adrian Popa

NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP  Metro
Compartiment IP Core  Backbone
Phone: +40 21 400 3099

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