Re: [mapserver-users] will Mapserver ever support SLD inside Mapfile?

2012-06-23 Thread Mike Saunt
Would it be difficult to be able to reference sld's locally too via
external files path? currently I think they have to be url based
On Jun 22, 2012 7:50 PM, Jeff McKenna jmcke...@gatewaygeomatics.com
wrote:

 Giovanni,

 I agree inline SLD would be very powerful for MapServer, and now that
 QGIS can import/export SLDs, it would be a great way to share styles
 between different projects.

 Like Steve said, I feel it just needs a champion - someone who really
 wants it to happen in MapServer, and that person doesn't need to be a
 coder/developer at all.

 -jeff




 --
 Jeff McKenna
 MapServer Consulting and Training Services
 http://www.gatewaygeomatics.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: [mapserver-users] Strange coordinates used in GetFeatureInfo request

2012-06-23 Thread Daniel Morissette
I didn't read your whole mail, but short answer is that I suspect you 
are overlooking the fact that in GetFeatureInfo, the X and Y coordinates 
are in pixels within the view of the map (which is 500x500 pixels in 
your example).


So when you write x=0y=0 that refers to the top-left corner of the map 
view, and not the 0,0 of the SRS coordinate system... which corresponds 
to longitude=-10, and latitude=+10. Actually, the x,y value is 
translated to be the center of the top-left pixel (and not its top-left 
boundary), which explains why you get lon,lat=9.98,9.98 in the query.


Daniel

On 12-06-22 5:40 PM, Anzel, Phil - NRCS, Fort Collins, CO wrote:

All,

Does GetFeatureInfo have a coordinate translation problem?

Consider the WMS request shown here (ignore line wrapping):
   http://localhost/mapserver/mapserv.exe
 ?map=m01.map
 SERVICE=WMS
 VERSION=1.1.1
 REQUEST=GetFeatureInfo
 LAYERS=External
 QUERY_LAYERS=External
 INFO_FORMAT=text/plain
 x=0.0y=0.0
 SRS=EPSG:4326
 BBOX=-10,-10,10,10
 width=500height=500

In the mapfile below, all coordinate system references are to 4326. Forcing 
an error in the DATA statement makes me think the (0,0) coordinate pair is mistranslated, 
as shown by the message below which includes:
   shape_BOGUS.STIntersects(
geometry::STGeomFromText('POINT(-9.98 9.98)',4326)) = 1

Is there a problem with my request or with my mapfile?

Following is the mapfile and some experiments that I performed. I'm using 
MapServer 6.1-DEV with Sql Server 2008 under Windows XP.

The relevant mapfile is defined as:

map
   name m01
   status on
   size 500 500
   extent -20 -20 20 20
   units dd
   imagecolor 255 255 255
   projection init=epsg:4326 end

   web
 imagepath c:\ms4w\tmp\ms_tmp
 imageurl /ms_tmp/
 metadata
   wms_title test-title
   wms_extent-180 -90 180 90
   wms_srs   EPSG:4326
   ows_enable_requestGetCapabilities GetMap GetFeature 
GetFeatureInfo
 end
   end
   layer
 name External
 type polygon
 status on
 metadata
   wms_title External
   wms_extent-180 -90 180 90
   wms_srs   EPSG:4326
   ows_include_items all
   wms_include_items all
   gml_include_items all
   gml_geometriesmultiPolygon
   gml_multiPolygon_type multipolygon
 end
 dump true
 header C:\ms4w\Apache\cgi-bin\m01_header.htm
 template C:\ms4w\Apache\cgi-bin\m01_template.html
 footer C:\ms4w\Apache\cgi-bin\m01_footer.html
 projection init=epsg:4326 end
 units dd
 # ExternalData table created and populated in Sql Server 2008 with:
 # create table ExternalData
 #   (ID varchar(10) primary key, shape Geometry not null);
 # insert into ExternalData (id, shape) values ('x102',
 #   geometry::STGeomFromText('polygon((-20 -20,-20 20,20 20,20 -20,-20 
-20))', 4326))
 connection server=...;database=test;uid=...;pwd=...
 connectiontype plugin
 plugin C:/ms4w/Apache/specialplugins/msplugin_mssql2008.dll
 data shape from dbo.ExternalData using unique ID using srid=4326
 labelitem ID
 class
   name ExternalClass
   style color 255 0 0 outlinecolor 0 255 0 end
   label position auto size small color 0 0 0 end
 end
   end
