[mapserver-users] Query
Hi MapServer We can across https://hub.docker.com/u/mapserver in DockerHub and wanted to confirm if this is an official account from yourselves ? Regards Bobby Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query problem
Hello I jave a problem making a query in Internet explorer I am using javascript for make teh query but when i run in firefox i dont have any problem but, when i using IE dont work my aplication the code for my page is the follow html> Busqueda por CANTON Buscar por: Canton Parroquia Plantel LAGO AGRIO GONZALO PIZARRO PUTUMAYO SHUSHUFINDI PUTUMAYO SUCUMBIOS CASCALES CUYABENO SANTA BARBARA EL PLAYON DE SAN FCO. LA BONITA LA SOFIA ROSA FLORIDA SANTA ELENA EL DORADO DE CASCALES JAMBELI PUERTO LIBRE PUERTO EL CARMEN EL REVENTADOR GENERAL FARFAN PALMA ROJA NUEVA LOJA PACAYACU STA. ROSA DE SUCUMBIOS SANTA CECILIA SEVILLA LUMBAQUI DURENO EL ENO PUERTO BOLIVAR GONZALO PIZARRO SHUSHUFINDI PUERTO RODRIGUEZ TARAPOA AGUAS NEGRAS SAN PEDRO DE LOS CAFANES CUYABENO SIETE DE JULIO SAN ROQUE LIMONCOCHA PAÑACOCHA Please could you give me a hand ? _ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query problems
Hey all, One last issue (well for know anyway)... I want to create a basic query so when I open the query I am able to select the major roads and expressways from the mjrroads layer that was created! I have already created the header and footers but not sure where to stick the particular code in the global.map file that contains the headers and footers... Here is my code.# Map file created from QGIS project file C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs # Edit this file to customize for your map interface # (Created with PyQgis MapServer Export plugin) MAP NAME "QGIS-MAP" # Map image size SIZE 500 500 UNITS meters EXTENT -240 -90 310 400 FONTSET "/wwwroot/fonts/fontset.txt" SYMBOLSET "/wwwroot/symbols/symbols.sty" PROJECTION "proj=lcc" "ellps=GRS80" "lat_0=49" "lon_0=-95" "lat_1=49" "lat_2=77" "datum=NAD83" "units=m" "no_defs" END # Background color for the map canvas -- change as desired IMAGECOLOR 0 100 250 IMAGEQUALITY 95 IMAGETYPE agg OUTPUTFORMAT NAME agg DRIVER AGG/PNG IMAGEMODE RGB END # Legend LEGEND IMAGECOLOR 255 255 255 STATUS ON KEYSIZE 18 12 LABEL TYPE BITMAP SIZE MEDIUM COLOR 0 0 89 END END # Web interface definition. Only the template parameter # is required to display a map. See MapServer documentation WEB # Set IMAGEPATH to the path where MapServer should # write its output. IMAGEPATH "/ms4w/tmp/ms_tmp/"# Set IMAGEURL to the url that points to IMAGEPATH # as defined in your web server configuration IMAGEURL "/ms_tmp/"# WMS server settings METADATA 'ows_title' 'QGIS-MAP' 'ows_onlineresource' 'localhost.com/cgi-bin/mapserv.exe?map=C:/wwwroot/M_Mirrlees_Assign3/global.map' 'ows_srs' 'EPSG:4326' END#Scale range at which web interface will operate # Template and header/footer settings # Only the template parameter is required to display a map. See MapServer documentation TEMPLATE 'C:/wwwroot/M_Mirrlees_Assign3/global.html' END SCALEBAR STATUS EMBED UNITS KILOMETERS INTERVALS 3 TRANSPARENT TRUE OUTLINECOLOR 0 0 0 END # End for scalebar QUERYMAP STATUS ON # sets the map to be queryable STYLE HILITE # the selected object is highligthed END # End for QueryMap WEB TEMPLATE global.html IMAGEPATH "/ms4w/tmp/ms_tmp/" IMAGEURL "/ms_tmp/" HEADER"/maps/M_Mirrlees_assign3/header.html" FOOTER"maps/M_Mirrlees_assign3/footer.html" EMPTY "/maps/M_Mirrlees_Assign3/blank.html" END #End for WEB LAYER NAME 'mjrroads' TYPE LINE DUMP false EXTENT -143.210462 39.001401 -50.461045 85.911094 DATA '../data/mjrroads.shp' METADATA 'ows_title' 'mjrroads' END STATUS default TRANSPARENCY 100 PROJECTION 'proj=longlat' 'datum=WGS84' 'no_defs' END CLASSITEM 'TYPE' CLASS NAME "default" EXPRESSION "" STYLE WIDTH 0.91 COLOR 201 157 32 END END CLASS NAME "TYPE = Expressway" EXPRESSION "Expressway" STYLE WIDTH 2.0 COLOR 255 0 0 END END CLASS NAME "TYPE = Primary Highway" EXPRESSION "Primary Highway" MAXSCALEDENOM 250 STYLE WIDTH 1.0 COLOR 0 0 0 END END END I must apologize for all the questions, as i'm still fairly new at this but everyone who has taken the time to help me is quite appreciated as this is making a lot of sense now. Thanks,Mark ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query question
How can I tell MapServer the specific layer I want it to query? e.g. set the query layer with a radio button. Thanks EW ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Query
That was setup by one of the MapServer PSC members and can be considered official - it's a little out of date however (MapServer 7.2 I believe). On Fri, Nov 15, 2019 at 8:54 AM Bobby Biran wrote: > Hi MapServer > > > > We can across https://hub.docker.com/u/mapserver in DockerHub and wanted > to confirm if this is an official account from yourselves ? > > > > Regards > > Bobby > > > Unless stated otherwise above: > IBM United Kingdom Limited - Registered in England and Wales with number > 741598. > Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU > > ___ > mapserver-users mailing list > mapserver-users@lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Query
I have it as a task to push updates to it this weekend. I’ll bring it up to date writhe the current MapServer release. Michael Smith > On Nov 15, 2019, at 5:49 PM, Steve Lime wrote: > > > That was setup by one of the MapServer PSC members and can be considered > official - it's a little out of date however (MapServer 7.2 I believe). > >> On Fri, Nov 15, 2019 at 8:54 AM Bobby Biran wrote: >> Hi MapServer >> >> We can across https://hub.docker.com/u/mapserver in DockerHub and wanted to >> confirm if this is an official account from yourselves ? >> >> Regards >> Bobby >> >> >> Unless stated otherwise above: >> IBM United Kingdom Limited - Registered in England and Wales with number >> 741598. >> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU >> >> ___ >> mapserver-users mailing list >> mapserver-users@lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/mapserver-users > ___ > mapserver-users mailing list > mapserver-users@lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Query Regarding MapServer?????
HI!! I have displayed my raster & vector Images on Grass Tool. NOw i want to start with the development using the grass tools. How could i use Grass in conjuction with the Map Server. I want to develop the client-server architecture, I want the map server should run on Server & n number of Client can request them .. Since I want to start with the developemt ,could u recommend any book for this..I am not able to find any books,,the books avaliable on the internet have the limited preview and they are not complete. could u please tell the following tasks could be accomplished in grass ?? 1.Import & Export Map(TF,GeoTif,IMG,DTED,SHP,BMP,DVD,DGN). 2.)Registration of Map-->Datum Used is wgs84. 3)Raster to Vector Conversion & Vice Versa 4) Create Layer 5)Grouping & Separation of Layers. 6) Hide/Unhide Layers. 7)Edit/Delete layers, 8)Stiching of Map. Please help me to resolve these queries, Thanks in Advance. -- Thanks & Regards Kunal Malik 09871147561 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query data raster
Hello friends, I am working with MApServer 5, want to do query on layers raster and have the following problem: on a layers raster once chosen the tool of query gives the following thing to the clickear: " MsQueryByPoint (): Search returned not results. Not matching record (s) found. " The layer raster of my map file defini like that: LAYER NAME "arboles" TYPE raster DATA "cobertura/GLC_5Final.tif" STATUS ON CLASS EXPRESSION ([pixel] = 1) STYLE COLOR 0 255 0 END TEMPLATE "template/raster.html" END CLASS EXPRESSION ([pixel] = 1) STYLE COLOR 255 226 187 END #TEMPLATE "template/raster.html" END HEADER "template/raster_header.html" FOOTER "template/raster_footer.html" The file raster.html (that is the principal one in the consultation) defini like that: Pixel: values=[value_list] value_0=[value_0] value_1=[value_1] value_2=[value_2] RGB = [RED],[GREEN],[BLUE] Class = [class] I wait for his help .. from already thank you very much to this forum that really contributes things very interesting and good solutions Regards Pablo.- -- Pablo Zader ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query in url
I have a mapserver site that contains, among others, a parcel layer. I have a 3rd party application that manages parcel data for a customer and I would like to...from the third party application...send a url request to the mapserver that would cause it to open, and zoom to a particular parcel. If the parcel layer was named 'parcels' and the field name was ParcelNumber in the layer, how would I construct the url request to perform the above function...or is it even possible? Kevin Edmundson CIO WTH Technology, Inc 567 W Westfield Blvd Indianapolis, IN 46208 317.259.0105 office 317.259.1423 fax 317.501.8560 mobile [EMAIL PROTECTED] NOTICE: This message is from the technology firm WTH Technology, Inc. This message is intended only for the individual or entity to which it is directed. If you are not the addressee, or if this message has been addressed to you in error, you are not authorized to use, read, copy or distribute this message and any attachments, and we ask that you please immediately delete this message and attachments (including all copies), and notify the sender by return e-mail so that our records can be corrected. All personal messages express views only of the sender, which are not to be attributed to WTH Technology, Inc, and may not be distributed or copied without this statement. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query case insensitive
Hi all, I'm using the queryByAttributes-function of PHP-Mapscript with the LIKE (~) operator for strings (out of a POSTGIS-table): $queryString = "nom_bande ~ 'WT'"; $queryItem = "nom_bande"; @$datQuery = $layer->queryByAttributes($queryitem,$queryString,MS_MULTIPLE); Every dataset that contains 'WT' comes as result. But this is case sensitive, if I try $queryString = "nom_bande ~ 'wt'"; there is no result. Is it possible to make the query case insensitive? Thanks Sven ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query error message
Hi mapserver-users, When I do a browser View/Source on a page that contains the results of a MapServer query, the following line is included: The browser View/Source just shows the html code behind the web page that is currently displayed. What "Error message buffer" is this referring to? (the query is MySQL via an OGRVRT connection) Thanks, Greg Luker Australia. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query creation issues
Hello everyone, I'm trying to create a query so I can query the roads/expressways from the map. I'm pretty sure I have created the headers and footers correctly but not sure...regardless i'm not entirely too sure where to stick the particular code in my .map file (shown below). I have bolded the code that I'm trying to incorporate into the .map file but not sure why it's not working. Thanks Mark # Map file created from QGIS project file C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs # Edit this file to customize for your map interface # (Created with PyQgis MapServer Export plugin) MAP NAME "QGIS-MAP" # Map image size SIZE 500 500 UNITS meters EXTENT -240 -90 310 400 FONTSET "/wwwroot/fonts/fontset.txt" SYMBOLSET "/wwwroot/symbols/symbols.sty" PROJECTION "proj=lcc" "ellps=GRS80" "lat_0=49" "lon_0=-95" "lat_1=49" "lat_2=77" "datum=NAD83" "units=m" "no_defs" END # Background color for the map canvas -- change as desired IMAGECOLOR 0 100 250 IMAGEQUALITY 95 IMAGETYPE agg OUTPUTFORMAT NAME agg DRIVER AGG/PNG IMAGEMODE RGB END # Legend LEGEND IMAGECOLOR 255 255 255 STATUS ON KEYSIZE 18 12 LABEL TYPE BITMAP SIZE MEDIUM COLOR 0 0 89 END END # Web interface definition. Only the template parameter # is required to display a map. See MapServer documentation WEB # Set IMAGEPATH to the path where MapServer should # write its output. IMAGEPATH "/ms4w/tmp/ms_tmp/" # Set IMAGEURL to the url that points to IMAGEPATH # as defined in your web server configuration IMAGEURL "/ms_tmp/" # WMS server settings METADATA 'ows_title' 'QGIS-MAP' 'ows_onlineresource' 'localhost.com/cgi-bin/mapserv.exe?map=C:/wwwroot/M_Mirrlees_Assign3/global.map' 'ows_srs' 'EPSG:4326' END #Scale range at which web interface will operate # Template and header/footer settings # Only the template parameter is required to display a map. See MapServer documentation TEMPLATE 'C:/wwwroot/M_Mirrlees_Assign3/global.html' END SCALEBAR STATUS EMBED UNITS KILOMETERS INTERVALS 3 TRANSPARENT TRUE OUTLINECOLOR 0 0 0 END # End for scalebar QUERYMAP STATUS ON # sets the map to be queryable STYLE HILITE # the selected object is highligthed END # End for QueryMap WEB TEMPLATE global.html IMAGEPATH "/ms4w/tmp/ms_tmp/" IMAGEURL "/ms_tmp/" HEADER"/maps/M_Mirrlees_assign3/header.html" FOOTER"maps/M_Mirrlees_assign3/footer.html" EMPTY "/maps/M_Mirrlees_Assign3/blank.html" END #End for WEB LAYER NAME 'mjrroads' TYPE LINE DUMP false EXTENT -143.210462 39.001401 -50.461045 85.911094 DATA '../data/mjrroads.shp' METADATA 'ows_title' 'mjrroads' END STATUS default TRANSPARENCY 100 PROJECTION 'proj=longlat' 'datum=WGS84' 'no_defs' END CLASSITEM 'TYPE' CLASS NAME "default" EXPRESSION "" STYLE WIDTH 0.91 COLOR 201 157 32 END END CLASS NAME "TYPE = Expressway" EXPRESSION "Expressway" STYLE WIDTH 2.0 COLOR 255 0 0 END END CLASS NAME "TYPE = Primary Highway" EXPRESSION "Primary Highway" MAXSCALEDENOM 250 STYLE WIDTH 1.0 COLOR 0 0 0 END END END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query wms_group layer
Hello list, i would like to enquire if it is possible to make queryable wms_group layer? Let's say I have three queryable layers in mapfile, that are meant for different scales. Now I group them by GROUP keyword under LAYER and also add wms_group_title metadata keyword. After I do that and add group layer to map suddenly option GetFeatureInfo becomes unavailable, although if I add these layers one by one, the layers are queryable. Do I need to add some other keyword to metadata, or is there are some other workaround? Will be grateful for you advices, sincerly Zmicier ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query in mapfile
the code below is a layer in map file in this code i want create a query in postgis for shortestpath but a the number 77 and 388 is the source and target and the result create successfully but my problem is how insert the number ( 77, 388) in template file or insert by user how insert from html file LAYER CONNECTION "host=localhost dbname=network user=postgres password=021555 port=5432" CONNECTIONTYPE POSTGIS DATA "geom from (SELECT * from pgr_dijkstra( 'SELECT gid as id , source , target , cost FROM tehran' , 77, 388, false , false ) a LEFT JOIN tehran b ON (a.id2 = b.gid)) AS foo using unique gid using srid=4326" NAME "shortestpath" PROJECTION "proj=utm" "zone=39" "datum=WGS84" "units=m" "no_defs" END # PROJECTION STATUS ON TEMPLATE "query" TILEITEM "location" TYPE LINE UNITS METERS CLASS NAME "Class (0)" STYLE COLOR 255 128 64 SIZE 8 WIDTH 10 END # STYLE END # CLASS END # LAYER ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query to mapserver
good morning to all, i have a question: how can i make a query to mapserver by code? for example, if i give by code a cadastral parcel, i would like to know the layers contained, or included in that area, or which layers that cadastral parcel belong. anyone can halp me? Regard Eugenio ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] query question
Set the qlayer CGI parameter. Steve From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Eric Weisbender Sent: Thursday, April 14, 2011 1:26 PM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] query question How can I tell MapServer the specific layer I want it to query? e.g. set the query layer with a radio button. Thanks EW ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query results lost
Hello...we upgraded to the latest ms4w version 3.0.1 (MapServer and MapScript to 5.6.6 ) and some things went bad. after doing a $oLayer->queryByPoint which yields results (layer->numresults>0), a call to $map_object->saveQuery yields a file showing *no results*: MapServer Query - Generated by msSaveQuery() 1 1 33 -1 10718763.8336106 3518854.14068547 -1 0 -1 -1 -1 -1 -1 -1 1 NULL NULL -1 0 so I rewrote our code to avoid using that...a php is loaded into an iframe (frame.src=blablabla.php?xxx), in which the query results are accesed via $map_object->$oMapSession->oMap...all layers have ->numresults=0 anyone have a clue as to what went bad? the code worked fine in an older mapserver/mapscript... thanks, Ben ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query multiple layers
I am querying one specific layer and values from that layer using qlayer, qitem, and qstring. e.g. qlayer=tline&qitem=name&qsting=happyjack. My questions would be how to do this on 2 specific layers at the same time/same query. Thanks, EW ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Query By Multiple Attributes ???
Hello Readers, I am trying to generate a map with a hilited parcel. The parcel should be an id that belongs to [BuildingNo & AddNo & ZipCode.] I am using a FILTER expression as below to get the feature id, but it always returns a zero i.e no records I tried to frame my expression as suggested in the link .. but still no results... http://mapserver.gis.umn.edu/docs/howto/msexpressions any suggestions or hints plz ??? $oLayer->setFilter("([LOCATIONX]=3166 AND [ZIPCODE]=13711 AND [LOCATIONY=6154])"); if ($oLayer->getNumResults() > 0 ) { $oLayer->open(); $oResult = $oLayer->getResult( 0 ); $oShape = $oLayer->getShape($oResult->tileindex,$oResult->shapeindex ); $aValues = $oShape->values; $aFeatureID = $aValues['OBJECTID_1']; //Feaure id to hilite parcel //--- FREE SHAPE $oShape->free(); $oLayer->close(); //--- Set the Layer class expression $oLayer=$oMap->getLayerByName("parcels_selection"); $oLayer->set("status", MS_ON); $oClass = $oLayer->getClass(0); $oClass->setExpression($aFeatureID); //--- Draw the map $oImg = $oMap->draw(); $oImg->saveImage($aMapPath); $oImg->free(); echo ""; } thanks & regards ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Query Regarding MapServer?????
1. All that you have mentioned is possible with mapserver and grass both. 2. You need to decide whether you wish to have a client server architecture or web based GIS. 3. You need to visit the UMN-Mapserver website documentation( which is thankfully exhaustive) to learn more about mapserver. You do not need a book. 4. In case you wish it to be web based that i recommend Mapserver as the best bet. You will still need to do some html coding or java script to add additional features. Workshop.zip file is an excellent demo. 5. Openlayers, Chameleon, Cartoweb3 are few good cartography tools, you may use. All the best. Vishal - Original Message From: Kunal Malik <[EMAIL PROTECTED]> To: mapserver-users@lists.osgeo.org Sent: Friday, February 22, 2008 2:02:40 PM Subject: [mapserver-users] Query Regarding MapServer? HI!! I have displayed my raster & vector Images on Grass Tool. NOw i want to start with the development using the grass tools. How could i use Grass in conjuction with the Map Server. I want to develop the client-server architecture, I want the map server should run on Server & n number of Client can request them .. Since I want to start with the developemt ,could u recommend any book for this..I am not able to find any books,,the books avaliable on the internet have the limited preview and they are not complete. could u please tell the following tasks could be accomplished in grass ?? 1.Import & Export Map(TF,GeoTif,IMG,DTED,SHP,BMP,DVD,DGN). 2.)Registration of Map-->Datum Used is wgs84. 3)Raster to Vector Conversion & Vice Versa 4) Create Layer 5)Grouping & Separation of Layers. 6) Hide/Unhide Layers. 7)Edit/Delete layers, 8)Stiching of Map. Please help me to resolve these queries, Thanks in Advance. -- Thanks & Regards Kunal Malik 09871147561 -Inline Attachment Follows- ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[MAPSERVER-USERS] query PostGIS using querybypoint
Hi, Mapserver 5.0.2 is installed in my comp and it can render maps onto web browser using data from PostGIS table.. I want to use the query mode in a simple way.. On a mouse click over the map image, it must retrieve data at that point from the PostGIS table and display it on the browser. Could someone please suggest the simplest way to do this. Thanks in advance.. Mohan -- View this message in context: http://www.nabble.com/query-PostGIS-using-querybypoint-tp16359800p16359800.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] query in url
There are always many ways. If you don't have any spatial information in the 3rd party application then you have a couple of options: 1) do an attribute query with a URL template (explained below) 2) pass the parcel id to your MapServer application and use it to do an ajax call to lookup the spatial extent information. This would work nicely if using OpenLayers, Ka-Map, dBox, or some other type of client that doesn't reload the entire page. It's really just a variation of 1. Anyway, you'd want to do a simple attribute query first to get the spatial extents of the parcel. So, if you had a special mapfile (parcel_lookup.map) it might look like so: MAP ... LAYER NAME 'parcels' TYPE QUERY STATUS DEFAULT TEMPLATE 'http://wthtecnology.com/cgi-bin/mapserv?map=main_application.map&mapext=[shpext_esc]' END END The URL to do the attribute query would look like: http:wthtecnology.com/cgi-bin/mapserv?map=parcel_lookup.map&qitem=id&qlayer=parcels&qstring=xxx-xx-- The is off the top of my head but I've done it and it works nicely. Caveats: 1) depending on version you'll need to set a qstring filter in parcel_lookup.map to validate parcel ids with 2) if using 5.2, it has a new feature to expand extent tags so they aren't so tight to the feature (e.g. [shpext escape=url expand=500] The way this works is your initial call looks up the parcel and gets it's extent. Then that is used to create another call to your main application. The redirection happens automatically and is transparent to the user. Let me know if you need more information. Steve >>> "Kevin Edmundson" <[EMAIL PROTECTED]> 07/02/08 11:06 AM >>> I have a mapserver site that contains, among others, a parcel layer. I have a 3rd party application that manages parcel data for a customer and I would like to...from the third party application...send a url request to the mapserver that would cause it to open, and zoom to a particular parcel. If the parcel layer was named 'parcels' and the field name was ParcelNumber in the layer, how would I construct the url request to perform the above function...or is it even possible? Kevin Edmundson CIO WTH Technology, Inc 567 W Westfield Blvd Indianapolis, IN 46208 317.259.0105 office 317.259.1423 fax 317.501.8560 mobile [EMAIL PROTECTED] NOTICE: This message is from the technology firm WTH Technology, Inc. This message is intended only for the individual or entity to which it is directed. If you are not the addressee, or if this message has been addressed to you in error, you are not authorized to use, read, copy or distribute this message and any attachments, and we ask that you please immediately delete this message and attachments (including all copies), and notify the sender by return e-mail so that our records can be corrected. All personal messages express views only of the sender, which are not to be attributed to WTH Technology, Inc, and may not be distributed or copied without this statement. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] query in url
Steve, First of all...thanks for the reply. I am confused about what I need to do here...and bear with me...I am VERY new to this mapserver stuff. I originally used p.mapper to create an application and then have been modifying the code as I go. I am working on mapserver 5.0. Soif I understand you right, I need to create a second map in my application folder (parcel_lookup.map or something like that) ? Or do I need to create a completely separate application folder for this map? I tried just creating a second map in the application folder for the initial lookup...but after constructing the query url and executing it.it just says "msLoadMap(): Unable to access file. (parcel_lookup.map)". Any further guidance would be greatly appreciated... :D Kevin Edmundson CIO WTH Technology, Inc 567 W Westfield Blvd Indianapolis, IN 46208 317.259.0105 office 317.259.1423 fax 317.501.8560 mobile [EMAIL PROTECTED] NOTICE: This message is from the technology firm WTH Technology, Inc. This message is intended only for the individual or entity to which it is directed. If you are not the addressee, or if this message has been addressed to you in error, you are not authorized to use, read, copy or distribute this message and any attachments, and we ask that you please immediately delete this message and attachments (including all copies), and notify the sender by return e-mail so that our records can be corrected. All personal messages express views only of the sender, which are not to be attributed to WTH Technology, Inc, and may not be distributed or copied without this statement. -Original Message- From: Steve Lime [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 02, 2008 9:27 PM To: mapserver-users@lists.osgeo.org; Kevin Edmundson Subject: Re: [mapserver-users] query in url There are always many ways. If you don't have any spatial information in the 3rd party application then you have a couple of options: 1) do an attribute query with a URL template (explained below) 2) pass the parcel id to your MapServer application and use it to do an ajax call to lookup the spatial extent information. This would work nicely if using OpenLayers, Ka-Map, dBox, or some other type of client that doesn't reload the entire page. It's really just a variation of 1. Anyway, you'd want to do a simple attribute query first to get the spatial extents of the parcel. So, if you had a special mapfile (parcel_lookup.map) it might look like so: MAP ... LAYER NAME 'parcels' TYPE QUERY STATUS DEFAULT TEMPLATE 'http://wthtecnology.com/cgi-bin/mapserv?map=main_application.map&mapext =[shpext_esc]' END END The URL to do the attribute query would look like: http:wthtecnology.com/cgi-bin/mapserv?map=parcel_lookup.map&qitem=id &qlayer=parcels&qstring=xxx-xx-- The is off the top of my head but I've done it and it works nicely. Caveats: 1) depending on version you'll need to set a qstring filter in parcel_lookup.map to validate parcel ids with 2) if using 5.2, it has a new feature to expand extent tags so they aren't so tight to the feature (e.g. [shpext escape=url expand=500] The way this works is your initial call looks up the parcel and gets it's extent. Then that is used to create another call to your main application. The redirection happens automatically and is transparent to the user. Let me know if you need more information. Steve >>> "Kevin Edmundson" <[EMAIL PROTECTED]> 07/02/08 11:06 AM >>> I have a mapserver site that contains, among others, a parcel layer. I have a 3rd party application that manages parcel data for a customer and I would like to...from the third party application...send a url request to the mapserver that would cause it to open, and zoom to a particular parcel. If the parcel layer was named 'parcels' and the field name was ParcelNumber in the layer, how would I construct the url request to perform the above function...or is it even possible? Kevin Edmundson CIO WTH Technology, Inc 567 W Westfield Blvd Indianapolis, IN 46208 317.259.0105 office 317.259.1423 fax 317.501.8560 mobile [EMAIL PROTECTED] NOTICE: This message is from the technology firm WTH Technology, Inc. This message is intended only for the individual or entity to which it is directed. If you are not the addressee, or if this message has been addressed to you in error, you are not authorized to use, read, copy or distribute this message and any attachments, and we ask that you please immediately delete this message and attachments (including all copies), and notify the sender by return e-mail so that our records can be corrected. All personal messages express views only of the sender, which are not to be attributed to WTH Technology, Inc, and may not be distributed or copied without this statement. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] query case insensitive
Use the *~ operator as described at: http://www.postgresql.org/docs/8.3/static/functions-matching.html Steve >>> "Sven Schroeter" <[EMAIL PROTECTED]> 09/24/08 5:12 AM >>> Hi all, I'm using the queryByAttributes-function of PHP-Mapscript with the LIKE (~) operator for strings (out of a POSTGIS-table): $queryString = "nom_bande ~ 'WT'"; $queryItem = "nom_bande"; @$datQuery = $layer->queryByAttributes($queryitem,$queryString,MS_MULTIPLE); Every dataset that contains 'WT' comes as result. But this is case sensitive, if I try $queryString = "nom_bande ~ 'wt'"; there is no result. Is it possible to make the query case insensitive? Thanks Sven ___ 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] Query length with mapscript.
Is there a maximum length of the query text when setting a filter with php mapscript? For example, I use $tempLayer->setfilter('contract_id IN (26,27,1093,608,596,134,111,36,37,4599,95,59,41,42,605,117,47,105,146,13 0,123,122,5017,98,66,67,68,69,133,71,131,74,75,76,77,148,94,81,82,108,97 , 85,86,4974,88,89,90,91,93,100,1956,124,125,140,145,141,139,157,152,154,1 56,158,5018,183,162,164,165,173,167,168,169,171,334,174,2083,184,177,743 , 182,186,187,188,332,190,2092,193,195,196,1107,199,200,201,202,203,205,20 6,5015,208,209,218,212,213,214,219,221,222,224,225,226,229,4695,232,235, 238,239,241,244,245,246,247,2015,251,2016,253,256,258,260,261,466,265,26 6,267,268,269,270,593,381,274,595,276,279,280,281,607,283,284,285,286,20 45,299,298,291,292,293,295,296,297,302,1955,304,306,333,309,310,311,385, 316,318,3456,123)'); and I get the error PHP Warning: [MapServer Error]: prepare_database(): Error executing POSTGIS DECLARE (the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d (geom_pnt)),'NDR'),parcel_id::text from (select parcel_id,county,contract_id,land_title_holder,parcel_location,ST_Centro id(geom) as geom_pnt FROM parcels) as foo WHERE ((contract_id IN (26,27,1093,608,596,134,111,36,37,4599,95,59,41,42,605,117,47,105,146,13 0,123,122,5017,98,66,67,68,69,133,71,131,74,75,76,77,148,94,81,82,108,97 , 85,86,4974,88,89,90,91,93,100,1956,124,125,140,145,141,139,157,152,154,1 56,158,5018,183,162,164,165,173,167,168,169,171,334,174,2083,184,177,743 , 182,186,187,188,332,190,2092,193,195,196,1107,199,200,201,202,203,205,20 6,5015,208,209,218,212,213,214,219,221,222,224,225,226,229,4695,232,235, 238,239,241,244,245,246,247,2015,251,2016,253,256,258,260,261,466,265,26 6,267,268,269,270,593,381,274,595,276,279,280,281,607,283,284,285,286,20 45,299,298,291,292,293,295,296,297,302,1955,304,306,333,309,310,311,385, 316,318,3 which truncates the sql statement. Is there a way to increase the length of the query allowed? Thanks, Paul ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] query creation issues
Hi Mark: Personally I'd steer you to the simplified query templates as described here: http://mapserver.org/development/rfc/ms-rfc-36.html This allows you to put everything in one place and better separates data from presentation. No more header/footer's. Plus you can have multiple presentations for the same layer. That said, the mapfile below doesn't have any queryable layers. There is no TEMPLATE defined for the one layer that is present. If you want to use the new style templating you'd do something like this: 1- Define an output format: OUTPUTFORMAT NAME 'my-template' DRIVER 'TEMPLATE' MIMETYPE 'text/html; subtype=compass' FORMATOPTION "FILE=templates/my-template.html" END 2- Optionally make it the default query format (otherwise you need to use qformat CGI parameter): WEB QUERYFORMAT 'my-template' ... END 3- Make layers queryable by adding something like: TEMPLATE 'void' 4- Write your template, for example my-template.html might look like: --- snip --- This is my template: [resultset layer="mjrroads"] [feature]Type: [TYPE][/feature] [/resultset] Done presenting layers. --- snip --- Steve From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees Sent: Wednesday, March 20, 2013 10:45 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] query creation issues Hello everyone, I'm trying to create a query so I can query the roads/expressways from the map. I'm pretty sure I have created the headers and footers correctly but not sure...regardless i'm not entirely too sure where to stick the particular code in my .map file (shown below). I have bolded the code that I'm trying to incorporate into the .map file but not sure why it's not working. Thanks Mark # Map file created from QGIS project file C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs # Edit this file to customize for your map interface # (Created with PyQgis MapServer Export plugin) MAP NAME "QGIS-MAP" # Map image size SIZE 500 500 UNITS meters EXTENT -240 -90 310 400 FONTSET "/wwwroot/fonts/fontset.txt" SYMBOLSET "/wwwroot/symbols/symbols.sty" PROJECTION "proj=lcc" "ellps=GRS80" "lat_0=49" "lon_0=-95" "lat_1=49" "lat_2=77" "datum=NAD83" "units=m" "no_defs" END # Background color for the map canvas -- change as desired IMAGECOLOR 0 100 250 IMAGEQUALITY 95 IMAGETYPE agg OUTPUTFORMAT NAME agg DRIVER AGG/PNG IMAGEMODE RGB END # Legend LEGEND IMAGECOLOR 255 255 255 STATUS ON KEYSIZE 18 12 LABEL TYPE BITMAP SIZE MEDIUM COLOR 0 0 89 END END # Web interface definition. Only the template parameter # is required to display a map. See MapServer documentation WEB # Set IMAGEPATH to the path where MapServer should # write its output. IMAGEPATH "/ms4w/tmp/ms_tmp/" # Set IMAGEURL to the url that points to IMAGEPATH # as defined in your web server configuration IMAGEURL "/ms_tmp/" # WMS server settings METADATA 'ows_title' 'QGIS-MAP' 'ows_onlineresource' 'localhost.com/cgi-bin/mapserv.exe?map=C:/wwwroot/M_Mirrlees_Assign3/global.map' 'ows_srs' 'EPSG:4326' END #Scale range at which web interface will operate # Template and header/footer settings # Only the template parameter is required to display a map. See MapServer documentation TEMPLATE 'C:/wwwroot/M_Mirrlees_Assign3/global.html' END SCALEBAR STATUS EMBED UNITS KILOMETERS INTERVALS 3 TRANSPARENT TRUE OUTLINECOLOR 0 0 0 END # End for scalebar QUERYMAP STATUS ON # sets the map to be queryable STYLE HILITE # the selected object is highligthed END # End for QueryMap WEB TEMPLATE global.html IMAGEPATH "/ms4w/tmp/ms_tmp/" IMAGEURL "/ms_tmp/" HEADER "/maps/M_Mirrlees_assign3/header.html" FOOTER "maps/M_Mirrlees_assign3/footer.html" EMPTY "/maps/M_Mirrlees_Assign3/blank.html" END #End for WEB LAYER NAME 'mjrroads' TYPE LINE DUMP false EXTENT -143.210462 39.001401 -50.461045 85.911094 DATA '../data/mjrroads.shp' METADATA 'ows_title' 'mjrroads' END STATUS default TRANSPARENCY 100 PROJECTION 'proj=longlat' 'datum=WGS84' 'no_defs' END CLASSITEM 'TYPE' CLASS NAME "default" EXPRESSION "" STYLE WIDTH 0.91 COLOR 201 157 32 END END CLASS NAME "TYPE = Expressway" EXPRESSION "Expressway" STYLE WIDTH 2.0 COLOR 255 0 0 END END CLASS NAME "TYPE = Primary Highway" EXPRESSION "Primary Highway" MAXSCALEDENOM 250 STYLE WIDTH 1.0 COLOR 0 0 0 END END END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] query creation issues
Hi Steve, Thanks for your help. I've managed to get the query outputted. I have a couple of additional questions...after creating my query I need the footer to show the "name" and the "type" (based on the shapefile information), as based on the footer.html below Layer: Major Roads Name Type As when I launch my query it only shows... Name Type Based on readings from the mapserver website, it looks like I have to edit the query.html to make this populated...but not sure where (global.map file?) I can get this information that is supposed to go between the and tags. Thanks,Mark> From: steve.l...@state.mn.us > To: mmirrl...@hotmail.com; mapserver-users@lists.osgeo.org > Subject: RE: [mapserver-users] query creation issues > Date: Wed, 20 Mar 2013 17:00:47 + > > Hi Mark: Personally I'd steer you to the simplified query templates as > described here: > > http://mapserver.org/development/rfc/ms-rfc-36.html > > This allows you to put everything in one place and better separates data from > presentation. No more header/footer's. Plus you can have multiple > presentations for the same layer. > > That said, the mapfile below doesn't have any queryable layers. There is no > TEMPLATE defined for the one layer that is present. > > If you want to use the new style templating you'd do something like this: > > 1- Define an output format: > > OUTPUTFORMAT > NAME 'my-template' > DRIVER 'TEMPLATE' > MIMETYPE 'text/html; subtype=compass' > FORMATOPTION "FILE=templates/my-template.html" > END > > 2- Optionally make it the default query format (otherwise you need to use > qformat CGI parameter): > > WEB > QUERYFORMAT 'my-template' > ... > END > > 3- Make layers queryable by adding something like: > > TEMPLATE 'void' > > 4- Write your template, for example my-template.html might look like: > > --- snip --- > > This is my template: > > [resultset layer="mjrroads"] > [feature]Type: [TYPE][/feature] > [/resultset] > > Done presenting layers. > --- snip --- > > Steve > > From: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees > Sent: Wednesday, March 20, 2013 10:45 AM > To: mapserver-users@lists.osgeo.org > Subject: [mapserver-users] query creation issues > > Hello everyone, > > I'm trying to create a query so I can query the roads/expressways from the > map. I'm pretty sure I have created the headers and footers correctly but not > sure...regardless i'm not entirely too sure where to stick the particular > code in my .map file (shown below). I have bolded the code that I'm trying to > incorporate into the .map file but not sure why it's not working. Thanks Mark > > # Map file created from QGIS project file > C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs > # Edit this file to customize for your map interface > # (Created with PyQgis MapServer Export plugin) > MAP > NAME "QGIS-MAP" > # Map image size > SIZE 500 500 > UNITS meters > EXTENT -240 -90 310 400 > FONTSET "/wwwroot/fonts/fontset.txt" > SYMBOLSET "/wwwroot/symbols/symbols.sty" > PROJECTION > "proj=lcc" > "ellps=GRS80" > "lat_0=49" > "lon_0=-95" > "lat_1=49" > "lat_2=77" > "datum=NAD83" > "units=m" > "no_defs" > END > # Background color for the map canvas -- change as desired > IMAGECOLOR 0 100 250 > IMAGEQUALITY 95 > IMAGETYPE agg > OUTPUTFORMAT > NAME agg > DRIVER AGG/PNG > IMAGEMODE RGB > END > # Legend > LEGEND > IMAGECOLOR 255 255 255 > STATUS ON > KEYSIZE 18 12 > LABEL > TYPE BITMAP > SIZE MEDIUM > COLOR 0 0 89 > END > END > # Web interface definition. Only the template parameter > # is required to display a map. See MapServer documentation > WEB > # Set IMAGEPATH to the path where MapServer should > # write its output. > IMAGEPATH "/ms4w/tmp/ms_tmp/" > # Set IMAGEURL to the url that points to IMAGEPATH > # as defined in your web server configuration > IMAGEURL "/ms_tmp/" > # WMS server settings > METADATA > 'ows_title' 'QGIS-MAP' > 'ows_onlineresource' > 'localhost.com/cgi-bin/mapserv.exe?map=C:/wwwroot/M_Mirrlees_Assign3/global.map' > 'ows_srs' 'EPSG:4326' > END > #Scale range at which web interface will operate > # Template and header/footer setti
Re: [mapserver-users] query creation issues
You need to refer to the attributes next... [NAME][TYPE] Steve From: Mark Mirrlees [mailto:mmirrl...@hotmail.com] Sent: Wednesday, March 20, 2013 12:16 PM To: Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Hi Steve, Thanks for your help. I've managed to get the query outputted. I have a couple of additional questions...after creating my query I need the footer to show the "name" and the "type" (based on the shapefile information), as based on the footer.html below Layer: Major Roads Name Type As when I launch my query it only shows... Name Type Based on readings from the mapserver website, it looks like I have to edit the query.html to make this populated...but not sure where (global.map file?) I can get this information that is supposed to go between the and tags. Thanks, Mark > From: steve.l...@state.mn.us<mailto:steve.l...@state.mn.us> > To: mmirrl...@hotmail.com<mailto:mmirrl...@hotmail.com>; > mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> > Subject: RE: [mapserver-users] query creation issues > Date: Wed, 20 Mar 2013 17:00:47 + > > Hi Mark: Personally I'd steer you to the simplified query templates as > described here: > > http://mapserver.org/development/rfc/ms-rfc-36.html > > This allows you to put everything in one place and better separates data from > presentation. No more header/footer's. Plus you can have multiple > presentations for the same layer. > > That said, the mapfile below doesn't have any queryable layers. There is no > TEMPLATE defined for the one layer that is present. > > If you want to use the new style templating you'd do something like this: > > 1- Define an output format: > > OUTPUTFORMAT > NAME 'my-template' > DRIVER 'TEMPLATE' > MIMETYPE 'text/html; subtype=compass' > FORMATOPTION "FILE=templates/my-template.html" > END > > 2- Optionally make it the default query format (otherwise you need to use > qformat CGI parameter): > > WEB > QUERYFORMAT 'my-template' > ... > END > > 3- Make layers queryable by adding something like: > > TEMPLATE 'void' > > 4- Write your template, for example my-template.html might look like: > > --- snip --- > > This is my template: > > [resultset layer="mjrroads"] > [feature]Type: [TYPE][/feature] > [/resultset] > > Done presenting layers. > --- snip --- > > Steve > > From: > mapserver-users-boun...@lists.osgeo.org<mailto:mapserver-users-boun...@lists.osgeo.org> > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees > Sent: Wednesday, March 20, 2013 10:45 AM > To: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> > Subject: [mapserver-users] query creation issues > > Hello everyone, > > I'm trying to create a query so I can query the roads/expressways from the > map. I'm pretty sure I have created the headers and footers correctly but not > sure...regardless i'm not entirely too sure where to stick the particular > code in my .map file (shown below). I have bolded the code that I'm trying to > incorporate into the .map file but not sure why it's not working. Thanks Mark > > # Map file created from QGIS project file > C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs > # Edit this file to customize for your map interface > # (Created with PyQgis MapServer Export plugin) > MAP > NAME "QGIS-MAP" > # Map image size > SIZE 500 500 > UNITS meters > EXTENT -240 -90 310 400 > FONTSET "/wwwroot/fonts/fontset.txt" > SYMBOLSET "/wwwroot/symbols/symbols.sty" > PROJECTION > "proj=lcc" > "ellps=GRS80" > "lat_0=49" > "lon_0=-95" > "lat_1=49" > "lat_2=77" > "datum=NAD83" > "units=m" > "no_defs" > END > # Background color for the map canvas -- change as desired > IMAGECOLOR 0 100 250 > IMAGEQUALITY 95 > IMAGETYPE agg > OUTPUTFORMAT > NAME agg > DRIVER AGG/PNG > IMAGEMODE RGB > END > # Legend > LEGEND > IMAGECOLOR 255 255 255 > STATUS ON > KEYSIZE 18 12 > LABEL > TYPE BITMAP > SIZE MEDIUM > COLOR 0 0 89 > END > END > # Web interface definition. Only the template parameter > # is required to display a map. See MapServer documentation > WEB > # Set IMAGEPATH to the path where MapServer should > # write its output. > IMAGEPATH "/ms4w/tmp/ms_tmp/" > # Set IMAGEURL to the url that points to IMAGEPATH > # as defined in
Re: [mapserver-users] query creation issues
Hi Steve, Unfortunately that didn't work! But I did manage to get the ID chracteristic outputted as I forgot to include that previously. As when I went to edit the query.html page it shows this ID Name Type 1275 [name] [type] Here is the code that is causing issues for me... [shpidx] [name] [type] While this is the code for the header... Layer: Major Roads ID Name Type As what i'm trying to do is get the name (name of road outputted) and the type (either expressway or major road) Thanks,MarkFrom: steve.l...@state.mn.us To: mmirrl...@hotmail.com; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Date: Wed, 20 Mar 2013 18:22:29 + You need to refer to the attributes next… [NAME][TYPE] Steve From: Mark Mirrlees [mailto:mmirrl...@hotmail.com] Sent: Wednesday, March 20, 2013 12:16 PM To: Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Hi Steve, Thanks for your help. I've managed to get the query outputted. I have a couple of additional questions...after creating my query I need the footer to show the "name" and the "type" (based on the shapefile information), as based on the footer.html below Layer: Major Roads Name Type As when I launch my query it only shows... Name Type Based on readings from the mapserver website, it looks like I have to edit the query.html to make this populated...but not sure where (global.map file?) I can get this information that is supposed to go between the and tags. Thanks, Mark > From: steve.l...@state.mn.us > To: mmirrl...@hotmail.com; mapserver-users@lists.osgeo.org > Subject: RE: [mapserver-users] query creation issues > Date: Wed, 20 Mar 2013 17:00:47 + > > Hi Mark: Personally I'd steer you to the simplified query templates as > described here: > > http://mapserver.org/development/rfc/ms-rfc-36.html > > This allows you to put everything in one place and better separates data from > presentation. No more header/footer's. Plus you can have multiple > presentations for the same layer. > > That said, the mapfile below doesn't have any queryable layers. There is no > TEMPLATE defined for the one layer that is present. > > If you want to use the new style templating you'd do something like this: > > 1- Define an output format: > > OUTPUTFORMAT > NAME 'my-template' > DRIVER 'TEMPLATE' > MIMETYPE 'text/html; subtype=compass' > FORMATOPTION "FILE=templates/my-template.html" > END > > 2- Optionally make it the default query format (otherwise you need to use > qformat CGI parameter): > > WEB > QUERYFORMAT 'my-template' > ... > END > > 3- Make layers queryable by adding something like: > > TEMPLATE 'void' > > 4- Write your template, for example my-template.html might look like: > > --- snip --- > > This is my template: > > [resultset layer="mjrroads"] > [feature]Type: [TYPE][/feature] > [/resultset] > > Done presenting layers. > --- snip --- > > Steve > > From: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees > Sent: Wednesday, March 20, 2013 10:45 AM > To: mapserver-users@lists.osgeo.org > Subject: [mapserver-users] query creation issues > > Hello everyone, > > I'm trying to create a query so I can query the roads/expressways from the > map. I'm pretty sure I have created the headers and footers correctly but not > sure...regardless i'm not entirely too sure where to stick the particular > code in my .map file (shown below). I have bolded the code that I'm trying to incorporate into the .map file but not sure why it's not working. Thanks Mark > > # Map file created from QGIS project file > C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs > # Edit this file to customize for your map interface > # (Created with PyQgis MapServer Export plugin) > MAP > NAME "QGIS-MAP" > # Map image size > SIZE 500 500 > UNITS meters > EXTENT -240 -90 310 400 > FONTSET "/wwwroot/fonts/fontset.txt" > SYMBOLSET "/wwwroot/symbols/symbols.sty" > PROJECTION > "proj=lcc" > "ellps=GRS80" > "lat_0=49" > "lon_0=-95" > "lat_1=49" > "lat_2=77" > "datum=NAD83" > "units=m" > "no_defs" > END > # Background color for the map canvas -- change as desired &g
Re: [mapserver-users] query creation issues
Straight item tags like that ARE case sensitive. Try [item name="name"] and [item name="type"] instead. From: Mark Mirrlees [mailto:mmirrl...@hotmail.com] Sent: Wednesday, March 20, 2013 1:33 PM To: Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Hi Steve, Unfortunately that didn't work! But I did manage to get the ID chracteristic outputted as I forgot to include that previously. As when I went to edit the query.html page it shows this ID Name Type 1275 [name] [type] Here is the code that is causing issues for me... [shpidx] [name] [type] While this is the code for the header... Layer: Major Roads ID Name Type As what i'm trying to do is get the name (name of road outputted) and the type (either expressway or major road) Thanks, Mark From: steve.l...@state.mn.us<mailto:steve.l...@state.mn.us> To: mmirrl...@hotmail.com<mailto:mmirrl...@hotmail.com>; mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> Subject: RE: [mapserver-users] query creation issues Date: Wed, 20 Mar 2013 18:22:29 + You need to refer to the attributes next... [NAME][TYPE] Steve From: Mark Mirrlees [mailto:mmirrl...@hotmail.com] Sent: Wednesday, March 20, 2013 12:16 PM To: Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> Subject: RE: [mapserver-users] query creation issues Hi Steve, Thanks for your help. I've managed to get the query outputted. I have a couple of additional questions...after creating my query I need the footer to show the "name" and the "type" (based on the shapefile information), as based on the footer.html below Layer: Major Roads Name Type As when I launch my query it only shows... Name Type Based on readings from the mapserver website, it looks like I have to edit the query.html to make this populated...but not sure where (global.map file?) I can get this information that is supposed to go between the and tags. Thanks, Mark > From: steve.l...@state.mn.us<mailto:steve.l...@state.mn.us> > To: mmirrl...@hotmail.com<mailto:mmirrl...@hotmail.com>; > mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> > Subject: RE: [mapserver-users] query creation issues > Date: Wed, 20 Mar 2013 17:00:47 + > > Hi Mark: Personally I'd steer you to the simplified query templates as > described here: > > http://mapserver.org/development/rfc/ms-rfc-36.html > > This allows you to put everything in one place and better separates data from > presentation. No more header/footer's. Plus you can have multiple > presentations for the same layer. > > That said, the mapfile below doesn't have any queryable layers. There is no > TEMPLATE defined for the one layer that is present. > > If you want to use the new style templating you'd do something like this: > > 1- Define an output format: > > OUTPUTFORMAT > NAME 'my-template' > DRIVER 'TEMPLATE' > MIMETYPE 'text/html; subtype=compass' > FORMATOPTION "FILE=templates/my-template.html" > END > > 2- Optionally make it the default query format (otherwise you need to use > qformat CGI parameter): > > WEB > QUERYFORMAT 'my-template' > ... > END > > 3- Make layers queryable by adding something like: > > TEMPLATE 'void' > > 4- Write your template, for example my-template.html might look like: > > --- snip --- > > This is my template: > > [resultset layer="mjrroads"] > [feature]Type: [TYPE][/feature] > [/resultset] > > Done presenting layers. > --- snip --- > > Steve > > From: > mapserver-users-boun...@lists.osgeo.org<mailto:mapserver-users-boun...@lists.osgeo.org> > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees > Sent: Wednesday, March 20, 2013 10:45 AM > To: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> > Subject: [mapserver-users] query creation issues > > Hello everyone, > > I'm trying to create a query so I can query the roads/expressways from the > map. I'm pretty sure I have created the headers and footers correctly but not > sure...regardless i'm not entirely too sure where to stick the particular > code in my .map file (shown below). I have bolded the code that I'm trying to > incorporate into the .map file but not sure why it's not working. Thanks Mark > > # Map file created from QGIS project file > C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs > # Edit this file to customize for your map interface > # (Created with PyQg
Re: [mapserver-users] query creation issues
On 3/20/2013 2:32 PM, Mark Mirrlees wrote: Hi Steve, Unfortunately that didn't work! But I did manage to get the ID chracteristic outputted as I forgot to include that previously. As when I went to edit the query.html page it shows this ID NameType 1275 [name] [type] Here is the code that is causing issues for me... [shpidx] [name] [type] Attribute binding is case sensitive. For shapefiles it should be UPPERCASE and for postgis it should be lowercase. Also, you tags are not nested correctly, you have a tr nested inside a tr. :-O -Steve W While this is the code for the header... Layer: Major Roads ID Name Type As what i'm trying to do is get the name (name of road outputted) and the type (either expressway or major road) Thanks, Mark From: steve.l...@state.mn.us To: mmirrl...@hotmail.com; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Date: Wed, 20 Mar 2013 18:22:29 + You need to refer to the attributes next… [NAME][TYPE] Steve *From:*Mark Mirrlees [mailto:mmirrl...@hotmail.com] *Sent:* Wednesday, March 20, 2013 12:16 PM *To:* Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org *Subject:* RE: [mapserver-users] query creation issues Hi Steve, Thanks for your help. I've managed to get the query outputted. I have a couple of additional questions...after creating my query I need the footer to show the "name" and the "type" (based on the shapefile information), as based on the footer.html below Layer: Major Roads Name Type As when I launch my query it only shows... *Name* *Type* Based on readings from the mapserver website, it looks like I have to edit the query.html to make this populated...but not sure where (global.map file?) I can get this information that is supposed to go between the and tags. Thanks, Mark From: steve.l...@state.mn.us <mailto:steve.l...@state.mn.us> To:mmirrl...@hotmail.com <mailto:mmirrl...@hotmail.com>; mapserver-users@lists.osgeo.org <mailto:mapserver-users@lists.osgeo.org> Subject: RE: [mapserver-users] query creation issues Date: Wed, 20 Mar 2013 17:00:47 + Hi Mark: Personally I'd steer you to the simplified query templates as described here: http://mapserver.org/development/rfc/ms-rfc-36.html This allows you to put everything in one place and better separates data from presentation. No more header/footer's. Plus you can have multiple presentations for the same layer. That said, the mapfile below doesn't have any queryable layers. There is no TEMPLATE defined for the one layer that is present. If you want to use the new style templating you'd do something like this: 1- Define an output format: OUTPUTFORMAT NAME 'my-template' DRIVER 'TEMPLATE' MIMETYPE 'text/html; subtype=compass' FORMATOPTION "FILE=templates/my-template.html" END 2- Optionally make it the default query format (otherwise you need to use qformat CGI parameter): WEB QUERYFORMAT 'my-template' ... END 3- Make layers queryable by adding something like: TEMPLATE 'void' 4- Write your template, for example my-template.html might look like: --- snip --- This is my template: [resultset layer="mjrroads"] [feature]Type: [TYPE][/feature] [/resultset] Done presenting layers. --- snip --- Steve From:mapserver-users-boun...@lists.osgeo.org <mailto:mapserver-users-boun...@lists.osgeo.org> [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees Sent: Wednesday, March 20, 2013 10:45 AM To:mapserver-users@lists.osgeo.org <mailto:mapserver-users@lists.osgeo.org> Subject: [mapserver-users] query creation issues Hello everyone, I'm trying to create a query so I can query the roads/expressways from the map. I'm pretty sure I have created the headers and footers correctly but not sure...regardless i'm not entirely too sure where to stick the particular code in my .map file (shown below). I have bolded the code that I'm trying to incorporate into the .map file but not sure why it's not working. Thanks Mark # Map file created from QGIS project file C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs # Edit this file to customize for your map interface # (Created with PyQgis MapServer Export plugin) MAP NAME "QGIS-MAP" # Map image size SIZE 500 500 UNITS meters EXTENT -240 -90 310 400 FONTSET "/wwwroot/fonts/fontset.txt" SYMBOLSET "/wwwroot/symbols/symbols.sty" PROJECTION "proj=lcc" "ellps=GRS80" "lat_0=49" "lon_0=-95" "lat_1=49" "lat_2=77" "datum=NAD83" "units=m" "no_defs" END # Background color for the map canvas -- change as desired IMAGEC
Re: [mapserver-users] query creation issues
Hi there, Ok I managed to get this outputted...but under the [name] and [type] I need to get these fields populated from the query of the mjrroads... IDNameType1164[name][type] Code from mjrroadsquery.html [shpidx] [name] [type] Now if I change the [name] to [map] in the mjrroadsquery.html I get the following... ID Name Type 1164 /wwwroot/M_Mirrlees_Assign3/global.map [type] Code from mjrroads.html Layer: Major Roads ID Name Type All i'm trying to do is get the Name and Type fields to be showing the name of the road, and the type of the road. Thanks,Mark From: steve.l...@state.mn.us To: mmirrl...@hotmail.com; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Date: Wed, 20 Mar 2013 18:41:52 + Straight item tags like that ARE case sensitive. Try [item name=”name”] and [item name=”type”] instead. From: Mark Mirrlees [mailto:mmirrl...@hotmail.com] Sent: Wednesday, March 20, 2013 1:33 PM To: Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Hi Steve, Unfortunately that didn't work! But I did manage to get the ID chracteristic outputted as I forgot to include that previously. As when I went to edit the query.html page it shows this ID Name Type 1275 [name] [type] Here is the code that is causing issues for me... [shpidx] [name] [type] While this is the code for the header... Layer: Major Roads ID Name Type As what i'm trying to do is get the name (name of road outputted) and the type (either expressway or major road) Thanks, Mark From: steve.l...@state.mn.us To: mmirrl...@hotmail.com; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Date: Wed, 20 Mar 2013 18:22:29 + You need to refer to the attributes next… [NAME][TYPE] Steve From: Mark Mirrlees [mailto:mmirrl...@hotmail.com] Sent: Wednesday, March 20, 2013 12:16 PM To: Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] query creation issues Hi Steve, Thanks for your help. I've managed to get the query outputted. I have a couple of additional questions...after creating my query I need the footer to show the "name" and the "type" (based on the shapefile information), as based on the footer.html below Layer: Major Roads Name Type As when I launch my query it only shows... Name Type Based on readings from the mapserver website, it looks like I have to edit the query.html to make this populated...but not sure where (global.map file?) I can get this information that is supposed to go between the and tags. Thanks, Mark > From: steve.l...@state.mn.us > To: mmirrl...@hotmail.com; mapserver-users@lists.osgeo.org > Subject: RE: [mapserver-users] query creation issues > Date: Wed, 20 Mar 2013 17:00:47 + > > Hi Mark: Personally I'd steer you to the simplified query templates as > described here: > > http://mapserver.org/development/rfc/ms-rfc-36.html > > This allows you to put everything in one place and better separates data from > presentation. No more header/footer's. Plus you can have multiple > presentations for the same layer. > > That said, the mapfile below doesn't have any queryable layers. There is no > TEMPLATE defined for the one layer that is present. > > If you want to use the new style templating you'd do something like this: > > 1- Define an output format: > > OUTPUTFORMAT > NAME 'my-template' > DRIVER 'TEMPLATE' > MIMETYPE 'text/html; subtype=compass' > FORMATOPTION "FILE=templates/my-template.html" > END > > 2- Optionally make it the default query format (otherwise you need to use > qformat CGI parameter): > > WEB > QUERYFORMAT 'my-template' > ... > END > > 3- Make layers queryable by adding something like: > > TEMPLATE 'void' > > 4- Write your template, for example my-template.html might look like: > > --- snip --- > > This is my template: > > [resultset layer="mjrroads"] > [feature]Type: [TYPE][/feature] > [/resultset] > > Done presenting layers. > --- snip --- > > Steve > > From: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees > Sent: Wednesday, March 20, 2013 10:45 AM > To: mapserver-users@lists.osgeo.org > Subject: [mapserver-users] query creation issues > > Hello everyone, > > I'm trying to create a query so I can query the roads/express
Re: [mapserver-users] query creation issues
Does anyone have any updates on how to fix this? As I mentioned before I managed to get the ID field populated whenever I query the map but I need to get the same thing for the name of the road and the type of road... If there is anything else that you require please let me know as this is causing a great deal of confusion why it won't work! Thanks,Mark From: mmirrl...@hotmail.com To: steve.l...@state.mn.us; mapserver-users@lists.osgeo.org Date: Wed, 20 Mar 2013 14:53:57 -0400 Subject: Re: [mapserver-users] query creation issues Hi there, Ok I managed to get this outputted...but under the [name] and [type] I need to get these fields populated from the query of the mjrroads... IDNameType1164[name][type] Code from mjrroadsquery.html [shpidx] [name] [type] Now if I change the [name] to [map] in the mjrroadsquery.html I get the following... ID Name Type 1164 /wwwroot/M_Mirrlees_Assign3/global.map [type] Code from mjrroads.html Layer: Major Roads ID Name Type All i'm trying to do is get the Name and Type fields to be showing the name of the road, and the type of the road. Thanks,Mark ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] query creation issues
Did you see this in Steve's email: > layer=mjrroads&shapeindex=[shpidx]&shpext=[shpext_esc]&mapext=shape&ma > p=[map]">--> > > [shpidx] > [name] > [type] > Attribute binding is case sensitive. For shapefiles it should be UPPERCASE and for postgis it should be lowercase. Also, you tags are not nested correctly, you have a tr nested inside a tr. :-O -Steve W Your data comes from shapefiles. You need to put "name" and "type" in upper case. [NAME] [TYPE] Worth _ From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees Sent: Wednesday, March 20, 2013 3:47 PM To: steve.l...@state.mn.us; mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] query creation issues Does anyone have any updates on how to fix this? As I mentioned before I managed to get the ID field populated whenever I query the map but I need to get the same thing for the name of the road and the type of road... If there is anything else that you require please let me know as this is causing a great deal of confusion why it won't work! Thanks, Mark _ From: mmirrl...@hotmail.com To: steve.l...@state.mn.us; mapserver-users@lists.osgeo.org Date: Wed, 20 Mar 2013 14:53:57 -0400 Subject: Re: [mapserver-users] query creation issues Hi there, Ok I managed to get this outputted...but under the [name] and [type] I need to get these fields populated from the query of the mjrroads... ID Name Type 1164 [name] [type] Code from mjrroadsquery.html [shpidx] [name] [type] Now if I change the [name] to [map] in the mjrroadsquery.html I get the following... ID Name Type 1164 /wwwroot/M_Mirrlees_Assign3/global.map [type] Code from mjrroads.html Layer: Major Roads ID Name Type All i'm trying to do is get the Name and Type fields to be showing the name of the road, and the type of the road. Thanks, Mark _ No virus found in this message. Checked by AVG - www.avg.com Version: 2013.0.2904 / Virus Database: 2641/6189 - Release Date: 03/19/13 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] query creation issues
Hi there I guess I misread that! Thanks for everyone's help! As everything is working the way is needed! Mark Sent from my BlackBerry® powered by Virgin Mobile. -Original Message- From: Worth Lutz Date: Wed, 20 Mar 2013 20:13:52 To: ; Subject: RE: [mapserver-users] query creation issues Did you see this in Steve's email: > layer=mjrroads&shapeindex=[shpidx]&shpext=[shpext_esc]&mapext=shape&ma > p=[map]">--> > > [shpidx] > [name] > [type] > Attribute binding is case sensitive. For shapefiles it should be UPPERCASE and for postgis it should be lowercase. Also, you tags are not nested correctly, you have a tr nested inside a tr. :-O -Steve W Your data comes from shapefiles. You need to put "name" and "type" in upper case. [NAME] [TYPE] Worth From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mark Mirrlees Sent: Wednesday, March 20, 2013 3:47 PM To: steve.l...@state.mn.us; mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] query creation issues Does anyone have any updates on how to fix this? As I mentioned before I managed to get the ID field populated whenever I query the map but I need to get the same thing for the name of the road and the type of road... If there is anything else that you require please let me know as this is causing a great deal of confusion why it won't work! Thanks, Mark From: mmirrl...@hotmail.com To: steve.l...@state.mn.us; mapserver-users@lists.osgeo.org Date: Wed, 20 Mar 2013 14:53:57 -0400 Subject: Re: [mapserver-users] query creation issues Hi there, Ok I managed to get this outputted...but under the [name] and [type] I need to get these fields populated from the query of the mjrroads... ID Name Type 1164 [name] [type] Code from mjrroadsquery.html [shpidx] [name] [type] Now if I change the [name] to [map] in the mjrroadsquery.html I get the following... ID Name Type 1164 /wwwroot/M_Mirrlees_Assign3/global.map [type] Code from mjrroads.html Layer: Major Roads ID Name Type All i'm trying to do is get the Name and Type fields to be showing the name of the road, and the type of the road. Thanks, Mark No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2013.0.2904 / Virus Database: 2641/6189 - Release Date: 03/19/13 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Query one return multiple
Hello list, I was wondering if there is a way to query a point and return not only attributes for that point but the next points attribute in order in the dbf. Thanks in advance. Thanks, EW ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] query in mapfile
http://mapserver.org/cgi/runsub.html On 18 June 2015 at 15:23, hosain mohammadi wrote: > the code below is a layer in map file in this code i want create a query in > postgis for shortestpath but a the number 77 and 388 is the source and > target and the result create successfully but my problem is how insert the > number ( 77, 388) in template file or insert by user > how insert from html file > > > > > LAYER > CONNECTION "host=localhost dbname=network user=postgres > password=021555 port=5432" > CONNECTIONTYPE POSTGIS > DATA "geom from (SELECT * from pgr_dijkstra( > 'SELECT gid as id , source , target , cost FROM tehran' , 77, 388, false > , false ) a LEFT JOIN tehran b ON (a.id2 = b.gid)) AS foo using unique gid > using srid=4326" > NAME "shortestpath" > PROJECTION > "proj=utm" > "zone=39" > "datum=WGS84" > "units=m" > "no_defs" > END # PROJECTION > STATUS ON > TEMPLATE "query" > TILEITEM "location" > TYPE LINE > UNITS METERS > CLASS > NAME "Class (0)" > STYLE > COLOR 255 128 64 > SIZE 8 > WIDTH 10 > END # STYLE > END # CLASS > END # LAYER > > > ___ > 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] query results lost
This is probably related to the different ways results are accessed in PHP MapScript. This changed between version 5.4 and 5.6 and again between 5.6 and 6.0. See the two functions below. The first shows the differences between the versions. The second function is trying to get an object with numResults and bounds of the results in it. This is easy in version 6.0 but requires a loop to get the bounds in earlier versions. This loop will show you the differences in version 5.4 and 5.6. Note the layer->open and close used only in version 5.4. I hope this helps. static function layerGetShape($layer, $result) { if (MAPSERVER_VERSION < 50600) { $shape = $layer->getFeature($result->shapeindex); } else if (MAPSERVER_VERSION < 6) { $shape = $layer->resultsGetShape($result->shapeindex,$result->tileindex); } else { $shape = $layer->getShape( $result ); } return $shape; } static function layerGetResultsObj($layer, $getBounds = FALSE) { $debug = Debug::getInstance(); $debug->log(__FUNCTION__." - MAPSERVER_VERSION = ".MAPSERVER_VERSION); $results->numresults = $layer->getNumResults(); $debug->log(__FUNCTION__." - results->numresults = ".$results->numresults); if (MAPSERVER_VERSION >= 6) { $results->bounds = $layer->getResultsBounds(); } else { $results->bounds = NULL; if ($getBounds && $results->numresults > 0) { $debug->log(__FUNCTION__." - in get bounds if"); $result = $layer->getResult(0); $debug->log(__FUNCTION__." - shapeindex=".$result->shapeindex); if (MAPSERVER_VERSION < 50600) { $layer->open(); $shape = $layer->getFeature($result->shapeindex); } else { $shape = $layer->resultsGetShape($result->shapeindex,$result->tileindex); } $results->bounds->minx = $shape->bounds->minx; $results->bounds->maxx = $shape->bounds->maxx; $results->bounds->miny = $shape->bounds->miny; $results->bounds->maxy = $shape->bounds->maxy; $debug->log(__FUNCTION__." - before loop"); $debug->startTimer('calc_bounds'); for ($i = 1; $i < $results->numresults; $i++) { $result = $layer->getResult($i); if (MAPSERVER_VERSION < 50600) { $shape = $layer->getFeature($result->shapeindex); } else { $shape = $layer->getShape( $result ); } if ($shape->bounds->minx < $results->bounds->minx) { $results->bounds->minx = $shape->bounds->minx; } if ($shape->bounds->miny < $results->bounds->miny) { $results->bounds->miny = $shape->bounds->miny; } if ($shape->bounds->maxx > $results->bounds->maxx) { $results->bounds->maxx = $shape->bounds->maxx; } if ($shape->bounds->maxy > $results->bounds->maxy) { $results->bounds->maxy = $shape->bounds->maxy; } } $debug->stopTimer('calc_bounds'); $debug->log(__FUNCTION__." - results->bounds-> ". $results->bounds->minx.", ".$results->bounds->miny.", ".$results->bounds->maxx.", ".$results->bounds->maxy ); if (MAPSERVER_VERSION < 50600) { $layer->close(); } } } $debug->log(__FUNCTION__." - at end"." - results->numresults = ".$results->numresults); return $results; } _ From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Ben Thompson Sent: Friday, June 10, 2011 11:06 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] query results lost Hello...we upgraded to the latest ms4w version 3.0.1 (MapServer and MapScript to 5.6.6 ) and some things went bad. after doing a $oLayer->queryByPoint which yields results (layer->numresults>0), a call to $map_object->saveQuery yields a file showing *no results*: MapServer Query - Generated by msSaveQuery() 1 1 33 -1 10718763.8336106 3518854.14068547 -1 0 -1 -1 -1 -1 -1 -1 1 NULL NULL -1 0 so I rewrote our code to avoid using that...a php is loaded into an iframe (frame.src=blablabla.php?xxx), in which the query results are accesed via $map_object->$oMapSession->oMap...all layers have ->numresults=0 anyone have a clue as to what went bad? the code worked fine in an older mapserver/mapscript... thanks, Ben _ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1382 / Virus Database: 1513/3692 - Release Date: 06/10/11 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query mode, multiple selections
I'm just starting to play with query mode and find it very useful. I have an interaction style in mind that would let me select and highlight several (possibly connected) links in a layer in a fairly interactive style (more like one would do with ArcGIS, I guess). I'm pretty sure that I won't be successful doing this with the basic CGI, and am overwhelmed by the number of Ajax layers that I might choose from. Are there documents/pages out there that might give me some guidance about what's possible with the various packages? Thanks, chris ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] query multiple layers
You can't do attribute queries on multiple layers at the same time, sorry. Steve -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Eric Weisbender Sent: Wednesday, March 24, 2010 4:00 PM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] query multiple layers I am querying one specific layer and values from that layer using qlayer, qitem, and qstring. e.g. qlayer=tline&qitem=name&qsting=happyjack. My questions would be how to do this on 2 specific layers at the same time/same query. Thanks, EW ___ 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] Query Regrading Map Srver & Grass,
NOw i want to start with the development using the grass tools. HI!! How could i use Grass in conjuction with the Map Server. I want to develop the client-server architecture, I want the map server should run on Server & n number of Client can request them .. Since I want to start with the developemt ,could u recommend any book for this..I am not able to find any books,,the books avaliable on the internet have the limited preview and they are not complete. could u please tell the following tasks could be accomplished in grass ?? 1.Import & Export Map(TF,GeoTif,IMG,DTED,SHP,BMP,DVD,DGN). 2.)Registration of Map-->Datum Used is wgs84. 3)Raster to Vector Conversion & Vice Versa 4) Create Layer 5)Grouping & Separation of Layers. 6) Hide/Unhide Layers. 7)Edit/Delete layers, 8)Stiching of Map. Please help me to resolve these queries, Thanks in Advance. -- Thanks & Regards Kunal Malik 09871147561 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MAPSERVER-USERS] Query length with mapscript.
I'd recommend you use queryByIndex with bAddToQuery=true to avoid this error I don't like 'in ()' operator at all)) Paul Moen-3 wrote: > > Is there a maximum length of the query text when setting a filter > with php mapscript? > > For example, > > I use > $tempLayer->setfilter('contract_id IN > (26,27,1093,608,596,134,111,36,37,4599,95,59,41,42,605,117,47,105,146,13 > 0,123,122,5017,98,66,67,68,69,133,71,131,74,75,76,77,148,94,81,82,108,97 > , > 85,86,4974,88,89,90,91,93,100,1956,124,125,140,145,141,139,157,152,154,1 > 56,158,5018,183,162,164,165,173,167,168,169,171,334,174,2083,184,177,743 > , > 182,186,187,188,332,190,2092,193,195,196,1107,199,200,201,202,203,205,20 > 6,5015,208,209,218,212,213,214,219,221,222,224,225,226,229,4695,232,235, > 238,239,241,244,245,246,247,2015,251,2016,253,256,258,260,261,466,265,26 > 6,267,268,269,270,593,381,274,595,276,279,280,281,607,283,284,285,286,20 > 45,299,298,291,292,293,295,296,297,302,1955,304,306,333,309,310,311,385, > 316,318,3456,123)'); > > and I get the error > > PHP Warning: [MapServer Error]: prepare_database(): Error executing > POSTGIS DECLARE (the actual query) statement: 'DECLARE mycursor > BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d > (geom_pnt)),'NDR'),parcel_id::text from (select > parcel_id,county,contract_id,land_title_holder,parcel_location,ST_Centro > id(geom) as geom_pnt FROM parcels) as foo WHERE ((contract_id IN > (26,27,1093,608,596,134,111,36,37,4599,95,59,41,42,605,117,47,105,146,13 > 0,123,122,5017,98,66,67,68,69,133,71,131,74,75,76,77,148,94,81,82,108,97 > , > 85,86,4974,88,89,90,91,93,100,1956,124,125,140,145,141,139,157,152,154,1 > 56,158,5018,183,162,164,165,173,167,168,169,171,334,174,2083,184,177,743 > , > 182,186,187,188,332,190,2092,193,195,196,1107,199,200,201,202,203,205,20 > 6,5015,208,209,218,212,213,214,219,221,222,224,225,226,229,4695,232,235, > 238,239,241,244,245,246,247,2015,251,2016,253,256,258,260,261,466,265,26 > 6,267,268,269,270,593,381,274,595,276,279,280,281,607,283,284,285,286,20 > 45,299,298,291,292,293,295,296,297,302,1955,304,306,333,309,310,311,385, > 316,318,3 > > which truncates the sql statement. > > Is there a way to increase the length of the query allowed? > > Thanks, > > Paul > > ___ > mapserver-users mailing list > mapserver-users@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > -- View this message in context: http://www.nabble.com/Query-length-with-mapscript.-tp20026655p20027575.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] query template won't execute php
I haven't been able to find anything on this, so I'm hoping someone will have a suggestion or more information. I'd hoped to have a template call a php file rather than an html file on a query. It does bring up the file. Any regular html in the file loads okay, and javascript will run all right, but php code in the file doesn't do anything; even trivial php such as 'echo "Hi";'. The same php runs fine under other circumstances. Does it have anything to do with the way mapserve's query handles loading the html? ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Query result attribute sums / totals
G'day all, I have a straightforward query setup on a line layer showing movements between locations over a selected time period. When I select query mode, the data is returned beautifully (well, it's nice to see it!) # Date Species Number Purpose Origin Destination Movement id 1 07/07/2008 Cattle 40 Slaughter Luangprabang Vientiane Capital More Information 2 15/07/2008 Cattle 7 Sell To Middle Man Luangprabang Vientiane Capital More Information 3 27/07/2008 Cattle 5 Slaughter Luangprabang Vientiane Capital More Information etc However it would be really really great if the total Number over this time could be calculated as a total, and put in the footer row. (I have done this previously using mapscript, but for time reasons don't want to go there at the moment.) Is there an [attribute_sum] type of tag I can embed in the footer... or any other suggestions? cheers Ben -- Ben Madin REMOTE INFORMATION t : +61 8 9192 5455 f : +61 8 9192 5535 m : 0448 887 220 Broome WA 6725 b...@remoteinformation.com.au Out here, it pays to know... ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Query one return multiple
I don't think so. If feature ids are sequential you might be able to link to a query that would get you the next feature. Depends on what client environment you're using. You could do this with MapScript though. Steve From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Weisbender, Eric Sent: Wednesday, April 17, 2013 11:40 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] Query one return multiple Hello list, I was wondering if there is a way to query a point and return not only attributes for that point but the next points attribute in order in the dbf. Thanks in advance. Thanks, EW ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Query one return multiple
Do you have a quick example in MapScript that I might be able to use? Thanks, Eric Weisbender Western Area Power Administration Corporate Service Office U.S. Dept. of Energy office: (720) 962-7280 email: weisb...@wapa.gov<mailto:weisb...@wapa.gov> From: Lime, Steve D (MNIT) [mailto:steve.l...@state.mn.us] Sent: April 23, 2013 11:07 AM To: Weisbender, Eric; mapserver-users@lists.osgeo.org Subject: RE: Query one return multiple I don't think so. If feature ids are sequential you might be able to link to a query that would get you the next feature. Depends on what client environment you're using. You could do this with MapScript though. Steve From: mapserver-users-boun...@lists.osgeo.org<mailto:mapserver-users-boun...@lists.osgeo.org> [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Weisbender, Eric Sent: Wednesday, April 17, 2013 11:40 AM To: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> Subject: [mapserver-users] Query one return multiple Hello list, I was wondering if there is a way to query a point and return not only attributes for that point but the next points attribute in order in the dbf. Thanks in advance. Thanks, EW ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Query one return multiple
I don't have an example but I think you can just use index queries to build a larger result set: - Do a query that returns a single feature. - Use that features result index to do a series of layer queryByIndex() queries. There's an optional last argument that preserves the existing result set. - Process result set as you normally would using templates or just writing code against it. Steve From: Weisbender, Eric [mailto:weisb...@wapa.gov] Sent: Wednesday, April 24, 2013 8:24 AM To: Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org Subject: RE: Query one return multiple Do you have a quick example in MapScript that I might be able to use? Thanks, Eric Weisbender Western Area Power Administration Corporate Service Office U.S. Dept. of Energy office: (720) 962-7280 email: weisb...@wapa.gov<mailto:weisb...@wapa.gov> From: Lime, Steve D (MNIT) [mailto:steve.l...@state.mn.us] Sent: April 23, 2013 11:07 AM To: Weisbender, Eric; mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> Subject: RE: Query one return multiple I don't think so. If feature ids are sequential you might be able to link to a query that would get you the next feature. Depends on what client environment you're using. You could do this with MapScript though. Steve From: mapserver-users-boun...@lists.osgeo.org<mailto:mapserver-users-boun...@lists.osgeo.org> [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Weisbender, Eric Sent: Wednesday, April 17, 2013 11:40 AM To: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> Subject: [mapserver-users] Query one return multiple Hello list, I was wondering if there is a way to query a point and return not only attributes for that point but the next points attribute in order in the dbf. Thanks in advance. Thanks, EW ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query for ALL the layers
Hi All, I'm using a query from a MapInfo like this: DATA 'select * from sa_merged_01 where ogr_geometry = POLYGON or ogr_geometry = MULTIPOLYGON' Which select polygons and multipolygons from one single layer. My datasource have tens of layers (doing ogrinfo ./mydata/ I can see tens of layers)... How can I select all of them ? Any query that I can use ? thanks -- Sebastian E. Ovide ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Query "Unique Values" in Mapfile?
Hi there, is it possible to make mapserver directly detect the "unique values" in a field of the dbf table? I have twenty or more point and polygon shapefiles, each having a column with specific thematic data, such as the "protected area category". But the content of these columns is different. So, defining these classes by hand would consume much time; and defining them dynamically via PHP & SQL, then writing a bit of the mapfile code before launching the whole thing looks a little bit complicated for a relative basic request. Thanks for any hints, Stef ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] query mode, multiple selections
You'd be surprised with what you can do with the CGI backend. It's certainly possible, with the right web client (e.g. something like GeoMoose or OpenLayers) to craft queries against the CGI to select one or many features from one or many layers using a point, box or arbitrary geometry. Perhaps if you could sketch out a use case or two... Steve >>> On 9/1/2009 at 12:49 PM, in message <4a9d5e9d.9000...@speedgauge.net>, Chris Kantarjiev wrote: > I'm just starting to play with query mode and find it very useful. I have an > interaction style in > mind that would let me select and highlight several (possibly connected) > links in a layer in a > fairly interactive style (more like one would do with ArcGIS, I guess). I'm > pretty sure that I won't > be successful doing this with the basic CGI, and am overwhelmed by the > number of Ajax layers that I > might choose from. > > Are there documents/pages out there that might give me some guidance about > what's possible with the > various packages? > > Thanks, > chris > ___ > 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] query mode, multiple selections
Sure. The basic use case is: User navigates to a particular, known, lat/lon as starting point; this can be by entering the known lat/lon values, or by navigation around cities. User then selects one or more links and can inspect attributes associated with those links - in particular, link_id and direction. Initial selection could be by sweeping out an area, but should also provide a way of adding/removing specific links from the selection (control-select). Did that makes sense? chris Steve Lime wrote: You'd be surprised with what you can do with the CGI backend. It's certainly possible, with the right web client (e.g. something like GeoMoose or OpenLayers) to craft queries against the CGI to select one or many features from one or many layers using a point, box or arbitrary geometry. Perhaps if you could sketch out a use case or two... Steve On 9/1/2009 at 12:49 PM, in message <4a9d5e9d.9000...@speedgauge.net>, Chris Kantarjiev wrote: I'm just starting to play with query mode and find it very useful. I have an interaction style in mind that would let me select and highlight several (possibly connected) links in a layer in a fairly interactive style (more like one would do with ArcGIS, I guess). I'm pretty sure that I won't be successful doing this with the basic CGI, and am overwhelmed by the number of Ajax layers that I might choose from. Are there documents/pages out there that might give me some guidance about what's possible with the various packages? Thanks, chris ___ 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] query mode, multiple selections
Hi We use the back end CGI extensively and it is extremely fast. It is simply a case of being able to define what type of constraint you want against each layer (tolerance etc) - I'm normally surprised if mapserver takes more than a second or two to query up to 20-30 individual layers... Hope this reassures! Mike 2009/9/1 Chris Kantarjiev > Sure. The basic use case is: > > User navigates to a particular, known, lat/lon as starting point; this can > be by entering the known lat/lon values, or by navigation around cities. > > User then selects one or more links and can inspect attributes associated > with those links - in particular, link_id and direction. Initial selection > could be by sweeping out an area, but should also provide a way of > adding/removing specific links from the selection (control-select). > > Did that makes sense? > > chris > > > Steve Lime wrote: > >> You'd be surprised with what you can do with the CGI backend. It's >> certainly possible, with the right >> web client (e.g. something like GeoMoose or OpenLayers) to craft queries >> against the CGI to select >> one or many features from one or many layers using a point, box or >> arbitrary geometry. Perhaps if >> you could sketch out a use case or two... >> >> Steve >> >> On 9/1/2009 at 12:49 PM, in message <4a9d5e9d.9000...@speedgauge.net>, > Chris > Kantarjiev wrote: >> >>> I'm just starting to play with query mode and find it very useful. I have >>> an interaction style in mind that would let me select and highlight several >>> (possibly connected) links in a layer in a fairly interactive style (more >>> like one would do with ArcGIS, I guess). I'm pretty sure that I won't be >>> successful doing this with the basic CGI, and am overwhelmed by the number >>> of Ajax layers that I might choose from. >>> >>> Are there documents/pages out there that might give me some guidance >>> about what's possible with the various packages? >>> >>> Thanks, >>> chris >>> ___ >>> 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 mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query template item tag question
Hello everyone, I'm using a query template to return results of a getfeatureinfo request. One of the attributes is a URL and I would like to format it with an anchor tag if a value exists, and display nothing if a value does not exist. So far I've tried: [item name=park_url format="Park Website: $value" escape=html] The problem with the above is that the format string comes out exactly as written rather than as html. Can someone point me in the right direction? Thanks, Jennifer ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Query functions with Oracle Spatial
Hello! I tried to execute a query function through an interface. Appeared in the logfile: [Mon Apr 05 11:09:19 2010] msOracleSpatialLayerGetShape .621000 (): OracleSpatial error. Error parsing OracleSpatial DATA is variable query. To execute query functions you need to define one unique column [USING UNIQUE <# column>] I added the ID column, and now appears in the logfile: [Mon Apr 05 11:11:47 2010] .358000 msOracleSpatialLayerGetShape (): OracleSpatial error. Error: ORA-00932: inconsistent datatypes: expected %s returned %s. Query statement: SELECT ID, NBLOCK, SECTOR, BLOCK, ORIGIN, TYPE, NAME, SUPERCOURT, COURTS, OBSERVATION, AREA, REASON, DATA, REGISTRATION, SE_ANNO_CAD_DATA, SHAPE FROM LOTS WHERE ID = 43,192. Check your statement date. What can it be? It worked in some cases. The columns are apparently right... There may be some incompatibility factor? Thanks! -- Daiane ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Query functions with Oracle Spatial
Mike, I'm using version 5.0.2. This version is the one that works in the application I'm using (incompatibilities...). But if this is the problem, so I at least know what direction to take. This explains why the tables that do not contain the field SE_ANNO_CAD_DATA have no trouble. Thank you for your help! Note: Sorry for my errors in the English ... I am new in this language... -- Daiane ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Query data in tileindex problem
I'm drawing county parcel data using a tileindex layer definition that points to the parcel polys. When I Query a parcel I get the following error. Failed to draw layer named 'parcel' msDBFReadAttribute(): DBASE file error. Invalid field index 0. We just upgraded to Mapserver 5.6.3 from 4.10 where it was working fine. Any help or ideas would be greatly appreciated. Thanks, EW ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Query all layers with blank qlayer?
Hi everyone, I'm running into trouble when I try to use ItemQuery and ItemNQuery with a blank qlayer. Does the 5.0 release still support querying all layers in this way? If not, what's the current method? I haven't been able to find anything aside from Bill Kropla's text and the online list of CGI controls, which states: If (qlayer) not specified then all layers are searched in turn. However, if I leave qlayer blank in my input form, or enter it in the url with no value, I get the following: mapserv(): Web application error. Query layer not set or references an invalid layer. I do have some layers which are displayed but not queryable (no templates defined), do all layers have to be queryable before this method will work? Thanks! -Gabe Emerson ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Query result attribute sums / totals
On Fri, Jan 9, 2009 at 12:51 AM, Ben Madin wrote: > G'day all, > > I have a straightforward query setup on a line layer showing movements > between locations over a selected time period. > > When I select query mode, the data is returned beautifully (well, it's nice > to see it!) > > # DateSpecies Number Purpose Origin >Destination Movement id > 1 07/07/2008 Cattle 40 Slaughter Luangprabang > Vientiane Capital More Information > 2 15/07/2008 Cattle 7 Sell To Middle Man Luangprabang >Vientiane Capital More Information > 3 27/07/2008 Cattle 5 Slaughter Luangprabang > Vientiane Capital More Information > > etc > > However it would be really really great if the total Number over this time > could be calculated as a total, and put in the footer row. > > (I have done this previously using mapscript, but for time reasons don't > want to go there at the moment.) > > Is there an [attribute_sum] type of tag I can embed in the footer... or any > other suggestions? > You could easily calculate the sum with JavaScript in the browser. Declare a variable "total" and then for each row, within a JavaScript tag, something like: total += [Number] -- Richard Greenwood richard.greenw...@gmail.com www.greenwoodmap.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Query result attribute sums / totals
G'day Richard, On 09/01/2009, at 10:30 PM, Richard Greenwood wrote: On Fri, Jan 9, 2009 at 12:51 AM, Ben Madin > wrote: However it would be really really great if the total Number over this time could be calculated as a total, and put in the footer row. You could easily calculate the sum with JavaScript in the browser. Declare a variable "total" and then for each row, within a JavaScript tag, something like: total += [Number] thank you - works perfectly! (and knowing this works opens up enormous opportunities for enhancing the output) cheers Ben -- Ben Madin REMOTE INFORMATION t : +61 8 9192 5455 f : +61 8 9192 5535 m : 0448 887 220 Broome WA 6725 b...@remoteinformation.com.au Out here, it pays to know... ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] query for ALL the layers
Do all the files share exactly the same set of attributes? If yes then you could use a TILEINDEX (or create a Seamless Table in MapInfo) to load them all as part of the same layer. If the attributes definitions differ from file to file then I fear you're out of luck. Sebastian E. Ovide wrote: > Hi All, > > I'm using a query from a MapInfo like this: > > DATA 'select * from sa_merged_01 where ogr_geometry = POLYGON or > ogr_geometry = MULTIPOLYGON' > > Which select polygons and multipolygons from one single layer. > > My datasource have tens of layers (doing ogrinfo ./mydata/ I can see > tens of layers)... How can I select all of them ? Any query that I can use ? > > thanks > > > -- > Sebastian E. Ovide > > > > > > > > ___ > 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
Re: [mapserver-users] Query "Unique Values" in Mapfile?
I'm not aware of any support for this in MapServer, however by using MapScript you could create script to iterate the features and add new classes to a layer on each unique combination. Then you could save the mapfile for further editing if required. Best regards, Tamas 2009/4/6 Stefan Schwarzer > Hi there, > > is it possible to make mapserver directly detect the "unique values" in a > field of the dbf table? I have twenty or more point and polygon shapefiles, > each having a column with specific thematic data, such as the "protected > area category". But the content of these columns is different. So, defining > these classes by hand would consume much time; and defining them dynamically > via PHP & SQL, then writing a bit of the mapfile code before launching the > whole thing looks a little bit complicated for a relative basic request. > > Thanks for any hints, > > Stef > ___ > 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] Query feature using openlayers and mapserver
Dear all, I might open a topic in a wrong forum, because I do not know whether I should ask this question in Mapserver or OpenLayers forum. If I did, I feel sorry about that. I want to query the layer with using openlayers. However, I do not know how to 'call' the templates from mapfile to the html file.I have found topics about query using mapserver and openlayers, but I have still no idea how to code in html file. The query function is fine when using mapserver alone. In the mapfile, I have put metadata into web like this: WEB HEADER "/ms4w/Apache/htdocs/web_header.html" FOOTER "/ms4w/Apache/htdocs/web_footer.html" EMPTY "empty.html" Metadata "wms_title" "WMS" "wms_onlineresource" "http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/Apache/htdocs/test.map&"; "wms_srs" "EPSG:4269" "wms_feature_info_mime_type" "text/html" END template "/ms4w/Apache/htdocs/web.html" imagepath "/ms4w/Apache/htdocs/tmp/" imageurl "/tmp/" END PROJECTION "init=epsg:4269" END And in the layer, data from postgresql postgis (with attribute ID) was used with metadata: Name "Abc" metadata "wms_title" "Abc" "wms_srs" "EPSG:4269" End . I also have put header footer in layer and template in the class Class Name "abc" Template "/ms4w/Apache/htdocs/query.html" .. END The code in html file: var layer = new OpenLayers.Layer.MapServer( "ABC WMS", "http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/Apache/htdocs/test.map&";, {layers: 'Abc'} ); I tried {layers: 'Abc', mode: 'query', params ='ID'} but it did not work. I found an example of query: http://www.co.sweet.wy.us/mapserver/map.html I want to query the layer by a click instead of dragging and a new window come out to display information. How can I make this in html file? Furthermore, I find many examples using new OpenLayers.Layer.WMS. But when I use it, it displays nothing. I can only use new OpenLayers.Layer.MapServer to display map. What is the problem? Thanks, Aypes -- View this message in context: http://n2.nabble.com/Query-feature-using-openlayers-and-mapserver-tp3910093p3910093.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] query template item tag question
Escape=html, I believe, will escape HTML entities into readable text (preventing cross-site scripting) so I think what you're seeing is correct. If you don't want escaping try escape=none instead. Steve >>> On 11/17/2009 at 1:48 PM, in message <675141.34479...@web83405.mail.sp1.yahoo.com>, Jennifer Shanks wrote: > Hello everyone, > > I'm using a query template to return results of a getfeatureinfo request. > One of the attributes is a URL and I would like to format it with an anchor > tag if a value exists, and display nothing if a value does not exist. So far > I've tried: > > [item name=park_url format="Park Website: >$value" escape=html] > > The problem with the above is that the format string comes out exactly as > written rather than as html. Can someone point me in the right direction? > > Thanks, > Jennifer > ___ > 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] query in ka-map with mapserver
Hi all, I know that this question is more about ka-map rather than MapServer, however I have not got what I want from that mailing-list yet. So I want to get some suggestion here. I am really anxious about ka-map query and search now. In my mapfile I configured a layer as follows and it displayed a city's boundary constituted of 68 lines. Then I think it is valid to select some of the lines and get their id from the table where the_geo DATA is stored in my database. However, when I finished the query just get "no matching results". I have read the script file "map_query_float.php" and found nothing special. Maybe it is because of the ka-map scripts? Thank you for any clues. 1、a querable layer of my mapfile LAYER METADATA 'queryable' 'true' “fields” "bound_id:BID" "searchfield" "gid" END TEMPLATEnoexit.html NAME xzqj_x group "xzqj" STATUS ON TYPE line CONNECTIONTYPE POSTGIS CONNECTION "dbname=*** host=*** user=*** password=*** port=***" DATA "the_geom from xzqj_x" #labelitem cname CLASS NAMExzqj_x STYLE symbol dashed1 size3 color 100 100 100 END END END 2、part of the script file map_query_float.php in ka-map: if ($q_type == 0) $check_query = $oLayer->queryByPoint($point, MS_MULTIPLE, -1); else $check_query = $oLayer->queryByRect($rect); // if ($check_query == MS_SUCCESS) { if ($check_query == 1) { echo "Layer Name: " . $oLayer->name . ""; $totR = $oLayer->getNumResults(); if($max_results_per_layer < $totR) echo "results: $max_results_per_layer of $totR (limited output)results: $totR"; //output is "results:0" -- 天道酬勤 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Query functions with Oracle Spatial
Daiane, What version of Mapserver are you using? I suspect a version before 5.4 ( I think that is when it changed ). The SE_ANNO_CAD_DATA field is a BLOB and not a supported return type for queries. You can either upgrade to a newer version of Mapserver which excludes BLOB fields or you can write a view to exclude that column and query the view. Mike -- Michael Smith RSGIS Center US Army Corps of Engineers On 4/5/10 12:33 PM, "Daiane Azevedo de Fraga" wrote: > Hello! > > I tried to execute a query function through an interface. Appeared in the > logfile: > [Mon Apr 05 11:09:19 2010] msOracleSpatialLayerGetShape .621000 (): > OracleSpatial error. Error parsing OracleSpatial DATA is variable query. To > execute query functions you need to define one unique column [USING UNIQUE <# > column>] > > I added the ID column, and now appears in the logfile: > [Mon Apr 05 11:11:47 2010] .358000 msOracleSpatialLayerGetShape (): > OracleSpatial error. Error: ORA-00932: inconsistent datatypes: expected %s > returned %s. Query statement: SELECT ID, NBLOCK, SECTOR, BLOCK, ORIGIN, TYPE, > NAME, SUPERCOURT, COURTS, OBSERVATION, AREA, REASON, DATA, REGISTRATION, > SE_ANNO_CAD_DATA, SHAPE FROM LOTS WHERE ID = 43,192. Check your statement > date. > > What can it be? It worked in some cases. The columns are apparently right... > There may be some incompatibility factor? > > Thanks! > > -- > Daiane > > > > > ___ > 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] Query data in tileindex problem
Perhaps there's an actual fix someone else knows about, I have only a comment: * If you were using tileindexes as a performance boost, you can move to a single unified shapefile, since the performance issues that used to require tileindexes as a workaround were removed in 5.4. Best, P On Tue, Jun 22, 2010 at 3:46 PM, Eric Weisbender wrote: > I'm drawing county parcel data using a tileindex layer definition that > points to the parcel polys. When I Query a parcel I get the following > error. Failed to draw layer named 'parcel' msDBFReadAttribute(): DBASE file > error. Invalid field index 0. We just upgraded to Mapserver 5.6.3 from 4.10 > where it was working fine. Any help or ideas would be greatly appreciated. > > Thanks, > EW > ___ > 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] Query all layers with blank qlayer?
Attribute queries have been tied to an individual layer for some time now although I don't recall what version started to strictly enforce this. The docs need an update I'm afraid... Steve >>> On 7/21/2008 at 2:54 PM, in message <[EMAIL PROTECTED]>, "Emerson, Gabe" <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm running into trouble when I try to use ItemQuery and ItemNQuery with > a blank qlayer. Does the 5.0 release still support querying all layers > in this way? If not, what's the current method? I haven't been able to > find anything aside from Bill Kropla's text and the online list of CGI > controls, which states: > > If (qlayer) not specified then all layers are searched in turn. > > However, if I leave qlayer blank in my input form, or enter it in the > url with no value, I get the following: > > mapserv(): Web application error. Query layer not set or references an > invalid layer. > > I do have some layers which are displayed but not queryable (no > templates defined), do all layers have to be queryable before this > method will work? > > Thanks! > > -Gabe Emerson > > > > ___ > 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] Query feature using openlayers and mapserver
On Thu, Oct 29, 2009 at 1:13 AM, Aypes wrote: > > Dear all, > > I might open a topic in a wrong forum, because I do not know whether I > should ask this question in Mapserver or OpenLayers forum. If I did, I feel > sorry about that. > > I want to query the layer with using openlayers. However, I do not know how > to 'call' the templates from mapfile to the html file.I have found topics > about query using mapserver and openlayers, but I have still no idea how to > code in html file. The query function is fine when using mapserver alone. > > In the mapfile, I have put metadata into web like this: > WEB > HEADER "/ms4w/Apache/htdocs/web_header.html" > FOOTER "/ms4w/Apache/htdocs/web_footer.html" > EMPTY "empty.html" > Metadata > "wms_title" "WMS" > "wms_onlineresource" > "http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/Apache/htdocs/test.map&"; > "wms_srs" "EPSG:4269" > "wms_feature_info_mime_type" "text/html" > END > template "/ms4w/Apache/htdocs/web.html" > imagepath "/ms4w/Apache/htdocs/tmp/" > imageurl "/tmp/" > END > PROJECTION > "init=epsg:4269" > END > > And in the layer, data from postgresql postgis (with attribute ID) was used > with metadata: > Name "Abc" > metadata > "wms_title" "Abc" > "wms_srs" "EPSG:4269" > End > . > > I also have put header footer in layer and template in the class > Class > Name "abc" > Template "/ms4w/Apache/htdocs/query.html" > .. > END > > The code in html file: > var layer = new OpenLayers.Layer.MapServer( "ABC WMS", > > "http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/Apache/htdocs/test.map&";, > {layers: 'Abc'} ); > I tried {layers: 'Abc', mode: 'query', params ='ID'} but it did not work. > > I found an example of query: http://www.co.sweet.wy.us/mapserver/map.html > I want to query the layer by a click instead of dragging and a new window > come out to display information. > How can I make this in html file? > > Furthermore, I find many examples using new OpenLayers.Layer.WMS. But when I > use it, it displays nothing. I can only use new OpenLayers.Layer.MapServer > to display map. What is the problem? > Here is how I did it, and it worked for me (test for typing errors) Step 1: In the map file Step 1a: WEB WEB ,, # WMS server settings METADATA .. "wms_feature_info_mime_type""text/html" END END # WEB Step 1b: LAYER to be queried LAYER NAME 'layer_name' .. METADATA .. 'wms_include_items' "FiEld_NaMe" # field name is possibly # case-sensitive in the case of # shape files END # METADATA DUMP true HEADER "/absolute/path/to/template_header.html" TEMPLATE "/absolute/path/to/template_body.html" FOOTER "/absolute/path/to/template_footer.html" END # LAYER Step 2: In your HTML templates Step 2a: in template_header.html http://www.w3.org/TR/html4/transitional.dtd";> MapServer Template Sample Step 2b: in template_body.html FiEld_NaMe: [FiEld_NaMe] Step 2c: in template_footer.html Step 3: In your HTML file with OpenLayers code map.addControl( new OpenLayers.Control.WMSGetFeatureInfo( function() { return { url: "/url/to/mapserv", maxFeatures: 1, title: 'Identify features by clicking', queryVisible: true, layers: [layer_name], vendorParams: { map: "/absolute/path/to/mapfile" }, eventListeners: { getfeatureinfo: function(event) { map.addPopup( new OpenLayers.Popup.FramedCloud( "chicken", map.getLonLatFromPixel(event.xy), null, event.text, null, true ), true ); // map.addPopup } // getfeatureinfo } // eventListeners } // return } ) ).activate(); -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.ed
Re: [mapserver-users] Query feature using openlayers and mapserver
P Kishor wrote: > > On Thu, Oct 29, 2009 at 1:13 AM, Aypes wrote: > Here is how I did it, and it worked for me (test for typing errors) > > Step 1: In the map file > > Step 1a: WEB > > WEB > ,, > > # WMS server settings > METADATA > .. > "wms_feature_info_mime_type""text/html" > END > END # WEB > > Step 1b: LAYER to be queried > > LAYER > NAME 'layer_name' > .. > > METADATA >.. > 'wms_include_items' "FiEld_NaMe" # field name is possibly ># case-sensitive in the > case of ># shape files > END # METADATA > > DUMP true > HEADER "/absolute/path/to/template_header.html" > TEMPLATE "/absolute/path/to/template_body.html" > FOOTER "/absolute/path/to/template_footer.html" > END # LAYER > > Step 2: In your HTML templates > > Step 2a: in template_header.html > > > "http://www.w3.org/TR/html4/transitional.dtd";> > > > MapServer Template Sample > > > Step 2b: in template_body.html > > > FiEld_NaMe: [FiEld_NaMe] > > > Step 2c: in template_footer.html > > > > Step 3: In your HTML file with OpenLayers code > > map.addControl( > new OpenLayers.Control.WMSGetFeatureInfo( > function() { > return { > url: "/url/to/mapserv", > maxFeatures: 1, > title: 'Identify features by clicking', > queryVisible: true, > layers: [layer_name], > vendorParams: { > map: "/absolute/path/to/mapfile" > }, > eventListeners: { > getfeatureinfo: function(event) { > map.addPopup( > new OpenLayers.Popup.FramedCloud( > "chicken", > map.getLonLatFromPixel(event.xy), > null, > event.text, > null, > true > ), > true > ); // map.addPopup > } // getfeatureinfo > } // eventListeners > } // return > } > ) > ).activate(); > > > > -- > Puneet Kishor http://www.punkish.org > Carbon Model http://carbonmodel.org > Charter Member, Open Source Geospatial Foundation http://www.osgeo.org > Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor > Nelson Institute, UW-Madison http://www.nelson.wisc.edu > --- > Assertions are politics; backing up assertions with evidence is science > === > Sent from Madison, WI, United States > ___ > mapserver-users mailing list > mapserver-users@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > P Kishor, Thank you for answering. But I have some problems. I want to know that in map file, [TEMPLATE "/absolute/path/to/template_body.html"] is ouside or inside the class of the layer? Secondly, for the part map.addPopup( new OpenLayers.Popup.FramedCloud( "chicken", map.getLonLatFromPixel(event.xy), null,event.text, null, true) I just do not understand the structure of it even though I have searched it on Internet. Should "chicken" change to the layer name, and where/what is event.txt? Thirdly there is some problem on activate(). I got an error of 'map.addControl(...)' is null or not an object. If I detele activate(), it works without the getfeatureinfo property. But I have no idea on how to activate it. And I am using OpenLayers.layer.Mapserver to render map, not OperLayers.layer.WMS. Does new OpenLayers.Control. WMSGetFeatureInfo still work? Thanks, Aypes -- View this message in context: http://n2.nabble.com/Query-feature-using-openlayers-and-mapserver-tp3910093p3916619.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] 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-tp3910093p3936077.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
AW: [mapserver-users] Query feature using openlayers and mapserver
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
[mapserver-users] Query Error in getFeatureRequest on Oracle DB
Hello, I have a layer that gets its data from an Oracle database. The layer can be visualized without any problems. As soon as I send a getFeatureRequest, the following error message appears "msOracleSpatialLayerGetItems (): Query error. Can not retrieve column list " In the UMN log file are 2 SQLs. The one with the spatial SQL query works with the Oracle Developer and I get a result. Why doesn't get my UMN (version 5.2) any data? Thanks for your support! Regards Stefan Schantz # Ausschnitt Layerdefinition## LAYER NAME "aero_nukspez_cs137" STATUS ON DEBUG ON TYPE POINT PROJECTION "init=epsg:25832" END METADATA ... END DUMP TRUE CONNECTIONTYPE oraclespatial CONNECTION "***/***@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=***)(PORT= 1521)))(CONNECT_DATA=(SID=***)))" PROCESSING "CLOSE_CONNECTION=DEFER" DATA "GEOM from (SELECT geom, P_PROBE.PROBEENTNAHME_BEGINN, P_PROBE.PROBEENTNAHME_ENDE, S_MESSGROESSE.BEZEICHNUNG, to_char(P_MESSWERT.MESSWERT, '0.9') AS WERT, S_MESS_EINHEIT1.BEZEICHNUNG, P_MESSWERT.MESSFEHLER, P_PROBE.MITTELUNGSDAUER, S_NETZ_BETREIBER.BEZEICHNUNG, dwd_mess_utm.mst_id AS ID, P_ENTNAHMEORT.KOORD_X_UTM, P_ENTNAHMEORT.KOORD_Y_UTM, ((R_VORGANG.OID)-(255297803876564992)), R_VORGANG.AUSFUEHRUNGSDATUM, P_MESSUNG.STATUS_1, P_MESSUNG.STATUS_2, P_MESSUNG.STATUS_4, S_STATUS_BMU.BEZEICHNUNG, P_PROBE.IST_TESTDATENSATZ FROM dwd_mess_utm,IMIS.P_ENTNAHMEORT,IMIS.S_MESS_EINHEIT S_MESS_EINHEIT1,IMIS.S_MESSGROESSE,IMIS.S_STATUS_BMU,IMIS.P_MESSUNG,IMIS.S_NETZ_BETREIBER,IMIS.P_MESSWERT,IGS2.R_VORGANG_MESSUNG_P,IMIS.P_PROBE,IMIS.S_MESS_STELLE S_MESS_STELLE14,IGS2.R_VORGANG WHERE (R_VORGANG_MESSUNG_P.S_OID = R_VORGANG.OID(+) AND R_VORGANG_MESSUNG_P.T_PROBE_ID(+) = P_MESSUNG.PROBE_ID AND R_VORGANG_MESSUNG_P.T_MESSUNGS_ID(+) = P_MESSUNG.MESSUNGS_ID AND p_probe.mst_id = dwd_mess_utm.mst_id AND P_ENTNAHMEORT.PROBE_ID = P_PROBE.PROBE_ID AND P_MESSUNG.STATUS_5 = S_STATUS_BMU.STATUS_5 AND S_MESS_STELLE14.NETZBETREIBER_ID = S_NETZ_BETREIBER.NETZBETREIBER_ID AND P_MESSUNG.PROBE_ID = P_PROBE.PROBE_ID AND P_MESSWERT.MESSGROESSE_ID = S_MESSGROESSE.MESSGROESSE_ID AND P_ENTNAHMEORT.PROBE_ID = P_PROBE.PROBE_ID AND P_PROBE.MST_ID = S_MESS_STELLE14.MST_ID AND P_MESSWERT.PROBE_ID = P_MESSUNG.PROBE_ID AND P_MESSWERT.MESSUNGS_ID = P_MESSUNG.MESSUNGS_ID AND P_MESSWERT.MEH_ID = S_MESS_EINHEIT1.MEH_ID AND (P_PROBE.UMW_ID IN ('L31')) AND (P_MESSWERT.MESSGROESSE_ID IN (373)) AND (P_ENTNAHMEORT.STAAT_ID IN (0)) AND (P_PROBE.DATENBASIS_ID IN (1)) AND (P_PROBE.NETZBETREIBER_ID IN ('W')) AND P_PROBE.PROBEENTNAHME_BEGINN = TO_DATE('16.12.2009 06:00','DD.MM. HH24:MI'))) USING UNIQUE ID SRID 25832" TEMPLATE "../templates/getFeature_ODL.html" ... ###end layer definition### # MS LOGFILE## [Fri Dec 18 08:36:05 2009].932804 msOracleSpatialLayerClose. Cleaning Oracle Cache. [Fri Dec 18 08:36:05 2009].932814 msOracleSpatialLayerClose. Release the Oracle Pool. [Fri Dec 18 08:36:05 2009].932816 msConnPoolRelease(aero_nukspez_cs137,i/***@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=***)(PORT= 1521)))(CONNECT_DATA=(SID=***))),82368a8) [Fri Dec 18 08:36:05 2009].932981 msConnPoolClose(***/***@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=***)(PORT= 1521)))(CONNECT_DATA=(SID=***))),82368a8) [Fri Dec 18 08:36:06 2009].470320 msOracleSpatialLayerOpen called with: GEOM from (SELECT geom, P_PROBE.PROBEENTNAHME_BEGINN, P_PROBE.PROBEENTNAHME_ENDE, S_MESSGROESSE.BEZEICHNUNG, to_char(P_MESSWERT.MESSWERT, '0.9') AS WERT, S_MESS_EINHEIT1.BEZEICHNUNG, P_MESSWERT.MESSFEHLER, P_PROBE.MITTELUNGSDAUER, S_NETZ_BETREIBER.BEZEICHNUNG, dwd_mess_utm.mst_id AS ID, P_ENTNAHMEORT.KOORD_X_UTM, P_ENTNAHMEORT.KOORD_Y_UTM, ((R_VORGANG.OID)-(255297803876564992)), R_VORGANG.AUSFUEHRUNGSDATUM, P_MESSUNG.STATUS_1, P_MESSUNG.STATUS_2, P_MESSUNG.STATUS_4, S_STATUS_BMU.BEZEICHNUNG, P_PROBE.IST_TESTDATENSATZ FROM dwd_mess_utm,IMIS.P_ENTNAHMEORT,IMIS.S_MESS_EINHEIT S_MESS_EINHEIT1,IMIS.S_MESSGROESSE,IMIS.S_STATUS_BMU,IMIS.P_MESSUNG,IMIS.S_NETZ_BETREIBER,IMIS.P_MESSWERT,IGS2.R_VORGANG_MESSUNG_P,IMIS.P_PROBE,IMIS.S_MESS_STELLE S_MESS_STELLE14,IGS2.R_VORGANG WHERE (R_VORGANG_MESSUNG_P.S_OID = R_VORGANG.OID(+) AND R_VORGANG_MESSUNG_P.T_PROBE_ID(+) = P_MESSUNG.PROBE_ID AND R_VORGANG_MESSUNG_P.T_MESSUNGS_ID(+) = P_MESSUNG.MESSUNGS_ID AND p_probe.mst_id = dwd_mess_utm.mst_id AND
[mapserver-users] Query with template not working with complex query
Hi, A while back, I posted a question like this to the group, and got an answer that worked for me: http://lists.umn.edu/cgi-bin/wa?A2=ind0705&L=mapserver-users&D=0&O=D&T=0&P=5373 I was able to get correct results by making a simple query. Now, however, I need to use a more complex query to return results. The problem is this... I have a template and a map file with a layer that uses that template. When the DATA attribute is: DATA "the_geom from shp_prct" the query works fine and i get my template back appropriately filled out. When I use the more complex but equivalent formulation: DATA "the_geom from (select the_geom from shp_prct) as foo using unique the_geom using SRID=-1" The result is the following: Content-type: text/html > > > MapServer Message > > > > > Just to note, the query I really need isn't the second one verbatim, but uses the form of "select the geom from () as foo ...". I'm omitting the rest of the info assuming it isn't important at this time, but will supply it if someone thinks that it is key to solving this... Any ideas? Thanks, Matt -- It is from the wellspring of our despair and the places that we are broken that we come to repair the world. -- Murray Waas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Query in frame with mapserv-demo doesn't work
Hello All I´m new with MapServer.I´m trying to build my aplication based in mapserv-demo. All the examples of mapserv-demo works fine. I´ve made a copy of all the files and rename the aplication. I want to have the same results as Adds dhtml rubber-band box. I´ve adapted the index.html, the itasca_adds_dhtml.html(renamed plantilla.html) and itasca.map (renamed eielmap.) In itasca_adds_dhtml.html and itasca.map I just changed regarding the layers and the map coordinates and size. The index.html file I have adapted in this way, to have my starup file and not having to choose the template in the select: All works fine, the zoom bottons, the layers... except the query. When I do a query,into the bottom frame not show me anything, there is no error message of mapserver. The browser shows a message error: "no se puede encontrar la pagina web" "the web page is not found...", the url command is that this seems to be well: http://localhost/cgi-bin/mapserv.exe?mode=query&map=/ms4w/apps/eiel2/eielmap.map&imgext=642050+4192100+646950+4197000&imgxy=317+187&imgbox=317+187+317+187&imgsize=400+400&layers=ABASTECIMIENTO_A+MANZANAS Thanks in advance and sorry form my english. Begoña ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Query in frame with mapserv-demo doesn't work
I already have my layers definition with template... from Oscar ^_^ <[EMAIL PROTECTED]> hide details 7:57 pm (58 minutes ago) to Begoña Gonzalez <[EMAIL PROTECTED]> date Feb 13, 2008 7:57 PM subject Re: [mapserver-users] Query in frame with mapserv-demo doesn't work mailed-by gmail.com Hello Begoña, to do a query in a layer You must put it queryable. Configure a TEMPLATE in your layer definition to make your layer queryable. 2008/2/13, Begoña Gonzalez <[EMAIL PROTECTED]>: > > > - Hide quoted text - > Hello All > I´m new with MapServer.I´m trying to build my aplication based in > mapserv-demo. > All the examples of mapserv-demo works fine. I´ve made a copy of all the > files and rename the aplication. > I want to have the same results as Adds dhtml rubber-band box. > I´ve adapted the index.html, the itasca_adds_dhtml.html(renamed > plantilla.html) and itasca.map (renamed eielmap.) > In itasca_adds_dhtml.html and itasca.map I just changed regarding the layers > and the map coordinates and size. > The index.html file I have adapted in this way, to have my starup file and > not having to choose the template in the select: > > > > > > > > > > > > All works fine, the zoom bottons, the layers... except the query. > > When I do a query,into the bottom frame not show me anything, there is no > error message of mapserver. The browser shows a message error: > "no se puede encontrar la pagina web" "the web page is not found...", the url > command is that this seems to be well: > http://localhost/cgi-bin/mapserv.exe?mode=query&map=/ms4w/apps/eiel2/eielmap.map&imgext=642050+4192100+646950+4197000&imgxy=317+187&imgbox=317+187+317+187&imgsize=400+400&layers=ABASTECIMIENTO_A+MANZANAS > > > Thanks in advance and sorry form my english. > > Begoña ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[MAPSERVER-USERS] Query using template and WFS errorred on POSTGIS
Hello List, I want to try to get certain features-attribute information back from my postgis database via Mapserver. I tried this in 2 ways: Enabeling WFS in the mapfile and making a query layer. Both requests generate errors on the Postgis Database and i can't discover what is going wrong. This is the error I get: DECLARE CURSOR can only be used in transaction blocks When doing a WFS request, i get a bounding box (envelope), but no features back Error is in the logfile of the postgis. When doing a Query (nquery) i get the error in html back: Content-type: text/html writeLog(): Unable to access file. hierzo.log msPOSTGISLayerGetShape(): Query error. Error executing POSTGIS SQL statement (in FETCH ALL): DECLARE mycursor2 BINARY CURSOR FOR SELECT "gid"::text,"provincie"::text,"oid"::text,asbinary(force_collection(force_2d(the_geom)),'NDR') from prov2007 WHERE OID = 1 -ERROR: DECLARE CURSOR can only be used in transaction blocks More Help: msPOSTGISLayerRetrievePGVersion(): Query error. Error executing POSTGIS statement (msPOSTGISLayerRetrievePGVersion():select substring(version() from 12 for (position('on' in version()) - 13)) msPOSTGISLayerRetrievePGVersion(): Query error. Error executing POSTGIS statement (msPOSTGISLayerRetrievePGVersion():select substring(version() from 12 for (position('on' in version()) - 13)) msPOSTGISLayerRetrievePGVersion(): Query error. Error executing POSTGIS statement (msPOSTGISLayerRetrievePGVersion():select substring(version() from 12 for (position('on' in version()) - 13)) msPOSTGISLayerRetrievePGVersion(): Query error. Error executing POSTGIS statement (msPOSTGISLayerRetrievePGVersion():select substring(version() from 12 for (position('on' in version()) - 13)) msPOSTGISLayerRetrievePGVersion(): Query error. Error executing POSTGIS statement (msPOSTGISLayerRetrievePGVersion():select substring(version() from 12 for (position('on' in version()) - 13)) Both queries are also done with shapefile data, and that works fine. I get features back (wfs) or the template (nquery) is filled in correctly Below the parts of my mapfile and templates. Mapfile: LAYER NAME 'pr2007' TYPE POLYGON CONNECTIONTYPE postgis CONNECTION 'host=127.0.0.1 user=* dbname=*' DATA 'the_geom FROM pr2007' #DATA 'C:\Project\Downloads\OSM\Data\pr\pr2007' PROCESSING "CLOSE_CONNECTION=DEFER"METADATA 'ows_title' 'prov2007' "ows_abstract" "" "ows_keywordlist" """gml_featureid" "gid" ## REQUIRED "gml_include_items" "all" ## Optional (serves all attributes for layer)"ows_srs" "EPSG:28992" # "queryable" "true" "wfs_geometry_element_name" "the_geom""wfs_extent" "12500 38 28 55" END#DUMP TRUE STATUS ON #DEFAULT #opacity 100 PROJECTION "init=epsg:28992" END HEADER "imapheader.html"FOOTER "imapfooter.html" CLASS COLOR 0 0 0 TEMPLATE "bodytemplate.html" END END query template: http://www.*.nl/pr.hml?ID=[pr]> Versions i use: PostgreSQL + postgis 8.3 Mapserver: MS4W : 5.2.0 Or FWtools: 5.3-dev All on localhost, so no firewall/security issues whatsoever. What is the possible mistake i make? Any possible plugins or settings wrong in database? Greetings and thanks for help. Gerben -- View this message in context: http://www.nabble.com/Query-using-template-and-WFS-errorred-on-POSTGIS-tp20012197p20012197.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: AW: [mapserver-users] Query feature using openlayers and mapserver
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
[mapserver-users] query by point results in IE vs. Firefox
Query by point works fine in IE, but in Firefox it actually returns a point about half an inch (screen units) north of the one selected. (see link below) Any ideas? Thanks! Jenny http://www.plantconservation.us/map.phtml ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Query in frame with mapserv-demo doesn't work
Please include the text of your map file. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Begoña Gonzalez Sent: Wednesday, February 13, 2008 2:00 PM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] Query in frame with mapserv-demo doesn't work I already have my layers definition with template... from Oscar ^_^ <[EMAIL PROTECTED]> hide details 7:57 pm (58 minutes ago) to Begoña Gonzalez <[EMAIL PROTECTED]> date Feb 13, 2008 7:57 PM subject Re: [mapserver-users] Query in frame with mapserv-demo doesn't work mailed-by gmail.com Hello Begoña, to do a query in a layer You must put it queryable. Configure a TEMPLATE in your layer definition to make your layer queryable. 2008/2/13, Begoña Gonzalez <[EMAIL PROTECTED]>: > > > - Hide quoted text - > Hello All > I´m new with MapServer.I´m trying to build my aplication based in > mapserv-demo. All the examples of mapserv-demo works fine. I´ve made a > copy of all the files and rename the aplication. I want to have the > same results as Adds dhtml rubber-band box. I´ve adapted the > index.html, the itasca_adds_dhtml.html(renamed plantilla.html) and > itasca.map (renamed eielmap.) In itasca_adds_dhtml.html and itasca.map > I just changed regarding the layers and the map coordinates and size. > The index.html file I have adapted in this way, to have my starup file > and not having to choose the template in the select: > > > > > > > > > > > > All works fine, the zoom bottons, the layers... except the query. > > When I do a query,into the bottom frame not show me anything, there is > no error message of mapserver. The browser shows a message error: "no > se puede encontrar la pagina web" "the web page is not found...", the > url command is that this seems to be well: > http://localhost/cgi-bin/mapserv.exe?mode=query&map=/ms4w/apps/eiel2/e > ielmap.map&imgext=642050+4192100+646950+4197000&imgxy=317+187&imgbox=3 > 17+187+317+187&imgsize=400+400&layers=ABASTECIMIENTO_A+MANZANAS > > > Thanks in advance and sorry form my english. > > Begoña ___ 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] Query in frame with mapserv-demo doesn't work
hello david This is my map file, I send you only one layer but the others are similars: MAP NAME EIEL STATUS ON SIZE 600 600 IMAGETYPE PNG IMAGECOLOR 249 249 249 EXTENT 643925 4192100 645075 4197000 TEMPLATEPATTERN "eiel" UNITS METERS IMAGETYPE PNG SHAPEPATH "datos" SYMBOLSET "c:/ms4w/apps/eiel2/etc/symbols.sym" FONTSET "c:/ms4w/apps/eiel2/etc/fonts.txt" WEB HEADER templates/header.html TEMPLATE "/ms4w/apps/eiel2/plantilla.html" FOOTER templates/footer.html MINSCALE 1000 MAXSCALE 155 IMAGEPATH "/ms4w/tmp/ms_tmp/" IMAGEURL "/ms_tmp/" EMPTY "/eiel/VACIO.html" END LAYER NAME "ABASTECIMIENTO_A" STATUS ON TYPE POINT CONNECTIONTYPE oraclespatial CONNECTION "***/[EMAIL PROTECTED]" DATA "GEOLOC FROM ***. USING UNIQUE MI_PRINX SRID 82337" CLASS STYLE SYMBOL "rechteck-hoch" COLOR 150 0 0 SIZE 15 OUTLINECOLOR 150 0 0 END TEMPLATE "templates/ABASTECIMIENTO_A.html" END END #I have more layers but similars than previous SCALEBAR IMAGECOLOR 249 249 249 STATUS ON LABEL COLOR 0 0 0 ANTIALIAS ON SIZE TINY END UNITS METERS POSITION LR SIZE 150 3 INTERVALS 3 TRANSPARENT TRUE STYLE 1 END REFERENCE STATUS ON IMAGE "ref/carto.gif" SIZE 160 110 EXTENT 644125 4192100 647275 4199000 COLOR -1 -1 -1 OUTLINECOLOR 255 0 0 MINBOXSIZE 5 MARKERSIZE 8 MARKER 'star' END # # Start of legend # LEGEND KEYSIZE 18 12 LABEL TYPE BITMAP SIZE MEDIUM COLOR 0 0 89 END STATUS ON END END END Thanks On Wed, Feb 13, 2008 at 9:10 PM, Fawcett, David <[EMAIL PROTECTED]> wrote: > Please include the text of your map file. > > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Begoña Gonzalez > Sent: Wednesday, February 13, 2008 2:00 PM > To: mapserver-users@lists.osgeo.org > Subject: [mapserver-users] Query in frame with mapserv-demo doesn't work > > > I already have my layers definition with template... > > > from Oscar ^_^ <[EMAIL PROTECTED]> hide details 7:57 pm (58 minutes ago) > to Begoña Gonzalez <[EMAIL PROTECTED]> > date Feb 13, 2008 7:57 PM > subject Re: [mapserver-users] Query in frame with mapserv-demo doesn't work > mailed-by gmail.com > > > Hello Begoña, to do a query in a layer You must put it queryable. Configure a > TEMPLATE in your layer definition to make your layer queryable. > > > 2008/2/13, Begoña Gonzalez <[EMAIL PROTECTED]>: > > > > > > - Hide quoted text - > > Hello All > > I´m new with MapServer.I´m trying to build my aplication based in > > mapserv-demo. All the examples of mapserv-demo works fine. I´ve made a > > copy of all the files and rename the aplication. I want to have the > > same results as Adds dhtml rubber-band box. I´ve adapted the > > index.html, the itasca_adds_dhtml.html(renamed plantilla.html) and > > itasca.map (renamed eielmap.) In itasca_adds_dhtml.html and itasca.map > > I just changed regarding the layers and the map coordinates and size. > > The index.html file I have adapted in this way, to have my starup file > > and not having to choose the template in the select: > > > > > > > > > > > > > > > value="/ms4w/apps/eiel2/eielmap.map"> > > > > > > > > > > All works fine, the zoom bottons, the layers... except the query. > > > > When I do a query,into the bottom frame not show me anything, there is > > no error message of mapserver. The browser shows a message error: "no > > se puede encontrar la pagina web" "the web page is not found...", the > > url command is that this seems to be well: > > http://localhost/cgi-bin/mapserv.exe?mode=query&map=/ms4w/apps/eiel2/e > > ielmap.map&imgext=642050+4192100+646950+4197000&imgxy=317+187&imgbox=3 > > 17+187+317+187&imgsize=400+400&layers=ABASTECIMIENTO_A+MANZANAS > > > > > > Thanks in advance and sorry form my english. > > > > Begoña > ___ > 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] Query in frame with mapserv-demo doesn't work
Hello Finally I fixed it. The problem was a mixture of things, first the line: EMPTY "/eiel/VACIO.html" in my WEB object and a bad coordinate realignment. I don´t know why the reference of VACIO.html file was lost and because my wrong coords mapserver never found records... Add in WEB object the LOG optional File to log MapServer activity in helped me to solve it. Thanks On Thu, Feb 14, 2008 at 9:02 AM, Begoña Gonzalez <[EMAIL PROTECTED]> wrote: > hello david > > This is my map file, I send you only one layer but the others are similars: > > MAP > NAME EIEL > STATUS ON > SIZE 600 600 > IMAGETYPE PNG > IMAGECOLOR 249 249 249 > EXTENT 643925 4192100 645075 4197000 > TEMPLATEPATTERN "eiel" > UNITS METERS > IMAGETYPE PNG > SHAPEPATH "datos" > SYMBOLSET "c:/ms4w/apps/eiel2/etc/symbols.sym" > FONTSET "c:/ms4w/apps/eiel2/etc/fonts.txt" > > > WEB > HEADER templates/header.html > TEMPLATE "/ms4w/apps/eiel2/plantilla.html" > FOOTER templates/footer.html > MINSCALE 1000 > MAXSCALE 155 > IMAGEPATH "/ms4w/tmp/ms_tmp/" > IMAGEURL "/ms_tmp/" > EMPTY "/eiel/VACIO.html" > END > > LAYER > NAME "ABASTECIMIENTO_A" > STATUS ON > TYPE POINT > CONNECTIONTYPE oraclespatial > CONNECTION "***/[EMAIL PROTECTED]" > DATA "GEOLOC FROM ***. USING UNIQUE MI_PRINX SRID 82337" > CLASS > STYLE >SYMBOL "rechteck-hoch" >COLOR 150 0 0 >SIZE 15 >OUTLINECOLOR 150 0 0 > END > TEMPLATE "templates/ABASTECIMIENTO_A.html" > END > > END > > #I have more layers but similars than previous > > SCALEBAR > IMAGECOLOR 249 249 249 > STATUS ON > LABEL > COLOR 0 0 0 > ANTIALIAS ON > SIZE TINY > END > UNITS METERS > POSITION LR > SIZE 150 3 > INTERVALS 3 > TRANSPARENT TRUE > STYLE 1 > END > > > REFERENCE > STATUS ON > IMAGE "ref/carto.gif" > SIZE 160 110 > EXTENT 644125 4192100 647275 4199000 > COLOR -1 -1 -1 > OUTLINECOLOR 255 0 0 > MINBOXSIZE 5 > MARKERSIZE 8 > MARKER 'star' > END > > # > # Start of legend > # > LEGEND >KEYSIZE 18 12 >LABEL > TYPE BITMAP > SIZE MEDIUM > COLOR 0 0 89 > END >STATUS ON > END > > END > > END > > > > Thanks > > > > On Wed, Feb 13, 2008 at 9:10 PM, Fawcett, David > <[EMAIL PROTECTED]> wrote: > > Please include the text of your map file. > > > > > > -Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Begoña > > Gonzalez > > Sent: Wednesday, February 13, 2008 2:00 PM > > To: mapserver-users@lists.osgeo.org > > Subject: [mapserver-users] Query in frame with mapserv-demo doesn't work > > > > > > I already have my layers definition with template... > > > > > > from Oscar ^_^ <[EMAIL PROTECTED]> hide details 7:57 pm (58 minutes ago) > > to Begoña Gonzalez <[EMAIL PROTECTED]> > > date Feb 13, 2008 7:57 PM > > subject Re: [mapserver-users] Query in frame with mapserv-demo doesn't work > > mailed-by gmail.com > > > > > > Hello Begoña, to do a query in a layer You must put it queryable. Configure > > a TEMPLATE in your layer definition to make your layer queryable. > > > > > > 2008/2/13, Begoña Gonzalez <[EMAIL PROTECTED]>: > > > > > > > > > - Hide quoted text - > > > Hello All > > > I´m new with MapServer.I´m trying to build my aplication based in > > > mapserv-demo. All the examples of mapserv-demo works fine. I´ve made a > > > copy of all the files and rename the aplication. I want to have the > > > same results as Adds dhtml rubber-band box. I´ve adapted the > > > index.html, the itasca_adds_dhtml.html(renamed plantilla.html) and > > > itasca.map (renamed eielmap.) In itasca_adds_dhtml.html and itasca.map > > > I just changed regarding the layers and the map coordinates and size. > > > The index.html file I have adapted in this way, to have my starup file > > > and not having to choose the template in the select: > > > > > > > > > > > > > > > > > > > > > > > value="/ms4w/apps/eiel2/eielmap.map"> > > > > > > > > > > > > > > > All works fine, the zoom bottons, the layers... except the query. > > &
Re: [MAPSERVER-USERS] Query using template and WFS errorred on POSTGIS
Hi Gerben, not sure if this is the reason why but I noticed that under the layer block you set Data as ' DATA 'the_geom FROM pr2007' ', I think you need a "USING UNIQUE" clause in there to specify which column in the table can act as a unique identifier and maybe an srid clause as well to specify the projection of the postgis table. For instance USING UNIQUE ogc_fid USING SRID =32633. (Where ogc_fid is the unique identifier in my postgis table and 32633 is the EPSG code of the table data) Try appending these clauses to the 'Data' line in your layer block and see what happens. G. Tiemens wrote: > > Hello List, > > I want to try to get certain features-attribute information back from my > postgis database via Mapserver. > > I tried this in 2 ways: > Enabeling WFS in the mapfile and making a query layer. > > Both requests generate errors on the Postgis Database and i can't discover > what is going wrong. > > > > Both queries are also done with shapefile data, and that works fine. I get > features back (wfs) or the template (nquery) is filled in correctly > > > Below the parts of my mapfile and templates. > > Mapfile: > LAYER NAME 'pr2007' TYPE POLYGON CONNECTIONTYPE postgis > CONNECTION 'host=127.0.0.1 user=* dbname=*' DATA 'the_geom > FROM pr2007' #DATA 'C:\Project\Downloads\OSM\Data\pr\pr2007' > PROCESSING "CLOSE_CONNECTION=DEFER" METADATA 'ows_title' > 'prov2007' "ows_abstract" "" "ows_keywordlist" "" > "gml_featureid" > "gid" ## REQUIRED "gml_include_items" "all" ## Optional (serves all > attributes for layer) "ows_srs" "EPSG:28992" # "queryable" > "true" > "wfs_geometry_element_name" "the_geom" "wfs_extent" "12500 38 > 28 55" END #DUMP TRUE STATUS ON #DEFAULT #opacity > 100 PROJECTION"init=epsg:28992" END HEADER > "imapheader.html" > FOOTER "imapfooter.html" CLASS COLOR 0 0 0 TEMPLATE > "bodytemplate.html" END END > > > > > > -- View this message in context: http://www.nabble.com/Query-using-template-and-WFS-errorred-on-POSTGIS-tp20012197p20014232.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] Query using template and WFS errorred on POSTGIS
Hello Thomas, Thanks for your answer, It was sure the right answer. I did try it with unique, but forgot the srid. It works now for both query and wfs. Strange that WMS and just type=map requests will work without these unique and srid statements. Thanks! Gerben Tiemens -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Tellett Verzonden: Thursday, October 16, 2008 4:00 PM Aan: mapserver-users@lists.osgeo.org Onderwerp: Re: [MAPSERVER-USERS] Query using template and WFS errorred on POSTGIS Hi Gerben, not sure if this is the reason why but I noticed that under the layer block you set Data as ' DATA 'the_geom FROM pr2007' ', I think you need a "USING UNIQUE" clause in there to specify which column in the table can act as a unique identifier and maybe an srid clause as well to specify the projection of the postgis table. For instance USING UNIQUE ogc_fid USING SRID =32633. (Where ogc_fid is the unique identifier in my postgis table and 32633 is the EPSG code of the table data) Try appending these clauses to the 'Data' line in your layer block and see what happens. G. Tiemens wrote: > > Hello List, > > I want to try to get certain features-attribute information back from > my postgis database via Mapserver. > > I tried this in 2 ways: > Enabeling WFS in the mapfile and making a query layer. > > Both requests generate errors on the Postgis Database and i can't > discover what is going wrong. > > > > Both queries are also done with shapefile data, and that works fine. I > get features back (wfs) or the template (nquery) is filled in > correctly > > > Below the parts of my mapfile and templates. > > Mapfile: > LAYER NAME 'pr2007' TYPE POLYGON CONNECTIONTYPE postgis > CONNECTION 'host=127.0.0.1 user=* dbname=*' DATA 'the_geom > FROM pr2007' #DATA 'C:\Project\Downloads\OSM\Data\pr\pr2007' > PROCESSING "CLOSE_CONNECTION=DEFER" METADATA 'ows_title' > 'prov2007' "ows_abstract" "" "ows_keywordlist" "" > "gml_featureid" > "gid" ## REQUIRED "gml_include_items" "all" ## Optional (serves all > attributes for layer) "ows_srs" "EPSG:28992" # "queryable" > "true" > "wfs_geometry_element_name" "the_geom" "wfs_extent" "12500 38 > 28 55" END #DUMP TRUE STATUS ON #DEFAULT #opacity > 100 PROJECTION"init=epsg:28992" END HEADER > "imapheader.html" > FOOTER "imapfooter.html" CLASS COLOR 0 0 0 TEMPLATE > "bodytemplate.html" END END > > > > > > -- View this message in context: http://www.nabble.com/Query-using-template-and-WFS-errorred-on-POSTGIS-tp20012197p20014232.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 << Please read our E-mail Disclaimer at the Grontmij Corporate website >> ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] query in postgis works but in mapfile failed, why??
Hello, I have my db in postgis and I get the data from it through my mapfile, these work perfectly for instance: DATA'geom FROM heat_flux_point USING UNIQUE fid USING UNIQUE SRID=4326' DATA'geom FROM (SELECT fid,contour,geom FROM sar_contour_line WHERE contour=-600) AS FOO USING UNIQUE fid USING UNIQUE SRID=4326' but now I'm trying to get the intersection between two line geometries and show the output in my html: mop=# select seismic_line.profile from seismic_line, sar_contour_line where seismic_line.geom && sar_contour_line.geom and intersects(seismic_line.geom,sar_contour_line.geom) and sar_contour_line.contour = -600 order by profile; This in postgis gives: profile -- 1017 1018 ...etc (354 rows) and the same in my mapfile gives nothing: DATA'geom FROM (SELECT seismic_line.fid,seismic_line.profile,seismic_line.geom FROM seismic_line, sar_contour_line WHERE seismic_line.geom && sar_contour_line.geom AND INTERSECTS(seismic_line.geom, sar_contour_line.geom) AND sar_contour_line.contour = -600) AS FOO USING UNIQUE fid USING UNIQUE SRID=4326' why?? Any support and hint are very welcome, Thanks in advance, Gery -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/query-in-postgis-works-but-in-mapfile-failed-why-tp6912309p6912309.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] query by point results in IE vs. Firefox
Anything browser related is most definitely an issue with your client environment/programming and not MapServer itself. Might be best to ask on that mailing list if one exists... Steve -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jeanette McBride Sent: Tuesday, January 19, 2010 5:30 PM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] query by point results in IE vs. Firefox Query by point works fine in IE, but in Firefox it actually returns a point about half an inch (screen units) north of the one selected. (see link below) Any ideas? Thanks! Jenny http://www.plantconservation.us/map.phtml ___ 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] Query-wrong results in IE8 if zoomsize is not 100%
Hi folks, a query at a point-shapefile gives unexpected results such as "msQueryByPoint(): Search returned no results. No matching record(s) found" if the zoom size of the Internet Explorer (8) is different then 100%. It seems like the coordinates you hit are different to the ones the MapServer is processing. This does not occur with Browsers like firefox. Any possibilities to avoid that ? Sorry if this is posted before - I just didn't find it. I use version 5.6.1 -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Query-wrong-results-in-IE8-if-zoomsize-is-not-100-tp6530144p6530144.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
AW: [mapserver-users] query in postgis works but in mapfile failed, why??
> and the same in my mapfile gives nothing: > > DATA'geom FROM (SELECT > seismic_line.fid,seismic_line.profile,seismic_line.geom FROM > seismic_line, > sar_contour_line WHERE seismic_line.geom && sar_contour_line.geom AND > INTERSECTS(seismic_line.geom, sar_contour_line.geom) AND > sar_contour_line.contour = -600) AS FOO USING UNIQUE fid USING UNIQUE > SRID=4326' > > why?? Should probably be "...) AS FOO USING UNIQUE fid USING SRID=4326'" - without the "UNIQUE" in front of "SRID". ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Query-wrong results in IE8 if zoomsize is not 100%
This sounds like a client issue, not a MapServer issue. What client are you using? David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Tipatino Sent: Wednesday, June 29, 2011 1:26 PM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] Query-wrong results in IE8 if zoomsize is not 100% Hi folks, a query at a point-shapefile gives unexpected results such as "msQueryByPoint(): Search returned no results. No matching record(s) found" if the zoom size of the Internet Explorer (8) is different then 100%. It seems like the coordinates you hit are different to the ones the MapServer is processing. This does not occur with Browsers like firefox. Any possibilities to avoid that ? Sorry if this is posted before - I just didn't find it. I use version 5.6.1 -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Query-wrong-results-in-IE8-if-zoomsize-is-not-100-tp6530144p6530144.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 in postgis works but in mapfile failed,why??
Thanks Andreas! your suggestion did the trick, thanks! Cheers, Gery > Subject: AW: [mapserver-users] query in postgis works but in mapfile > failed,why?? > Date: Thu, 20 Oct 2011 12:28:23 +0200 > From: andreas.eich...@sid.sachsen.de > To: gameji...@hotmail.com; mapserver-users@lists.osgeo.org > > > and the same in my mapfile gives nothing: > > > > DATA'geom FROM (SELECT > > seismic_line.fid,seismic_line.profile,seismic_line.geom FROM > > seismic_line, > > sar_contour_line WHERE seismic_line.geom && sar_contour_line.geom AND > > INTERSECTS(seismic_line.geom, sar_contour_line.geom) AND > > sar_contour_line.contour = -600) AS FOO USING UNIQUE fid USING UNIQUE > > SRID=4326' > > > > why?? > > Should probably be "...) AS FOO USING UNIQUE fid USING SRID=4326'" - > without the "UNIQUE" in front of "SRID". ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Query on WFS Layer: Fatal error: [MapServer Error]: msQueryByShape(): No matching record(s) found
Hi list, I have a big problem on querying a WFS layer. Here you find both script and layer definition on mapfile. The problem is that $result->shapeindex has value 0 and I get the error: "Fatal error: [MapServer Error]: msQueryByShape(): No matching record(s) found." Any suggestions? Best regards Francesco - SCRIPT - $qresult = @$layer->queryByRect($myrect); //get all results $numResults = $layer->getNumResults(); for ($i=0; $i < $numResults; $i++) { $result = $layer->getResult($i); $layer->open(); $shape = $layer->getFeature($result->shapeindex); $layer->close(); } - MAPFILE LAYER DEFINITION - LAYER NAME "parchiGR" GROUP "Grigioni" TYPE POLYGON STATUS DEFAULT CONNECTIONTYPE WFS CONNECTION "http://mapserver1.gr.ch/wfs/wildruhezonen?"; CLASSITEM "beschlussjahr" METADATA "wfs_typename" "Eidg_Jagdbanngebiete_und_Schweizerischer_Nationalpark" "wfs_version" "1.0.0" "wfs_request_method""GET" "wfs_connectiontimeout" "100" "wfs_maxfeatures" "1000" END DUMP TRUE PROJECTION "init=epsg:21781" END CLASS NAME "anno 2004" EXPRESSION "2004" COLOR 159 255 159 OUTLINECOLOR 250 20 10 TEMPLATE "templates/default.html" END CLASS NAME "anno 1980" EXPRESSION "1980" COLOR 140 198 255 OUTLINECOLOR 250 20 10 TEMPLATE "templates/default.html" END CLASS NAME "altro anno" COLOR 192 192 192 OUTLINECOLOR 250 20 10 TEMPLATE "templates/default.html" END END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users