RE: [mapserver-users] RE: Highlight
Have been think about this and just wanted to run this passed anyone that is listening. For my GPS tracking I am using an ovf file to grab XY coordinates from a database and plot them in my app. I was wondering if I could do a similar thing, where I write to the database in PHP every time the query is run. This will populate a table with the PID values I need highlighted. Then Classify in the Map file the color and outline that I am after. Could I use a filter on the Map file then to just show records in the database? Is this even possible or make sense? OVF File (but select the PID values from the table) MYSQL:coordinates_database,user=Jay,password=Passw0rd,host=127.0.0.1,port=3306,tables=coordinates SELECT X,Y FROM coordinates wkbPoint MAP FILE LAYER # Points from the MySQL Database NAME Database STATUS DEFAULT TYPE POLYGON CONNECTIONTYPE OGR CONNECTION './Coordinatedata1.ovf' DATA 'Coordinatedata' CLASS #NAME "ID" STYLE OUTLINECOLOR 204 204 204 WIDTH 1 END END END -Original Message- From: Steve Lime [mailto:steve.l...@dnr.state.mn.us] Sent: Tuesday, April 14, 2009 4:18 PM To: Jay Kapalczynski; mapserver-users@lists.osgeo.org; Paul T.' 'Moen; David' 'Fawcett Subject: RE: [mapserver-users] RE: Highlight This is an example of how to highlight a feature (click on a dot in the application I sent) without doing query maps or anything like that. You're manipulating a layer filter on-the-fly based on your search result. This can work with multiple results but is best suited to just a few results. With more than that you really need to look at some other way to cache features- a queryfile or some sort of a temp table. Sorry if I've confused things. Steve >>> On 4/14/2009 at 3:23 PM, in message , Jay Kapalczynski wrote: > I am having a hard time trying to understand how that applies to what I am > doingI do appreciate the help here. > Just trying to find a solution here... > >>From my main page I run a query in PHP that returns specific records > I then move to a different web page that has a couple frames. > I display the map in one frame and build a table in the 2nd frame that shows > the results. > In the table I have a field that will zoom to and identify that feature in > the main map > > The only thing I am missing is after I run the query none of the parcels are > highlighted in the map... > I want to create the table and highlight the returned parcels in the map... > > Getting pretty confused right now...dont know the best way to accomplish > this...going in 4 different directions right now.. > The Query is being done in PHP, so I somehow need to take that result (comma > delimited string) and get a the PID values from that to show up highlighted > in my map.. > > Before I go on does anyone have a suggestion as to what would be the best > course of action... > Like Steve said, Like I am doing... > > Thanks Guys...you help is appreciated... > > > > > > -Original Message- > From: Fawcett, David [mailto:david.fawc...@state.mn.us] > Sent: Tuesday, April 14, 2009 2:39 PM > To: Jay Kapalczynski; Steve Lime; mapserver-users@lists.osgeo.org; Paul T.' > 'Moen > Subject: RE: [mapserver-users] RE: Highlight > > Steve is using CGI MapServer instead of php. > > When you click on a station, you will notice that the outline of the > station turns yellow. > > Here is the URL to a tile with a highlighted symbol on it: > http://maps.dnr.state.mn.us/cgi-bin/mapserv52?map=/usr/local/mapserver/a > pps/waters/csg/csg.map&layers=active_site&map_transparent=true&id=0&mode > =map&map_imagetype=png&station=63023001&mapext=-27687.5+4793250+941687.5 > +5480750&imgext=-27687.5+4793250+941687.5+5480750&map_size=705+500&imgx= > 352.5&imgy=250&imgxy=705+500 > > Notice that he has a layer called 'active_site' and he is passing in the > station ID use in a class in that layer to turn only that feature > yellow. > > When no station is selected, no stations are drawn in the 'active_site' > layer. > > David. > > -Original Message- > From: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jay > Kapalczynski > Sent: Tuesday, April 14, 2009 2:30 PM > To: 'Steve Lime'; mapserver-users@lists.osgeo.org; Paul T.' 'Moen > Subject: RE: [mapserver-users] RE: Highlight > > > Thanksbut little c
RE: [mapserver-users] RE: Highlight
Steve no worrieswasnt trying to shoot your idea down...I am using something similar in another layer and it works great.. All thoughts are welcome...I was thinking about this last night... There has to be a way to take a selection set from a query and have that highlight features of an existing shapefile from PHP Just have to find it...Thanks again Steve for your thoughts and help..they are greatly appreciated... -Original Message- From: Steve Lime [mailto:steve.l...@dnr.state.mn.us] Sent: Tuesday, April 14, 2009 4:18 PM To: Jay Kapalczynski; mapserver-users@lists.osgeo.org; Paul T.' 'Moen; David' 'Fawcett Subject: RE: [mapserver-users] RE: Highlight This is an example of how to highlight a feature (click on a dot in the application I sent) without doing query maps or anything like that. You're manipulating a layer filter on-the-fly based on your search result. This can work with multiple results but is best suited to just a few results. With more than that you really need to look at some other way to cache features- a queryfile or some sort of a temp table. Sorry if I've confused things. Steve >>> On 4/14/2009 at 3:23 PM, in message , Jay Kapalczynski wrote: > I am having a hard time trying to understand how that applies to what I am > doingI do appreciate the help here. > Just trying to find a solution here... > >>From my main page I run a query in PHP that returns specific records > I then move to a different web page that has a couple frames. > I display the map in one frame and build a table in the 2nd frame that shows > the results. > In the table I have a field that will zoom to and identify that feature in > the main map > > The only thing I am missing is after I run the query none of the parcels are > highlighted in the map... > I want to create the table and highlight the returned parcels in the map... > > Getting pretty confused right now...dont know the best way to accomplish > this...going in 4 different directions right now.. > The Query is being done in PHP, so I somehow need to take that result (comma > delimited string) and get a the PID values from that to show up highlighted > in my map.. > > Before I go on does anyone have a suggestion as to what would be the best > course of action... > Like Steve said, Like I am doing... > > Thanks Guys...you help is appreciated... > > > > > > -Original Message- > From: Fawcett, David [mailto:david.fawc...@state.mn.us] > Sent: Tuesday, April 14, 2009 2:39 PM > To: Jay Kapalczynski; Steve Lime; mapserver-users@lists.osgeo.org; Paul T.' > 'Moen > Subject: RE: [mapserver-users] RE: Highlight > > Steve is using CGI MapServer instead of php. > > When you click on a station, you will notice that the outline of the > station turns yellow. > > Here is the URL to a tile with a highlighted symbol on it: > http://maps.dnr.state.mn.us/cgi-bin/mapserv52?map=/usr/local/mapserver/a > pps/waters/csg/csg.map&layers=active_site&map_transparent=true&id=0&mode > =map&map_imagetype=png&station=63023001&mapext=-27687.5+4793250+941687.5 > +5480750&imgext=-27687.5+4793250+941687.5+5480750&map_size=705+500&imgx= > 352.5&imgy=250&imgxy=705+500 > > Notice that he has a layer called 'active_site' and he is passing in the > station ID use in a class in that layer to turn only that feature > yellow. > > When no station is selected, no stations are drawn in the 'active_site' > layer. > > David. > > -----Original Message- > From: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jay > Kapalczynski > Sent: Tuesday, April 14, 2009 2:30 PM > To: 'Steve Lime'; mapserver-users@lists.osgeo.org; Paul T.' 'Moen > Subject: RE: [mapserver-users] RE: Highlight > > > Thanksbut little confused as to what I am look at... > > How is this working? > > > > -Original Message- > From: Steve Lime [mailto:steve.l...@dnr.state.mn.us] > Sent: Tuesday, April 14, 2009 1:02 PM > To: Jay Kapalczynski; mapserver-users@lists.osgeo.org; Paul T.' 'Moen > Subject: RE: [mapserver-users] RE: Highlight > > This is probably too late to be of use but I've been using a highlight > layer to achieve this. The layer takes input from a URL so that layer > filter allows just the desired feature through. Works quite nicely and > is relatively simple to implement. Here's an OpenLayers site that uses > this: > > http://www.dnr.state.mn.us/waters/csg/index_copy.html > > In this case the highlight is a separate layer but you could just as > easi
RE: [mapserver-users] RE: Highlight
Alright I am getting a return now...but it is returning everything selected...so it seems that my query is not working for some reason... If I uncomment if($test == MS_SUCCESS) then I get an error...so the query is not working What can be causing this? What am I doing wrong here...is there a piece that I am missing I echo the query string and I get a "1" ?? echo "Query:".$test; This line returns "Query: 1" PHP CODE: # Include the GeoMOOSE PHP Library Utilities include('Configuration.php'); include('geomoose_php_util.php'); $map = ms_newMapObj('/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/select_Highlight.map'); $map->selectOutputFormat('jpeg'); $qlayer = $map->getLayerByName('Parcels'); $test = $qlayer->queryByAttributes("PID","PID IN ('121190012',121190003)",MS_MULTIPLE); //if($test == MS_SUCCESS) echo "Query:".$test; $img = $map->drawQuery(); $image_url=$img->saveWebImage(); Select_highlight.map file LAYER # Parcels Polygon Layer NAME 'Parcels' DATA 'parcels/parcels.shp' STATUS ON TYPE POLYGON TEMPLATE 'parcels/select_parcels.html' FILTERITEM 'PID' #FILTER /^%id%/ METADATA qstring_validation_pattern '.' END HEADER 'parcels/select_header.html' TEMPLATE 'parcels/select_parcel.html' FOOTER 'parcels/select_footer.html' TOLERANCE 0 CLASS SYMBOL 'plainline' SIZE 3 COLOR -1 -1 -1 OUTLINECOLOR 255 255 0 END END From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jay Kapalczynski Sent: Tuesday, April 14, 2009 9:30 AM To: 'Moen, Paul T.' Cc: mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] RE: Highlight Thanks for the help and responseI think I am getting closer... I set up another php page...this page is getting the PID values sent to it via a session, I am using frames in this page It was the only way I could get the queries to work, the table to build...etc You can see the "session" code below...I echo it and all the correct PIDs are displayed so I know that I have passed to correctly. I added your code example... Note: the PID string is a comma delimited string of PID values I am pointing the frame to the PHP page and I get this, but no image. So part of my code is working String:0711922340036,0711922340038,0711922340039 But that's itthere is no jpeg... Again I am very green to thisthis is my first attempt to actually return an image... here... I tried to add this : for my reference library for the ms_newMapObj but I get errors... So I went back to the GeoMOOSE libraries...(As see below) No errors but no image dl('php_mapscript.so'); I am going to try and post this on their site but help is hard to find... Anyone else out here on the MapServer page mess around with GeoMOOSE... THANK YOU MOEN for your help it is very appreciated.. From: Moen, Paul T. [mailto:pm...@nd.gov] Sent: Monday, April 13, 2009 3:22 PM To: Jay Kapalczynski Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Highlight On 4/13/09 2:25 PM, "Jay Kapalczynski" wrote: I am messing around with thisdoes any of this map sense? Yes, you have many errors. Check the error logs for php to help debugging with syntax. // THE QUERY HAPPENS BEFORE THISJUST SHOWING THAT THE VARAIBLE HOLDING ALL THE PIS VALUES IS BELOW //=== //=== // BUILD A COMMAN DELIMITED LIST // if something already in $PIDString, append a comma if (isset($PIDString)) $PIDString .= ','; // Append the new value $PIDString .= $PID; //=== //=== } // end while //=== //=== $map = ms_newMapObj(/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/select.map); Won't work because it requires a string, so you would need $map = ms_newMapObj('/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/select.map'); $qlayer = $map->$map->getLayerByName(parcels); Won't work because it
RE: [mapserver-users] RE: Highlight
This is an example of how to highlight a feature (click on a dot in the application I sent) without doing query maps or anything like that. You're manipulating a layer filter on-the-fly based on your search result. This can work with multiple results but is best suited to just a few results. With more than that you really need to look at some other way to cache features- a queryfile or some sort of a temp table. Sorry if I've confused things. Steve >>> On 4/14/2009 at 3:23 PM, in message , Jay Kapalczynski wrote: > I am having a hard time trying to understand how that applies to what I am > doingI do appreciate the help here. > Just trying to find a solution here... > >>From my main page I run a query in PHP that returns specific records > I then move to a different web page that has a couple frames. > I display the map in one frame and build a table in the 2nd frame that shows > the results. > In the table I have a field that will zoom to and identify that feature in > the main map > > The only thing I am missing is after I run the query none of the parcels are > highlighted in the map... > I want to create the table and highlight the returned parcels in the map... > > Getting pretty confused right now...dont know the best way to accomplish > this...going in 4 different directions right now.. > The Query is being done in PHP, so I somehow need to take that result (comma > delimited string) and get a the PID values from that to show up highlighted > in my map.. > > Before I go on does anyone have a suggestion as to what would be the best > course of action... > Like Steve said, Like I am doing... > > Thanks Guys...you help is appreciated... > > > > > > -Original Message- > From: Fawcett, David [mailto:david.fawc...@state.mn.us] > Sent: Tuesday, April 14, 2009 2:39 PM > To: Jay Kapalczynski; Steve Lime; mapserver-users@lists.osgeo.org; Paul T.' > 'Moen > Subject: RE: [mapserver-users] RE: Highlight > > Steve is using CGI MapServer instead of php. > > When you click on a station, you will notice that the outline of the > station turns yellow. > > Here is the URL to a tile with a highlighted symbol on it: > http://maps.dnr.state.mn.us/cgi-bin/mapserv52?map=/usr/local/mapserver/a > pps/waters/csg/csg.map&layers=active_site&map_transparent=true&id=0&mode > =map&map_imagetype=png&station=63023001&mapext=-27687.5+4793250+941687.5 > +5480750&imgext=-27687.5+4793250+941687.5+5480750&map_size=705+500&imgx= > 352.5&imgy=250&imgxy=705+500 > > Notice that he has a layer called 'active_site' and he is passing in the > station ID use in a class in that layer to turn only that feature > yellow. > > When no station is selected, no stations are drawn in the 'active_site' > layer. > > David. > > -----Original Message----- > From: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jay > Kapalczynski > Sent: Tuesday, April 14, 2009 2:30 PM > To: 'Steve Lime'; mapserver-users@lists.osgeo.org; Paul T.' 'Moen > Subject: RE: [mapserver-users] RE: Highlight > > > Thanks....but little confused as to what I am look at... > > How is this working? > > > > -Original Message- > From: Steve Lime [mailto:steve.l...@dnr.state.mn.us] > Sent: Tuesday, April 14, 2009 1:02 PM > To: Jay Kapalczynski; mapserver-users@lists.osgeo.org; Paul T.' 'Moen > Subject: RE: [mapserver-users] RE: Highlight > > This is probably too late to be of use but I've been using a highlight > layer to achieve this. The layer takes input from a URL so that layer > filter allows just the desired feature through. Works quite nicely and > is relatively simple to implement. Here's an OpenLayers site that uses > this: > > http://www.dnr.state.mn.us/waters/csg/index_copy.html > > In this case the highlight is a separate layer but you could just as > easily return a single map. > > Steve > >>>> On 4/13/2009 at 11:17 AM, in message > >, Jay Kapalczynski wrote: >> So say I have a Database that I am querying... >> I get the results back with a PID number (unique) >> This number exists in the Parcels Shapefile so I can go after that >> field. I have a map file that is set up for the Parcels, but this is >> just there to draw the Parcels... I assume that I would have to modify > >> this one for this to work? >> >> I am just a bit confused on how to get this to work... >> When I run the code that creates the Table below I want the parcels to > >> also &g
RE: [mapserver-users] RE: Highlight
I am having a hard time trying to understand how that applies to what I am doingI do appreciate the help here. Just trying to find a solution here... >From my main page I run a query in PHP that returns specific records I then move to a different web page that has a couple frames. I display the map in one frame and build a table in the 2nd frame that shows the results. In the table I have a field that will zoom to and identify that feature in the main map The only thing I am missing is after I run the query none of the parcels are highlighted in the map... I want to create the table and highlight the returned parcels in the map... Getting pretty confused right now...dont know the best way to accomplish this...going in 4 different directions right now.. The Query is being done in PHP, so I somehow need to take that result (comma delimited string) and get a the PID values from that to show up highlighted in my map.. Before I go on does anyone have a suggestion as to what would be the best course of action... Like Steve said, Like I am doing... Thanks Guys...you help is appreciated... -Original Message- From: Fawcett, David [mailto:david.fawc...@state.mn.us] Sent: Tuesday, April 14, 2009 2:39 PM To: Jay Kapalczynski; Steve Lime; mapserver-users@lists.osgeo.org; Paul T.' 'Moen Subject: RE: [mapserver-users] RE: Highlight Steve is using CGI MapServer instead of php. When you click on a station, you will notice that the outline of the station turns yellow. Here is the URL to a tile with a highlighted symbol on it: http://maps.dnr.state.mn.us/cgi-bin/mapserv52?map=/usr/local/mapserver/a pps/waters/csg/csg.map&layers=active_site&map_transparent=true&id=0&mode =map&map_imagetype=png&station=63023001&mapext=-27687.5+4793250+941687.5 +5480750&imgext=-27687.5+4793250+941687.5+5480750&map_size=705+500&imgx= 352.5&imgy=250&imgxy=705+500 Notice that he has a layer called 'active_site' and he is passing in the station ID use in a class in that layer to turn only that feature yellow. When no station is selected, no stations are drawn in the 'active_site' layer. David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jay Kapalczynski Sent: Tuesday, April 14, 2009 2:30 PM To: 'Steve Lime'; mapserver-users@lists.osgeo.org; Paul T.' 'Moen Subject: RE: [mapserver-users] RE: Highlight Thanksbut little confused as to what I am look at... How is this working? -Original Message- From: Steve Lime [mailto:steve.l...@dnr.state.mn.us] Sent: Tuesday, April 14, 2009 1:02 PM To: Jay Kapalczynski; mapserver-users@lists.osgeo.org; Paul T.' 'Moen Subject: RE: [mapserver-users] RE: Highlight This is probably too late to be of use but I've been using a highlight layer to achieve this. The layer takes input from a URL so that layer filter allows just the desired feature through. Works quite nicely and is relatively simple to implement. Here's an OpenLayers site that uses this: http://www.dnr.state.mn.us/waters/csg/index_copy.html In this case the highlight is a separate layer but you could just as easily return a single map. Steve >>> On 4/13/2009 at 11:17 AM, in message , Jay Kapalczynski wrote: > So say I have a Database that I am querying... > I get the results back with a PID number (unique) > This number exists in the Parcels Shapefile so I can go after that > field. I have a map file that is set up for the Parcels, but this is > just there to draw the Parcels... I assume that I would have to modify > this one for this to work? > > I am just a bit confused on how to get this to work... > When I run the code that creates the Table below I want the parcels to > also > highlight in the map > > Attached is my code that I am using to get the resulting PID Values, > build > the table, and populate the last frame showing the Comma Delimited String. > I just don't know how to apply that to my map? > > I attached my code from my PHP page which I hope that someone can at > least > put their eyes on... > Towards to bottom you will see highlighted in RED the code that I am > building a comma delimited string to populate a variable with all the PID > numbers... > I assume that I would not need the comma delimited string as I could place > the highlighting code inside the while loop to get the parcels highlighted... > I don't really know... > > Any thoughts? > > Thanks > > > This inside the while loop > > $map = ms_newMapObj(PATH TO YOU MAPFILE); > $qlayer = $map->$map->getLayerByName(NAME OF PARCEL LAYER); > $qlayer->queryByAttributes('PID','PID IN (MY COMMA DELIMITED STRING > VARIABLE')
RE: [mapserver-users] RE: Highlight
Steve is using CGI MapServer instead of php. When you click on a station, you will notice that the outline of the station turns yellow. Here is the URL to a tile with a highlighted symbol on it: http://maps.dnr.state.mn.us/cgi-bin/mapserv52?map=/usr/local/mapserver/a pps/waters/csg/csg.map&layers=active_site&map_transparent=true&id=0&mode =map&map_imagetype=png&station=63023001&mapext=-27687.5+4793250+941687.5 +5480750&imgext=-27687.5+4793250+941687.5+5480750&map_size=705+500&imgx= 352.5&imgy=250&imgxy=705+500 Notice that he has a layer called 'active_site' and he is passing in the station ID use in a class in that layer to turn only that feature yellow. When no station is selected, no stations are drawn in the 'active_site' layer. David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jay Kapalczynski Sent: Tuesday, April 14, 2009 2:30 PM To: 'Steve Lime'; mapserver-users@lists.osgeo.org; Paul T.' 'Moen Subject: RE: [mapserver-users] RE: Highlight Thanksbut little confused as to what I am look at... How is this working? -Original Message- From: Steve Lime [mailto:steve.l...@dnr.state.mn.us] Sent: Tuesday, April 14, 2009 1:02 PM To: Jay Kapalczynski; mapserver-users@lists.osgeo.org; Paul T.' 'Moen Subject: RE: [mapserver-users] RE: Highlight This is probably too late to be of use but I've been using a highlight layer to achieve this. The layer takes input from a URL so that layer filter allows just the desired feature through. Works quite nicely and is relatively simple to implement. Here's an OpenLayers site that uses this: http://www.dnr.state.mn.us/waters/csg/index_copy.html In this case the highlight is a separate layer but you could just as easily return a single map. Steve >>> On 4/13/2009 at 11:17 AM, in message , Jay Kapalczynski wrote: > So say I have a Database that I am querying... > I get the results back with a PID number (unique) > This number exists in the Parcels Shapefile so I can go after that > field. I have a map file that is set up for the Parcels, but this is > just there to draw the Parcels... I assume that I would have to modify > this one for this to work? > > I am just a bit confused on how to get this to work... > When I run the code that creates the Table below I want the parcels to > also > highlight in the map > > Attached is my code that I am using to get the resulting PID Values, > build > the table, and populate the last frame showing the Comma Delimited String. > I just don't know how to apply that to my map? > > I attached my code from my PHP page which I hope that someone can at > least > put their eyes on... > Towards to bottom you will see highlighted in RED the code that I am > building a comma delimited string to populate a variable with all the PID > numbers... > I assume that I would not need the comma delimited string as I could place > the highlighting code inside the while loop to get the parcels highlighted... > I don't really know... > > Any thoughts? > > Thanks > > > This inside the while loop > > $map = ms_newMapObj(PATH TO YOU MAPFILE); > $qlayer = $map->$map->getLayerByName(NAME OF PARCEL LAYER); > $qlayer->queryByAttributes('PID','PID IN (MY COMMA DELIMITED STRING > VARIABLE')',MS_MULTIPLE); $img = $map->drawQuery(); > header('Content-Type: image/jpeg'); > $img->saveImage(""); > > > [cid:image001.jpg@01C9BC29.7A1ECE10] > > From: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. > Sent: Thursday, April 09, 2009 3:15 PM > To: mapserver-users@lists.osgeo.org > Subject: Re: [mapserver-users] RE: Highlight > > > If the database that you are querying has the same attributes as the > shape > file, you can query the Layer that points to the shape file and display the > highlighted results on your map. I know nothing about GeoMOOSE but I know it > can be done with php-mapscript. > > Regardless of what you are using, you need a map file layer for the > shape > file with the parcels. > You will then need to use php-mapscript to query that layer with something > like > $map = ms_newMapObj(PATH TO YOU MAPFILE); > $qlayer = $map->$map->getLayerByName(NAME OF PARCEL LAYER); > $qlayer->queryByAttributes('PID','PID IN (1, 2,7,9,23,87)',MS_MULTIPLE); > You will then need to create the output image from query using something > like > $img = $map->drawQuery(); > header('Content-Type: image/jpeg'); > $img->s
RE: [mapserver-users] RE: Highlight
Thanksbut little confused as to what I am look at... How is this working? -Original Message- From: Steve Lime [mailto:steve.l...@dnr.state.mn.us] Sent: Tuesday, April 14, 2009 1:02 PM To: Jay Kapalczynski; mapserver-users@lists.osgeo.org; Paul T.' 'Moen Subject: RE: [mapserver-users] RE: Highlight This is probably too late to be of use but I've been using a highlight layer to achieve this. The layer takes input from a URL so that layer filter allows just the desired feature through. Works quite nicely and is relatively simple to implement. Here's an OpenLayers site that uses this: http://www.dnr.state.mn.us/waters/csg/index_copy.html In this case the highlight is a separate layer but you could just as easily return a single map. Steve >>> On 4/13/2009 at 11:17 AM, in message , Jay Kapalczynski wrote: > So say I have a Database that I am querying... > I get the results back with a PID number (unique) > This number exists in the Parcels Shapefile so I can go after that field. > I have a map file that is set up for the Parcels, but this is just there to > draw the Parcels... > I assume that I would have to modify this one for this to work? > > I am just a bit confused on how to get this to work... > When I run the code that creates the Table below I want the parcels to also > highlight in the map > > Attached is my code that I am using to get the resulting PID Values, build > the table, and populate the last frame showing the Comma Delimited String. > I just don't know how to apply that to my map? > > I attached my code from my PHP page which I hope that someone can at least > put their eyes on... > Towards to bottom you will see highlighted in RED the code that I am > building a comma delimited string to populate a variable with all the PID > numbers... > I assume that I would not need the comma delimited string as I could place > the highlighting code inside the while loop to get the parcels highlighted... > I don't really know... > > Any thoughts? > > Thanks > > > This inside the while loop > > $map = ms_newMapObj(PATH TO YOU MAPFILE); > $qlayer = $map->$map->getLayerByName(NAME OF PARCEL LAYER); > $qlayer->queryByAttributes('PID','PID IN (MY COMMA DELIMITED STRING > VARIABLE')',MS_MULTIPLE); > $img = $map->drawQuery(); > header('Content-Type: image/jpeg'); > $img->saveImage(""); > > > [cid:image001.jpg@01C9BC29.7A1ECE10] > > From: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. > Sent: Thursday, April 09, 2009 3:15 PM > To: mapserver-users@lists.osgeo.org > Subject: Re: [mapserver-users] RE: Highlight > > > If the database that you are querying has the same attributes as the shape > file, you can query the Layer that points to the shape file and display the > highlighted results on your map. I know nothing about GeoMOOSE but I know it > can be done with php-mapscript. > > Regardless of what you are using, you need a map file layer for the shape > file with the parcels. > You will then need to use php-mapscript to query that layer with something > like > $map = ms_newMapObj(PATH TO YOU MAPFILE); > $qlayer = $map->$map->getLayerByName(NAME OF PARCEL LAYER); > $qlayer->queryByAttributes('PID','PID IN (1, 2,7,9,23,87)',MS_MULTIPLE); > You will then need to create the output image from query using something > like > $img = $map->drawQuery(); > header('Content-Type: image/jpeg'); > $img->saveImage(""); > > I can't give you specifics without knowing how GeoMOOSE works, so the best > thing is to look at the documentation for GeoMOOSE if that is what you are > using. > > On 4/9/09 2:17 PM, "Jay Kapalczynski" > wrote: > Dang I misspoke...I am sorry... > > I am querying a Database for records, these records have a PID (unique > Number). > These are the records that show up in the Table. > > As this happens I have to take the results and run the query against the > parcels to get the features in the Shapefile, then highlight.. > > If that makes any sense... > > If I am in a PHP file and have the records returned from the query > (database)...what would I have to do next to take those records and run a > query to highlight the parcels (PID to PID)? > > Can all of this be accomplished in the PHP file? > > Thanks...and sorry for my ignorance... > > > > > From: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. > Sent: Thursday, April 09,
RE: [mapserver-users] RE: Highlight
This is probably too late to be of use but I've been using a highlight layer to achieve this. The layer takes input from a URL so that layer filter allows just the desired feature through. Works quite nicely and is relatively simple to implement. Here's an OpenLayers site that uses this: http://www.dnr.state.mn.us/waters/csg/index_copy.html In this case the highlight is a separate layer but you could just as easily return a single map. Steve >>> On 4/13/2009 at 11:17 AM, in message , Jay Kapalczynski wrote: > So say I have a Database that I am querying... > I get the results back with a PID number (unique) > This number exists in the Parcels Shapefile so I can go after that field. > I have a map file that is set up for the Parcels, but this is just there to > draw the Parcels... > I assume that I would have to modify this one for this to work? > > I am just a bit confused on how to get this to work... > When I run the code that creates the Table below I want the parcels to also > highlight in the map > > Attached is my code that I am using to get the resulting PID Values, build > the table, and populate the last frame showing the Comma Delimited String. > I just don't know how to apply that to my map? > > I attached my code from my PHP page which I hope that someone can at least > put their eyes on... > Towards to bottom you will see highlighted in RED the code that I am > building a comma delimited string to populate a variable with all the PID > numbers... > I assume that I would not need the comma delimited string as I could place > the highlighting code inside the while loop to get the parcels highlighted... > I don't really know... > > Any thoughts? > > Thanks > > > This inside the while loop > > $map = ms_newMapObj(PATH TO YOU MAPFILE); > $qlayer = $map->$map->getLayerByName(NAME OF PARCEL LAYER); > $qlayer->queryByAttributes('PID','PID IN (MY COMMA DELIMITED STRING > VARIABLE')',MS_MULTIPLE); > $img = $map->drawQuery(); > header('Content-Type: image/jpeg'); > $img->saveImage(""); > > > [cid:image001.jpg@01C9BC29.7A1ECE10] > > From: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. > Sent: Thursday, April 09, 2009 3:15 PM > To: mapserver-users@lists.osgeo.org > Subject: Re: [mapserver-users] RE: Highlight > > > If the database that you are querying has the same attributes as the shape > file, you can query the Layer that points to the shape file and display the > highlighted results on your map. I know nothing about GeoMOOSE but I know it > can be done with php-mapscript. > > Regardless of what you are using, you need a map file layer for the shape > file with the parcels. > You will then need to use php-mapscript to query that layer with something > like > $map = ms_newMapObj(PATH TO YOU MAPFILE); > $qlayer = $map->$map->getLayerByName(NAME OF PARCEL LAYER); > $qlayer->queryByAttributes('PID','PID IN (1, 2,7,9,23,87)',MS_MULTIPLE); > You will then need to create the output image from query using something > like > $img = $map->drawQuery(); > header('Content-Type: image/jpeg'); > $img->saveImage(""); > > I can't give you specifics without knowing how GeoMOOSE works, so the best > thing is to look at the documentation for GeoMOOSE if that is what you are > using. > > On 4/9/09 2:17 PM, "Jay Kapalczynski" > wrote: > Dang I misspoke...I am sorry... > > I am querying a Database for records, these records have a PID (unique > Number). > These are the records that show up in the Table. > > As this happens I have to take the results and run the query against the > parcels to get the features in the Shapefile, then highlight.. > > If that makes any sense... > > If I am in a PHP file and have the records returned from the query > (database)...what would I have to do next to take those records and run a > query to highlight the parcels (PID to PID)? > > Can all of this be accomplished in the PHP file? > > Thanks...and sorry for my ignorance... > > > > > From: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. > Sent: Thursday, April 09, 2009 1:57 PM > To: mapserver-users@lists.osgeo.org > Subject: Re: [mapserver-users] RE: Highlight > > Set the mapfile QUERYMAP style to highlight > http://mapserver.org/mapfile/querymap.html. Draw the map using drawQuery() > instead of draw(). > > $img = $map->drawQuery(); > header('Con
RE: [mapserver-users] RE: Highlight
Thanks for the help and responseI think I am getting closer... I set up another php page...this page is getting the PID values sent to it via a session, I am using frames in this page It was the only way I could get the queries to work, the table to build...etc You can see the "session" code below...I echo it and all the correct PIDs are displayed so I know that I have passed to correctly. I added your code example... Note: the PID string is a comma delimited string of PID values I am pointing the frame to the PHP page and I get this, but no image. So part of my code is working String:0711922340036,0711922340038,0711922340039 But that's itthere is no jpeg... Again I am very green to thisthis is my first attempt to actually return an image... here... I tried to add this : for my reference library for the ms_newMapObj but I get errors... So I went back to the GeoMOOSE libraries...(As see below) No errors but no image dl('php_mapscript.so'); I am going to try and post this on their site but help is hard to find... Anyone else out here on the MapServer page mess around with GeoMOOSE... THANK YOU MOEN for your help it is very appreciated.. $map->getLayerByName('parcels'); $qlayer->queryByAttributes('PID','PID IN ($PIDString)',MS_MULTIPLE); $img = $map->drawQuery(); $map->selectOutputFormat('jpeg'); header('Content-Type: image/jpeg'); $img->saveImage(""); $image_url=$img->saveWebImage(); ?> Displaying a map > From: Moen, Paul T. [mailto:pm...@nd.gov] Sent: Monday, April 13, 2009 3:22 PM To: Jay Kapalczynski Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Highlight On 4/13/09 2:25 PM, "Jay Kapalczynski" wrote: I am messing around with thisdoes any of this map sense? Yes, you have many errors. Check the error logs for php to help debugging with syntax. // THE QUERY HAPPENS BEFORE THISJUST SHOWING THAT THE VARAIBLE HOLDING ALL THE PIS VALUES IS BELOW //=== //=== // BUILD A COMMAN DELIMITED LIST // if something already in $PIDString, append a comma if (isset($PIDString)) $PIDString .= ','; // Append the new value $PIDString .= $PID; //=== //=== } // end while //=== //=== $map = ms_newMapObj(/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/select.map); Won't work because it requires a string, so you would need $map = ms_newMapObj('/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/select.map'); $qlayer = $map->$map->getLayerByName(parcels); Won't work because it requires a string and the layer in your mapfile is Parcels, so you would need $qlayer = $map->getLayerByName('Parcels'); $qlayer->queryByAttributes('PID','($PIDString)',MS_MULTIPLE); Won't work because it needs to know how to query for the PID as in $qlayer->queryByAttributes('PID','PID IN ($PIDString)',MS_MULTIPLE); $img = $map->drawQuery(); Should set the output format to jpeg $map->selectOutputFormat('jpeg'); header('Content-Type: image/jpeg'); $img->saveImage(""); Can I then test the jpeg in another window or something... You could set up your php file to accept $_GET variables and pass in the PIDs like below. http://yourserver.com/phpfilename.php?PID=1%2C2%2C3%2C4%2C5, which should give you a png image after making changes above. Is this all that I need code wise? That should give you the basics. You will also need to load the php_mapscript library before any of the above functions will be recognized. Check out http://mapserver.org/mapscript/php/by_example.html. There is an abundance of good documentation on http://mapserver.org. HERE is the select.map file MAP NAME 'all layers' SIZE 800 650 STATUS ON EXTENT 427632.50 4893613.33 560300.922104 5015936.68 UNITS METERS SYMBOLSET 'symbols/symbol.sym' TRANSPARENT TRUE IMAGETYPE PNG QUERYMAP STATUS ON STYLE SELECTED #STYLE HILITE END WEB IMAGEPATH "/ms4w/tmp/ms_tmp/" IMAGEURL "/ms_tmp/" #EMPTY '../geomoose/query_miss.html' END LAYER # Parcels Polygon Layer NAME
Re: [mapserver-users] RE: Highlight
On 4/14/09 9:30 AM, "Jay Kapalczynski" wrote: Thanks for the help and responseI think I am getting closer... I set up another php page...this page is getting the PID values sent to it via a session, I am using frames in this page It was the only way I could get the queries to work, the table to build...etc You can see the "session" code below...I echo it and all the correct PIDs are displayed so I know that I have passed to correctly. I added your code example... Note: the PID string is a comma delimited string of PID values I am pointing the frame to the PHP page and I get this, but no image. So part of my code is working String:0711922340036,0711922340038,0711922340039 Are your PIDs strings? If so, you will need your PIDs to have quotes around them when you query. $qlayer->queryByAttributes("PID","PID IN ('0711922340036','0711922340038','0711922340039')",MS_MULTIPLE); Note the double quotes. But that's itthere is no jpeg... Again I am very green to thisthis is my first attempt to actually return an image... here... I tried to add this : for my reference library for the ms_newMapObj but I get errors... So I went back to the GeoMOOSE libraries...(As see below) No errors but no image dl('php_mapscript.so'); I am going to try and post this on their site but help is hard to find... Anyone else out here on the MapServer page mess around with GeoMOOSE... THANK YOU MOEN for your help it is very appreciated.. selectOutputFormat('jpeg'); This should be before the draw. $qlayer = $map->$map->getLayerByName('parcels'); You have $map twice here. Should be $qlayer =$map->getLayerByName('parcels'); $test = $qlayer->queryByAttributes('PID','PID IN ($PIDString)',MS_MULTIPLE); Assign above to variable so you can compare it with MS_SUCCESS if($test == MS_SUCCESS) and check your error log for errors. $img = $map->drawQuery(); //header('Content-Type: image/jpeg'); //$img->saveImage(""); You don't need the 2 prior lines if you are saving the image to a file and loading it via an image tag like you are below. $image_url=$img->saveWebImage(); ?> Displaying a map > From: Moen, Paul T. [mailto:pm...@nd.gov] Sent: Monday, April 13, 2009 3:22 PM To: Jay Kapalczynski Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Highlight On 4/13/09 2:25 PM, "Jay Kapalczynski" wrote: I am messing around with thisdoes any of this map sense? Yes, you have many errors. Check the error logs for php to help debugging with syntax. // THE QUERY HAPPENS BEFORE THISJUST SHOWING THAT THE VARAIBLE HOLDING ALL THE PIS VALUES IS BELOW //=== //=== // BUILD A COMMAN DELIMITED LIST // if something already in $PIDString, append a comma if (isset($PIDString)) $PIDString .= ','; // Append the new value $PIDString .= $PID; //=== //=== } // end while //=== //=== $map = ms_newMapObj(/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/select.map); Won't work because it requires a string, so you would need $map = ms_newMapObj('/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/select.map'); $qlayer = $map->$map->getLayerByName(parcels); Won't work because it requires a string and the layer in your mapfile is Parcels, so you would need $qlayer = $map->getLayerByName('Parcels'); $qlayer->queryByAttributes('PID','($PIDString)',MS_MULTIPLE); Won't work because it needs to know how to query for the PID as in $qlayer->queryByAttributes('PID','PID IN ($PIDString)',MS_MULTIPLE); $img = $map->drawQuery(); Should set the output format to jpeg $map->selectOutputFormat('jpeg'); header('Content-Type: image/jpeg'); $img->saveImage(""); Can I then test the jpeg in another window or something... You could set up your php file to accept $_GET variables and pass in the PIDs like below. http://yourserver.com/phpfilename.php?PID=1%2C2%2C3%2C4%2C5, which should give you a png image after making changes above. Is this all that I need code wise? That should give you the basics. You will also need to load the php_mapscript library before any of the above functions will be recognized. Check out http://mapserver.org/mapscript/php/by_example.html. There is an abundance of good documentation on http://mapserver.org. HERE is the select.map file MAP NAME 'all layers&
Re: [mapserver-users] RE: Highlight
On 4/13/09 2:25 PM, "Jay Kapalczynski" wrote: I am messing around with thisdoes any of this map sense? Yes, you have many errors. Check the error logs for php to help debugging with syntax. // THE QUERY HAPPENS BEFORE THISJUST SHOWING THAT THE VARAIBLE HOLDING ALL THE PIS VALUES IS BELOW //=== //=== // BUILD A COMMAN DELIMITED LIST // if something already in $PIDString, append a comma if (isset($PIDString)) $PIDString .= ','; // Append the new value $PIDString .= $PID; //=== //=== } // end while //=== //=== $map = ms_newMapObj(/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/select.map); Won't work because it requires a string, so you would need $map = ms_newMapObj('/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/select.map'); $qlayer = $map->$map->getLayerByName(parcels); Won't work because it requires a string and the layer in your mapfile is Parcels, so you would need $qlayer = $map->getLayerByName('Parcels'); $qlayer->queryByAttributes('PID','($PIDString)',MS_MULTIPLE); Won't work because it needs to know how to query for the PID as in $qlayer->queryByAttributes('PID','PID IN ($PIDString)',MS_MULTIPLE); $img = $map->drawQuery(); Should set the output format to jpeg $map->selectOutputFormat('jpeg'); header('Content-Type: image/jpeg'); $img->saveImage(""); Can I then test the jpeg in another window or something... You could set up your php file to accept $_GET variables and pass in the PIDs like below. http://yourserver.com/phpfilename.php?PID=1%2C2%2C3%2C4%2C5, which should give you a png image after making changes above. Is this all that I need code wise? That should give you the basics. You will also need to load the php_mapscript library before any of the above functions will be recognized. Check out http://mapserver.org/mapscript/php/by_example.html. There is an abundance of good documentation on http://mapserver.org. HERE is the select.map file MAP NAME 'all layers' SIZE 800 650 STATUS ON EXTENT 427632.50 4893613.33 560300.922104 5015936.68 UNITS METERS SYMBOLSET 'symbols/symbol.sym' TRANSPARENT TRUE IMAGETYPE PNG QUERYMAP STATUS ON STYLE SELECTED #STYLE HILITE END WEB IMAGEPATH "/ms4w/tmp/ms_tmp/" IMAGEURL "/ms_tmp/" #EMPTY '../geomoose/query_miss.html' END LAYER # Parcels Polygon Layer NAME 'Parcels' DATA 'parcels/parcels.shp' STATUS ON TYPE POLYGON #TEMPLATE 'parcels/identify_parcels.html' #FILTERITEM 'PID' #FILTER /^%id%/ METADATA qstring_validation_pattern '.' END HEADER 'parcels/select_header.html' TEMPLATE 'parcels/select_parcel.html' FOOTER 'parcels/select_footer.html' TOLERANCE 0 CLASS SYMBOL 'plainline' SIZE 3 COLOR -1 -1 -1 OUTLINECOLOR 255 255 0 END END From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. Sent: Thursday, April 09, 2009 3:15 PM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Highlight If the database that you are querying has the same attributes as the shape file, you can query the Layer that points to the shape file and display the highlighted results on your map. I know nothing about GeoMOOSE but I know it can be done with php-mapscript. Regardless of what you are using, you need a map file layer for the shape file with the parcels. You will then need to use php-mapscript to query that layer with something like $map = ms_newMapObj(PATH TO YOU MAPFILE); $qlayer = $map->$map->getLayerByName(NAME OF PARCEL LAYER); $qlayer->queryByAttributes('PID','P
Re: [mapserver-users] RE: Highlight
Yes, that looks feasible. On 4/9/09 3:49 PM, "Jay Kapalczynski" wrote: That's what I was figuringright now I have some code that is in a while loop building the table from the query... I think maybe here I can build a list of PID values that can be sent to a PHP page Once at the PHP page I can then write code that will highlight the features in the map based off of the Parcels Shapefile... Does that make sense? Is that feasible??? Something like this? THANKS $PID $AssessmentYr $YrBuilt $Bedrooms $DwellingType $Style Map Print "; BUILD THE COMMA DELIMITED LIST RIGHT HERE } // end while AFTER ALL HAVE BEEN SELECTED and THE LIST BUILT SEND THE LIST TO ANOTHER PHP PAGE TO HANDLE THE HIGHLIGHTING OF THE FEATURES ?> From: Fawcett, David [mailto:david.fawc...@state.mn.us] Sent: Thursday, April 09, 2009 3:34 PM To: Jay Kapalczynski; Moen, Paul T.; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] RE: Highlight Or a string variable containing a comma-delimited list of the ID numbers that you really want? David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jay Kapalczynski Sent: Thursday, April 09, 2009 3:31 PM To: 'Moen, Paul T.'; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] RE: Highlight Thanks for your response... $qlayer->queryByAttributes('PID','PID IN (1, 2,7,9,23,87)',MS_MULTIPLE); Is the 1, 2,7,9,23,87 examples of PID values, if so I assume that these can be replaced with variables? Thanks again From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. Sent: Thursday, April 09, 2009 3:15 PM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Highlight If the database that you are querying has the same attributes as the shape file, you can query the Layer that points to the shape file and display the highlighted results on your map. I know nothing about GeoMOOSE but I know it can be done with php-mapscript. Regardless of what you are using, you need a map file layer for the shape file with the parcels. You will then need to use php-mapscript to query that layer with something like $map = ms_newMapObj(PATH TO YOU MAPFILE); $qlayer = $map->$map->getLayerByName(NAME OF PARCEL LAYER); $qlayer->queryByAttributes('PID','PID IN (1, 2,7,9,23,87)',MS_MULTIPLE); You will then need to create the output image from query using something like $img = $map->drawQuery(); header('Content-Type: image/jpeg'); $img->saveImage(""); I can't give you specifics without knowing how GeoMOOSE works, so the best thing is to look at the documentation for GeoMOOSE if that is what you are using. On 4/9/09 2:17 PM, "Jay Kapalczynski" wrote: Dang I misspoke...I am sorry... I am querying a Database for records, these records have a PID (unique Number). These are the records that show up in the Table. As this happens I have to take the results and run the query against the parcels to get the features in the Shapefile, then highlight.. If that makes any sense... If I am in a PHP file and have the records returned from the query (database)...what would I have to do next to take those records and run a query to highlight the parcels (PID to PID)? Can all of this be accomplished in the PHP file? Thanks...and sorry for my ignorance... From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. Sent: Thursday, April 09, 2009 1:57 PM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Highlight Set the mapfile QUERYMAP style to highlight http://mapserver.org/mapfile/querymap.html. Draw the map using drawQuery() instead of draw(). $img = $map->drawQuery(); header('Content-Type: image/jpeg'); $img->saveImage(""); On 4/9/09 1:31 PM, "Jay Kapalczynski" wrote: Basically what I have is a query that runs on a shapefile... It returns the records into a table, which I then have the option to zoom to. I am looking for a bit moreafter I run the query (php) I want the returned records to highlight in the map... I can get the Unique identifier but don't know if I can write some code in PHP to highlight those features I don't even know where to start here... The query and returning records into the table, as well as, the zoom to work great...just need the highlight part Thanks From: Jay Kapalczynski Sent: Thursday, April 09, 2009 1:03 PM To: 'mapserver-users@lists.osgeo.org ' Subject: Highlight Any way to highlight a feature in my map in PHP? I can grab a unique identifier but can figure out how to hig
RE: [mapserver-users] RE: Highlight
Thanks for your response... $qlayer->queryByAttributes('PID','PID IN (1, 2,7,9,23,87)',MS_MULTIPLE); Is the 1, 2,7,9,23,87 examples of PID values, if so I assume that these can be replaced with variables? Thanks again From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. Sent: Thursday, April 09, 2009 3:15 PM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Highlight If the database that you are querying has the same attributes as the shape file, you can query the Layer that points to the shape file and display the highlighted results on your map. I know nothing about GeoMOOSE but I know it can be done with php-mapscript. Regardless of what you are using, you need a map file layer for the shape file with the parcels. You will then need to use php-mapscript to query that layer with something like $map = ms_newMapObj(PATH TO YOU MAPFILE); $qlayer = $map->$map->getLayerByName(NAME OF PARCEL LAYER); $qlayer->queryByAttributes('PID','PID IN (1, 2,7,9,23,87)',MS_MULTIPLE); You will then need to create the output image from query using something like $img = $map->drawQuery(); header('Content-Type: image/jpeg'); $img->saveImage(""); I can't give you specifics without knowing how GeoMOOSE works, so the best thing is to look at the documentation for GeoMOOSE if that is what you are using. On 4/9/09 2:17 PM, "Jay Kapalczynski" wrote: Dang I misspoke...I am sorry... I am querying a Database for records, these records have a PID (unique Number). These are the records that show up in the Table. As this happens I have to take the results and run the query against the parcels to get the features in the Shapefile, then highlight.. If that makes any sense... If I am in a PHP file and have the records returned from the query (database)...what would I have to do next to take those records and run a query to highlight the parcels (PID to PID)? Can all of this be accomplished in the PHP file? Thanks...and sorry for my ignorance... From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. Sent: Thursday, April 09, 2009 1:57 PM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Highlight Set the mapfile QUERYMAP style to highlight http://mapserver.org/mapfile/querymap.html. Draw the map using drawQuery() instead of draw(). $img = $map->drawQuery(); header('Content-Type: image/jpeg'); $img->saveImage(""); On 4/9/09 1:31 PM, "Jay Kapalczynski" wrote: Basically what I have is a query that runs on a shapefile... It returns the records into a table, which I then have the option to zoom to. I am looking for a bit moreafter I run the query (php) I want the returned records to highlight in the map... I can get the Unique identifier but don't know if I can write some code in PHP to highlight those features I don't even know where to start here... The query and returning records into the table, as well as, the zoom to work great...just need the highlight part Thanks From: Jay Kapalczynski Sent: Thursday, April 09, 2009 1:03 PM To: 'mapserver-users@lists.osgeo.org ' Subject: Highlight Any way to highlight a feature in my map in PHP? I can grab a unique identifier but can figure out how to highlight it... THanks Paul Paul ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] RE: Highlight
That's what I was figuringright now I have some code that is in a while loop building the table from the query... I think maybe here I can build a list of PID values that can be sent to a PHP page Once at the PHP page I can then write code that will highlight the features in the map based off of the Parcels Shapefile... Does that make sense? Is that feasible??? Something like this? THANKS $PID $AssessmentYr $YrBuilt $Bedrooms $DwellingType $Style Map Print "; BUILD THE COMMA DELIMITED LIST RIGHT HERE } // end while AFTER ALL HAVE BEEN SELECTED and THE LIST BUILT SEND THE LIST TO ANOTHER PHP PAGE TO HANDLE THE HIGHLIGHTING OF THE FEATURES ?> From: Fawcett, David [mailto:david.fawc...@state.mn.us] Sent: Thursday, April 09, 2009 3:34 PM To: Jay Kapalczynski; Moen, Paul T.; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] RE: Highlight Or a string variable containing a comma-delimited list of the ID numbers that you really want? David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jay Kapalczynski Sent: Thursday, April 09, 2009 3:31 PM To: 'Moen, Paul T.'; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] RE: Highlight Thanks for your response... $qlayer->queryByAttributes('PID','PID IN (1, 2,7,9,23,87)',MS_MULTIPLE); Is the 1, 2,7,9,23,87 examples of PID values, if so I assume that these can be replaced with variables? Thanks again From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. Sent: Thursday, April 09, 2009 3:15 PM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Highlight If the database that you are querying has the same attributes as the shape file, you can query the Layer that points to the shape file and display the highlighted results on your map. I know nothing about GeoMOOSE but I know it can be done with php-mapscript. Regardless of what you are using, you need a map file layer for the shape file with the parcels. You will then need to use php-mapscript to query that layer with something like $map = ms_newMapObj(PATH TO YOU MAPFILE); $qlayer = $map->$map->getLayerByName(NAME OF PARCEL LAYER); $qlayer->queryByAttributes('PID','PID IN (1, 2,7,9,23,87)',MS_MULTIPLE); You will then need to create the output image from query using something like $img = $map->drawQuery(); header('Content-Type: image/jpeg'); $img->saveImage(""); I can't give you specifics without knowing how GeoMOOSE works, so the best thing is to look at the documentation for GeoMOOSE if that is what you are using. On 4/9/09 2:17 PM, "Jay Kapalczynski" wrote: Dang I misspoke...I am sorry... I am querying a Database for records, these records have a PID (unique Number). These are the records that show up in the Table. As this happens I have to take the results and run the query against the parcels to get the features in the Shapefile, then highlight.. If that makes any sense... If I am in a PHP file and have the records returned from the query (database)...what would I have to do next to take those records and run a query to highlight the parcels (PID to PID)? Can all of this be accomplished in the PHP file? Thanks...and sorry for my ignorance... From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. Sent: Thursday, April 09, 2009 1:57 PM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Highlight Set the mapfile QUERYMAP style to highlight http://mapserver.org/mapfile/querymap.html. Draw the map using drawQuery() instead of draw(). $img = $map->drawQuery(); header('Content-Type: image/jpeg'); $img->saveImage(""); On 4/9/09 1:31 PM, "Jay Kapalczynski" wrote: Basically what I have is a query that runs on a shapefile... It returns the records into a table, which I then have the option to zoom to. I am looking for a bit moreafter I run the query (php) I want the returned records to highlight in the map... I can get the Unique identifier but don't know if I can write some code in PHP to highlight those features I don't even know where to start here... The query and returning records into the table, as well as, the zoom to work great...just need the highlight part Thanks From: Jay Kapalczynski Sent: Thursday, April 09, 2009 1:03 PM To: 'mapserver-users@lists.osgeo.org ' Subject: Highlight Any way to highlight a feature in my map in PHP? I can grab a unique identifier but can figure out how to highlight it... THanks Paul Paul ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] RE: Highlight
Or a string variable containing a comma-delimited list of the ID numbers that you really want? David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jay Kapalczynski Sent: Thursday, April 09, 2009 3:31 PM To: 'Moen, Paul T.'; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] RE: Highlight Thanks for your response... $qlayer->queryByAttributes('PID','PID IN (1, 2,7,9,23,87)',MS_MULTIPLE); Is the 1, 2,7,9,23,87 examples of PID values, if so I assume that these can be replaced with variables? Thanks again From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. Sent: Thursday, April 09, 2009 3:15 PM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Highlight If the database that you are querying has the same attributes as the shape file, you can query the Layer that points to the shape file and display the highlighted results on your map. I know nothing about GeoMOOSE but I know it can be done with php-mapscript. Regardless of what you are using, you need a map file layer for the shape file with the parcels. You will then need to use php-mapscript to query that layer with something like $map = ms_newMapObj(PATH TO YOU MAPFILE); $qlayer = $map->$map->getLayerByName(NAME OF PARCEL LAYER); $qlayer->queryByAttributes('PID','PID IN (1, 2,7,9,23,87)',MS_MULTIPLE); You will then need to create the output image from query using something like $img = $map->drawQuery(); header('Content-Type: image/jpeg'); $img->saveImage(""); I can't give you specifics without knowing how GeoMOOSE works, so the best thing is to look at the documentation for GeoMOOSE if that is what you are using. On 4/9/09 2:17 PM, "Jay Kapalczynski" wrote: Dang I misspoke...I am sorry... I am querying a Database for records, these records have a PID (unique Number). These are the records that show up in the Table. As this happens I have to take the results and run the query against the parcels to get the features in the Shapefile, then highlight.. If that makes any sense... If I am in a PHP file and have the records returned from the query (database)...what would I have to do next to take those records and run a query to highlight the parcels (PID to PID)? Can all of this be accomplished in the PHP file? Thanks...and sorry for my ignorance... From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. Sent: Thursday, April 09, 2009 1:57 PM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Highlight Set the mapfile QUERYMAP style to highlight http://mapserver.org/mapfile/querymap.html. Draw the map using drawQuery() instead of draw(). $img = $map->drawQuery(); header('Content-Type: image/jpeg'); $img->saveImage(""); On 4/9/09 1:31 PM, "Jay Kapalczynski" wrote: Basically what I have is a query that runs on a shapefile... It returns the records into a table, which I then have the option to zoom to. I am looking for a bit moreafter I run the query (php) I want the returned records to highlight in the map... I can get the Unique identifier but don't know if I can write some code in PHP to highlight those features I don't even know where to start here... The query and returning records into the table, as well as, the zoom to work great...just need the highlight part Thanks From: Jay Kapalczynski Sent: Thursday, April 09, 2009 1:03 PM To: 'mapserver-users@lists.osgeo.org ' Subject: Highlight Any way to highlight a feature in my map in PHP? I can grab a unique identifier but can figure out how to highlight it... THanks Paul Paul ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] RE: Highlight
If the database that you are querying has the same attributes as the shape file, you can query the Layer that points to the shape file and display the highlighted results on your map. I know nothing about GeoMOOSE but I know it can be done with php-mapscript. Regardless of what you are using, you need a map file layer for the shape file with the parcels. You will then need to use php-mapscript to query that layer with something like $map = ms_newMapObj(PATH TO YOU MAPFILE); $qlayer = $map->$map->getLayerByName(NAME OF PARCEL LAYER); $qlayer->queryByAttributes('PID','PID IN (1, 2,7,9,23,87)',MS_MULTIPLE); You will then need to create the output image from query using something like $img = $map->drawQuery(); header('Content-Type: image/jpeg'); $img->saveImage(""); I can't give you specifics without knowing how GeoMOOSE works, so the best thing is to look at the documentation for GeoMOOSE if that is what you are using. On 4/9/09 2:17 PM, "Jay Kapalczynski" wrote: Dang I misspoke...I am sorry... I am querying a Database for records, these records have a PID (unique Number). These are the records that show up in the Table. As this happens I have to take the results and run the query against the parcels to get the features in the Shapefile, then highlight.. If that makes any sense... If I am in a PHP file and have the records returned from the query (database)...what would I have to do next to take those records and run a query to highlight the parcels (PID to PID)? Can all of this be accomplished in the PHP file? Thanks...and sorry for my ignorance... From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. Sent: Thursday, April 09, 2009 1:57 PM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Highlight Set the mapfile QUERYMAP style to highlight http://mapserver.org/mapfile/querymap.html. Draw the map using drawQuery() instead of draw(). $img = $map->drawQuery(); header('Content-Type: image/jpeg'); $img->saveImage(""); On 4/9/09 1:31 PM, "Jay Kapalczynski" wrote: Basically what I have is a query that runs on a shapefile... It returns the records into a table, which I then have the option to zoom to. I am looking for a bit moreafter I run the query (php) I want the returned records to highlight in the map... I can get the Unique identifier but don't know if I can write some code in PHP to highlight those features I don't even know where to start here... The query and returning records into the table, as well as, the zoom to work great...just need the highlight part Thanks From: Jay Kapalczynski Sent: Thursday, April 09, 2009 1:03 PM To: 'mapserver-users@lists.osgeo.org ' Subject: Highlight Any way to highlight a feature in my map in PHP? I can grab a unique identifier but can figure out how to highlight it... THanks Paul Paul ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] RE: Highlight
Dang I misspoke...I am sorry... I am querying a Database for records, these records have a PID (unique Number). These are the records that show up in the Table. As this happens I have to take the results and run the query against the parcels to get the features in the Shapefile, then highlight.. If that makes any sense... If I am in a PHP file and have the records returned from the query (database)...what would I have to do next to take those records and run a query to highlight the parcels (PID to PID)? Can all of this be accomplished in the PHP file? Thanks...and sorry for my ignorance... From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Moen, Paul T. Sent: Thursday, April 09, 2009 1:57 PM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] RE: Highlight Set the mapfile QUERYMAP style to highlight http://mapserver.org/mapfile/querymap.html. Draw the map using drawQuery() instead of draw(). $img = $map->drawQuery(); header('Content-Type: image/jpeg'); $img->saveImage(""); On 4/9/09 1:31 PM, "Jay Kapalczynski" wrote: Basically what I have is a query that runs on a shapefile... It returns the records into a table, which I then have the option to zoom to. I am looking for a bit moreafter I run the query (php) I want the returned records to highlight in the map... I can get the Unique identifier but don't know if I can write some code in PHP to highlight those features I don't even know where to start here... The query and returning records into the table, as well as, the zoom to work great...just need the highlight part Thanks From: Jay Kapalczynski Sent: Thursday, April 09, 2009 1:03 PM To: 'mapserver-users@lists.osgeo.org' Subject: Highlight Any way to highlight a feature in my map in PHP? I can grab a unique identifier but can figure out how to highlight it... THanks Paul ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] RE: Highlight
Set the mapfile QUERYMAP style to highlight http://mapserver.org/mapfile/querymap.html. Draw the map using drawQuery() instead of draw(). $img = $map->drawQuery(); header('Content-Type: image/jpeg'); $img->saveImage(""); On 4/9/09 1:31 PM, "Jay Kapalczynski" wrote: Basically what I have is a query that runs on a shapefile... It returns the records into a table, which I then have the option to zoom to. I am looking for a bit moreafter I run the query (php) I want the returned records to highlight in the map... I can get the Unique identifier but don't know if I can write some code in PHP to highlight those features I don't even know where to start here... The query and returning records into the table, as well as, the zoom to work great...just need the highlight part Thanks From: Jay Kapalczynski Sent: Thursday, April 09, 2009 1:03 PM To: 'mapserver-users@lists.osgeo.org' Subject: Highlight Any way to highlight a feature in my map in PHP? I can grab a unique identifier but can figure out how to highlight it... THanks Paul ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users