end

Note that the WMS request, the MAP and the LAYER are all defined with the 
4326 projection.

If I change the DATA statement to force an error,
 data shape_BOGUS from dbo.ExternalData using unique ID using srid=4326
the error returned shows:
   msMSSQL2008LayerGetShape(): Query error.
   Error executing MSSQL2008 SQL statement:
 SELECT
convert(varchar(max), id),
shape_BOGUS.STAsBinary(),
convert(varchar(36), ID)
 from dbo.ExternalData
 WHERE shape_BOGUS.STIntersects(
geometry::STGeomFromText('POINT(-9.98 9.98)',4326)) = 1

Please note that the POINT location should be (0,0). Why isn't it?

A similar problem occurs if the feature is defined inline as described below.

Some additional details:

1. If I remove the _BOGUS, a result is returned. Therefore I believe that the 
mapfile is well-formed.

2. With _BOGUS removed, and the polygon redefined in the database as 
POLYGON((-5 -5,-5 5,5 5,5 -5,-5 -5)), no result is returned. Therefore I believe that the 
bad coordinates in the query are being used.

3. If I define and use an Internal layer:
   layer
 name Internal
 type polygon
 status on
 metadata
   wms_title Internal
   wms_extent-180 -90 180 90
   wms_srs   EPSG:4326
   ows_include_items all
   wms_include_items all
   gml_include_items all
   gml_geometriesmultiPolygon
   gml_multiPolygon_type multipolygon
 end
 dump true
 header C:\ms4w\Apache\cgi-bin\m01_header.htm
 template 

Re: [mapserver-users] Strange coordinates used in GetFeatureInfo request

2012-06-23 Thread Daniel Morissette

On 12-06-23 11:00 AM, Daniel Morissette wrote:

I didn't read your whole mail, but short answer is that I suspect you
are overlooking the fact that in GetFeatureInfo, the X and Y coordinates
are in pixels within the view of the map (which is 500x500 pixels in
your example).

So when you write x=0y=0 that refers to the top-left corner of the map
view, and not the 0,0 of the SRS coordinate system... which corresponds
to longitude=-10, and latitude=+10. Actually, the x,y value is
translated to be the center of the top-left pixel (and not its top-left
boundary), which explains why you get lon,lat=9.98,9.98 in the query.




Please let me reword this last paragraph to make it a little more clear:

When you write X=0Y=0 in your GetFeatureInfo request that refers to the 
top-left corner of the map view which is located at longitude=-10, and 
latitude=+10, and not to the 0.0,0.0 of the SRS=EPSG:4326 coordinate 
system. Actually, the X,Y value is translated to be the center of the 
top-left pixel (and not its top-left boundary), which explains why you 
get lon,lat=-9.98,9.98 in the query.



--
Daniel Morissette
http://www.mapgears.com/
Provider of Professional MapServer Support since 2000



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


Re: [mapserver-users] Map Border

2012-06-23 Thread Brent Fraser

Matt,

  Personally, I think if you are using WMS protocol the generation of 
printed map should be responsibility of the WMS client, not the server 
(this would include page layout components of border, graticule, north 
arrow, key map, titles,  etc).


  That being said, I don't know of an Open Source desktop WMS client 
that is capable of rendering a good graticule, but I haven't checked 
lately (you could check Quantum GIS, gvSIG, and uDig).  GeoMoose 
(http://www.geomoose.org/), a web-mapping solution, does map composing 
and printing using PHP and MapScript, but no graticule support.  
Mapfish, another web mapping solution, has some nice printing support, 
but I don't know if it does a graticule.


  As for plain-old Mapserver, here's a link to an old discussion with a 
couple of tricks: 
http://www.mail-archive.com/mapserver-users@lists.osgeo.org/msg04550.html


Best Regards,
Brent Fraser

On 6/22/2012 8:16 PM, Matt McClelland wrote:

Hi All

I am wanting to output a map for printing, via WMS.
Is there are way to put a 'border' on the map like in this example
http://www.ghosttowns.com/Images/utm.jpg
With the Graticule values in the margins?

If not, does anyone have an example going it with php mapscript, that 
they are happy to share??


THanks

Matt  :)



___
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