[mapserver-users] How to filter ArcGIS WFS service?

2010-04-01 Thread Miloslav Kmeť
Hello.

I need to find a solution how to filter ArcGIS wfs service in mapserver WFS 
client. I read this document: http://mapserver.org/ogc/filter_encoding.html and 
there is no topic about xml ns prefixes in filter.

It seems, that esri's wfs services need xml namespace ogc: in every filter 
element.

I tried id with get from browser and this works as expected:
ogc:Filterogc:PropertyIsEqualToogc:PropertyNameeia_eia:IDAKCIA/ogc:PropertyNameogc:Literal1833/ogc:Literal/ogc:PropertyIsEqualTo/ogc:Filter
?service=wfsversion=1.1.0request=getFeaturetypename=eia_eia:EIA_Localityfilter=%3Cogc:Filter%3E%3Cogc:PropertyIsEqualTo%3E%3Cogc:PropertyName%3Eeia_eia:IDAKCIA%3C/ogc:PropertyName%3E%3Cogc:Literal%3E1833%3C/ogc:Literal%3E%3C/ogc:PropertyIsEqualTo%3E%3C/ogc:Filter%3E
(tinyurlized: http://tinyurl.com/yanqfry)

But this won't filter anything and gives me all features:
FilterPropertyIsEqualToPropertyNameeia_eia:IDAKCIA/PropertyNameLiteral1833/Literal/PropertyIsEqualTo/Filter
?service=wfsversion=1.1.0request=getFeaturetypename=eia_eia:EIA_Localityfilter=%3CFilter%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Eeia_eia:IDAKCIA%3C/PropertyName%3E%3CLiteral%3E1833%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E
(tinyurlized: http://tinyurl.com/y9t3rld)

I doubt, that I can get some response from Esri on this topic, because of this 
thread: http://forums.esri.com/Thread.asp?c=158f=2276t=273488 where folks

So the question is - how to add the ogc: namespace prefix into wfs_filter?

This is how I have configured the WFS in my mapfile:
CONNECTIONTYPE WFS
CONNECTION 
http://globus.sazp.sk/arcgis/services/eia/eia/mapserver/wfsserver;

METADATA
  wfs_version 1.0.0
  wfs_service WFS
  wfs_request_method GET
  wfs_srs EPSG:4326
  wfs_typename eia_eia:EIA_locality
  wfs_filter 
PropertyIsEqualToPropertyNameeia_eia:IDAKCIA/PropertyNameLiteral1833/Literal/PropertyIsEqualTo
  wfs_maxfeatures 1000
END

Thank you.

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


[mapserver-users] getFeatures of the clicked shape

2010-04-01 Thread Medve Zsolt

Hy !

I have a problem with getting an ID of a shape
This is the code i use:

$layer = $map-getLayerByName('sde1','sde2','sde3','sde4');
if ($layer-getNumResults() == 1) {
$res = $layer-getResult(0);
$layer-open();
$shape = $layer-getFeature($res-shapeindex, $res-tileindex);
$id = $shape-ID;
$layer-close();
}

I,think it puts the ID's of all of the shapes what the spaefile contain. 
Am i think right?


How can i put only the clicked shape's ID to the $id variable?

I am able to get the clicked X and Y coords from a Js code, it is 
usefull to get the ID of the clicked shape?


Thanks a lot for the answers,
Zsolt



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


Re: [mapserver-users] Same name for GROUP and layer NAME ?

2010-04-01 Thread Ivan Mincik
On Thursday 01 April 2010, you wrote:
 I dont see any trouble on it. They are separate attributes.

Yes, they are separate attributes in mapfile, but in WMS URL, we can use layer 
NAME or GROUP in LAYERS= parameter as 
value with the same meaning.  
Also in GetCapabilities XML there is Namemylay/Name nested in another 
Namemylay/Name, so I am not sure if this is valid.

I don't see any error, but something in my mind tells me, that it is not the 
best idea. But, in fact I need this 
behavior to solve some specific task.


Ivan


 2010/4/1 Ivan Mincik ivan.min...@gista.sk

  Hi,
  is it OK to have same layer NAME and GROUP in one mapfile, like in this
  example (mylay) ?
 
  LAYER CONNECTIONTYPE postgis
 STATUS ON
 NAME 'mylay'
 GROUP 'mylay'
 TYPE LINE
 
  LAYER CONNECTIONTYPE postgis
 STATUS ON
 NAME 'mylay2'
 GROUP 'mylay'
 TYPE LINE
 
  In my case (Mapserver 5.2.x) it is working well, but I am not sure if it
  is good practise and also if it is going to
  work in higher versions.


signature.asc
Description: This is a digitally signed message part.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Loadquery in MAPSERVER 5.6.1

2010-04-01 Thread Alexandre Trindade
2010/3/27 Daniel Morissette dmorisse...@mapgears.com

 MapServer 5.4 introduced a new test to require that query files use the
 .qy extension, for security reasons.

 Try changing your code to use the .qy query file extension.

 Daniel

 Alexandre Trindade wrote:

 Hi,

  After upgrade the MS4W 2.3.1 ( Mapserver 5.2.1 ) to  MS4W 3.0 ( MAPSERVER
 5.6.1 ) my aplication stop to run when try use the function LOADQUERY. Not
 have message error, but the map not render image with selection. I'm note
 that file (bin) generated by SAVEQUERY ( MS4W 2.3.1 )  is diferent to the
 file(txt) generated in  MS4W 3.0. I searched for modifications in this
 functions, but i'm not found.



 The same aplication generated this two files with function savequery

 run in MS4W 2.3.1 ( Mapserver 5.2.1 )

 test.mapqy

 $X ÎüêJÀçm¡ ×Y=À ­4 Ý-HÀK !9™ô9À

 and

 run in MS4W 3.0 ( MAPSERVER 5.6.1 )

 test.mapqy

 MapServer Query - Generated by msSaveQuery()
 0 5 6 -1
 -1 -1 0 0
 -1 -1 -1 -1
 23 -1 0
 NULL
 NULL
 -1
 0


 any suggenstions ?


 --
 Alexandre Trindade

 Programador PHP


 


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



 --
 Daniel Morissette
 http://www.mapgears.com/

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



Daniel,

 Thanks for reply my question. You're right, using the file extension .qy
solved this problem , really thanks.
But appears a new problem,  my routine accumulates results using successive
queryByIndex() and saves in query file for read later ( works fine in MS
5.2.1 ). However in the Mapserver 5.6.1 her saved only last queryindex
result.

foreach ($shp as $indx)
{ @$this-mapa-querybyindex($indxlayer,-1,$indx,MS_TRUE); }
$this-mapa-savequery($this-qyfile);

Is no longer possible using this method this way, or I'm not setting right?

best regards


Alexandre Trindade

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


[mapserver-users] GetFeatures - get the ID value of clicked shape

2010-04-01 Thread Medve Zsolt

Hy all

Can someone help me with this?

$layer = $map-getLayerByName('sde1','sde2','sde3','sde4');

// xy pix - geo pt

$xPixel = $_REQUEST['x'];
$yPixel = $_REQUEST['y'];

$xGeo = $_SESSION['GEOEXT']['minx'] + (($xPixel/$_SESSION['mapwidth']) * 
($_SESSION['GEOEXT']['minx']-$_SESSION['GEOEXT']['maxx']));
$yGeo = $_SESSION['GEOEXT']['maxy'] - (($yPixel/$_SESSION['mapheight']) 
* ($_SESSION['GEOEXT']['maxy']-$_SESSION['GEOEXT']['miny']));


$pt = ms_newPointObj();
$pt-setXY($xGeo, $yGeo);

// proj
$mapProjStr = $map-getProjection();
$layerProjStr = $layer-getProjection();
if ($mapProjStr  $layerProjStr  $mapProjStr != $layerProjStr) {
$mapProjObj = ms_newprojectionobj($mapProjStr);
$layerProjObj = ms_newprojectionobj($layerProjStr);
$pt-project($mapProjObj, $layerProjObj);
}

// set map extent and size:
$map-setExtent($_SESSION['GEOEXT']['minx'], 
$_SESSION['GEOEXT']['miny'], $_SESSION['GEOEXT']['maxx'], 
$_SESSION['GEOEXT']['maxy']);

$map-setSize($_SESSION['mapwidth'], $_SESSION['mapheight']);

$map-preparequery();

// Use '@' to avoid warning if query found nothing
@$layer-queryByPoint($pt, MS_SINGLE, -1);
$pt-free();

if ($layer-getNumResults() == 1) {
$res = $layer-getResult(0);
$layer-open();
$shape = $layer-getFeature($res-shapeindex, $res-tileindex);
*$id = $shape-ID;*

$layer-close();
}

This code gets the x and y coordinates of the clicking ($xPixel = 
$_REQUEST['x']) I have transformed it to Geo coords, and so on, and in 
the end i want to search for my clicked shape's ID


Am i right that the $id variable is contaning the ID value of the 
clicked shape? i have bolded the line i talking about..  (The shape file 
have an attribute table and mine have a ID column)


Please if someone can help , do it:P

thanks,
Zsolt



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


Re: [mapserver-users] Loadquery in MAPSERVER 5.6.1

2010-04-01 Thread Daniel Morissette

Alexandre Trindade wrote:


 Thanks for reply my question. You're right, using the file extension 
.qy solved this problem , really thanks.
But appears a new problem,  my routine accumulates results using 
successive queryByIndex() and saves in query file for read later ( works 
fine in MS 5.2.1 ). However in the Mapserver 5.6.1 her saved only last 
queryindex result.


foreach ($shp as $indx)
{ @$this-mapa-querybyindex($indxlayer,-1,$indx,MS_TRUE); }
$this-mapa-savequery($this-qyfile);

Is no longer possible using this method this way, or I'm not setting right?




Alexandre,

Please do not bottom-post at the end of a very long email... just a hint 
to increase your chances of getting a response. You're lucky that I 
scrolled all the way down the very long email to read your question... I 
usually don't.


Back to your question: I don't know if cumulative queries were expected 
to be supported in the past, and should be now. Hopefully Steve will 
read this and comment. If he doesn't then I suggest you post the 
question again clearly in a new post.


Daniel
--
Daniel Morissette
http://www.mapgears.com/
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Same name for GROUP and layer NAME ?

2010-04-01 Thread Ivan Mincik
On Thu, Apr 1, 2010 at 3:09 PM, Cristiano Sumariva sumar...@gmail.com wrote:
 Unfortunely I dont use WMS services yet.
 But looks like invalid generated XML if Name is nested inside Name.
 On this case I suggest filling a bug request.

 Since they are separate attributes they should not generate the same XML
 mark.
 The tag should be GroupName or should be Group
 Group tag and
 Namethe group name/Name
 Layer
   Namename ...
 /Layer
 /Group

 or

 Group
   GroupNamethe group name ...
   Namelayer1 ..
   Name layer2
 I relying on XML documents I already parsed since don t used WMS features
 yet again.


This is the snippet from my GetCapabilities. I have GROUP called
'ulicemap' and LAYERS 'ulicemap' and 'ulice_multi'. What do You think
?

Layer
     Nameulicemap/Name
     Titleulicemap/Title
     Abstractulicemap/Abstract
     Layer queryable=1 opaque=0 cascaded=0
       Nameulice_multi/Name
       Titleulice_multi/Title
       SRSEPSG:102067/SRS
       LatLonBoundingBox minx=-64.6562 miny=-68.693
maxx=114.323 maxy=-8.21012 /
       BoundingBox SRS=EPSG:102067
                   minx=-2.5e+07 miny=-2.5e+07 maxx=2.5e+07
maxy=2.5e+07 /
     /Layer
     Layer queryable=1 opaque=0 cascaded=0
       Nameulicemap/Name
       Titleulice/Title
       SRSEPSG:102067/SRS
       LatLonBoundingBox minx=-64.6562 miny=-68.693
maxx=114.323 maxy=-8.21012 /
       BoundingBox SRS=EPSG:102067
                   minx=-2.5e+07 miny=-2.5e+07 maxx=2.5e+07
maxy=2.5e+07 /
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] How to filter ArcGIS WFS service?

2010-04-01 Thread Yewondwossen Assefa

Hi There,

It should be now fixed. Bug related to it is 
http://trac.osgeo.org/mapserver/ticket/3414.


regards,

Miloslav Kmeť wrote:

Hello.

I need to find a solution how to filter ArcGIS wfs service in mapserver WFS 
client. I read this document: http://mapserver.org/ogc/filter_encoding.html and 
there is no topic about xml ns prefixes in filter.


It seems, that esri's wfs services need xml namespace ogc: in every filter 
element.


I tried id with get from browser and this works as expected:
ogc:Filterogc:PropertyIsEqualToogc:PropertyNameeia_eia:IDAKCIA/ogc:PropertyNameogc:Literal1833/ogc:Literal/ogc:PropertyIsEqualTo/ogc:Filter
?service=wfsversion=1.1.0request=getFeaturetypename=eia_eia:EIA_Localityfilter=%3Cogc:Filter%3E%3Cogc:PropertyIsEqualTo%3E%3Cogc:PropertyName%3Eeia_eia:IDAKCIA%3C/ogc:PropertyName%3E%3Cogc:Literal%3E1833%3C/ogc:Literal%3E%3C/ogc:PropertyIsEqualTo%3E%3C/ogc:Filter%3E
(tinyurlized: http://tinyurl.com/yanqfry)

But this won't filter anything and gives me all features:
FilterPropertyIsEqualToPropertyNameeia_eia:IDAKCIA/PropertyNameLiteral1833/Literal/PropertyIsEqualTo/Filter
?service=wfsversion=1.1.0request=getFeaturetypename=eia_eia:EIA_Localityfilter=%3CFilter%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Eeia_eia:IDAKCIA%3C/PropertyName%3E%3CLiteral%3E1833%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E
(tinyurlized: http://tinyurl.com/y9t3rld)

I doubt, that I can get some response from Esri on this topic, because of this 
thread: http://forums.esri.com/Thread.asp?c=158f=2276t=273488 where folks


So the question is - how to add the ogc: namespace prefix into wfs_filter?

This is how I have configured the WFS in my mapfile:
CONNECTIONTYPE WFS
CONNECTION 
http://globus.sazp.sk/arcgis/services/eia/eia/mapserver/wfsserver;

METADATA

  wfs_version 1.0.0
  wfs_service WFS
  wfs_request_method GET
  wfs_srs EPSG:4326
  wfs_typename eia_eia:EIA_locality
  wfs_filter 
PropertyIsEqualToPropertyNameeia_eia:IDAKCIA/PropertyNameLiteral1833/Literal/PropertyIsEqualTo

  wfs_maxfeatures 1000
END

Thank you.

  



--

Assefa Yewondwossen   
Software Analyst   

Email: yass...@dmsolutions.ca
http://www.dmsolutions.ca/


Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925



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


[mapserver-users] rgb expression with alpha?

2010-04-01 Thread Wendell Turner
Hi,

I want to turn all non-transparent 'near white' pixels
transparent.  I've tried:

  LAYER
NAME  xx
TYPE   RASTER
CONNECTIONTYPE ogr
CONNECTION file.wld
DATA   file.gif

# copied from here: http://mapserver.org/input/raster.html#raster
# but I added the [alpha] and opacity part
CLASS
  NAME near white
  EXPRESSION ( ([red]  225) AND ([green]  225) AND ([blue]  225) AND 
([alpha]  225) )
  STYLE
OPACITY 0
  END
END
  END

(The file is an RGBA gif file.)

The [alpha] expression isn't recognized.  In fact, [foo] works just the same.

gdalinfo of the file shows:
  Color Table (RGB with 32 entries)
0: 255,255,255,0
1: 240,240,240,255
...

So it seems that the 0 entry defines the transparent color.

Q: is [alpha] a valid EXPRESSION item?  Is something else wrong?

Thanks,

Wendell

p.s., I'm always amazed at how capable and terrific mapserver is when
you dig enough into it.

p.p.s: MapServer version 5.4.1

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


Re: [mapserver-users] Loadquery in MAPSERVER 5.6.1

2010-04-01 Thread Edmar Moretti

Hi,

In the post 
http://n2.nabble.com/php-mapscript-loadQuery-problem-td4496775.html is 
shown the .qy file structure (by Steve Lime):



Line - Contents

0 - magic string

1 - mode, type (single or multiple), Qlaya, slayer

2 - point x, y point, buffer, max results (queryByPoint)

3 - query rect (minx, miny, maxx, maxy) (queryByRect)

4 - shp index, tile index, clear cache flag (queryByIndex)

5 - qitem or NULL (queryByAttribute)

6 - QString or NULL

7 - operator (used by WFS)

8 + - query shape (queryByShape)

My question is: how to include more than one element using shp index?




Daniel Morissette escreveu:

Alexandre Trindade wrote:


 Thanks for reply my question. You're right, using the file extension 
.qy solved this problem , really thanks.
But appears a new problem,  my routine accumulates results using 
successive queryByIndex() and saves in query file for read later ( 
works fine in MS 5.2.1 ). However in the Mapserver 5.6.1 her saved 
only last queryindex result.


foreach ($shp as $indx)
{ @$this-mapa-querybyindex($indxlayer,-1,$indx,MS_TRUE); }
$this-mapa-savequery($this-qyfile);

Is no longer possible using this method this way, or I'm not setting 
right?





Alexandre,

Please do not bottom-post at the end of a very long email... just a 
hint to increase your chances of getting a response. You're lucky that 
I scrolled all the way down the very long email to read your 
question... I usually don't.


Back to your question: I don't know if cumulative queries were 
expected to be supported in the past, and should be now. Hopefully 
Steve will read this and comment. If he doesn't then I suggest you 
post the question again clearly in a new post.


Daniel


--


edmar.more...@terra.com.br

Skype/MSN:

edmar.moretti

Twitter:

@edmarmoretti

Blogs:

http://edmarmoretti.blogspot.com/
http://mapasnaweb.blogspot.com/

Ohloh:

https://www.ohloh.net/accounts/edmarmoretti

Geógrafos:

http://geografos.ning.com/profile/EdmarMoretti

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


[mapserver-users] OT - Looking for a Good JavaScrript Forum theat Mapper-Friendly

2010-04-01 Thread Bill Thoen
For those of you work with MapServer as a base and build JavaScript and 
PHP code on top of that, can you recommend a good JavaScript forum on 
which I can ask questions focusing on the JS side of a question that's 
related to building on MapServer rather than the other way round? I'd 
especially favor a list where there are people familiar with mapping 
data structures and map issues, but getting some good current advice on 
Javascript is what I'm really looking for.


TIA

- Bill Thoen 
 GISnet - www.gisnet.com

 303-786-9961

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