On 4/13/09 2:25 PM, "Jay Kapalczynski" <[email protected]>
wrote:
I am messing around with this....does 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 THIS....JUST 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.500000 4893613.330000 560300.922104
5015936.680000
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: [email protected]
[mailto:[email protected]] On Behalf Of Moen, Paul T.
Sent: Thursday, April 09, 2009 3:15 PM
To: [email protected]
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" <[email protected]>
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: [email protected]
[mailto:[email protected]] On Behalf Of Moen, Paul T.
Sent: Thursday, April 09, 2009 1:57 PM
To: [email protected]
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" <[email protected]>
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 more....after 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: '[email protected] <[email protected]>
<[email protected]> '
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
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users