[mapserver-users] basic search question
kenboss
kenboss at dilbert.dnr.state.mn.us
Thu Aug 23 11:32:29 PDT 2001
Jim--
Did you mean to include some code, or were you referring to one of my examples?
Basically, to get a blowup of the feature, I think you just need to use
&mapext=[shpext]
in the query template for the layer that you're querying via itemquery.
As for doing this sort of thing using mapscript, I'm sure it's doable using the
DBI perl module for mysql access and the XBase module for access to the
shapefile attributes (assuming you are in fact using shapefiles). I don't have
any examples of that sort of thing in mapscript, but conceptually I think it'd
go something like this:
Search mysql on whatever and grab the associated parcel_id.
Search the dbf file for the parcel_id and grab the associated record number.
Use the record number from the .dbf file as an index to the shape you're after
and grab the associated extent.
Use the extent of the shape as your map extent and draw your map.
--Ken
> From: "Jim Burnett" <jimburnett at ntelos.net>
> To: "kenboss" <kenboss at dilbert.dnr.state.mn.us>,
<mapserver-users at lists.gis.umn.edu>
> Subject: Re: [mapserver-users] basic search question
> Date: Thu, 23 Aug 2001 13:41:11 -0400
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
>
> ok, if I want to display just 1 item, say a parcel.....how would I blow it
> up to full extent?
>
> This is what is working, I can search my sql database by person's name and
> get the parcel_id. I can also show on the map were the parcel is using the
> code below.
>
> Now I want to make that little parcel, blow up full screen. Do I have to set
> extents?
>
> -jim
>
> ----- Original Message -----
> From: "kenboss" <kenboss at dilbert.dnr.state.mn.us>
> To: <mapserver-users at lists.gis.umn.edu>; <jimburnett at ntelos.net>
> Sent: Thursday, August 23, 2001 10:56 AM
> Subject: Re: [mapserver-users] basic search question
>
>
> > It's been a while, but I'll take a shot. I can think of a couple of ways
> to get there.
> >
> > If you have x,y coordinates for the centers of your parcels in your mysql
> database, you can just run
> > your search, grab the results, and redirect to a url like:
> >
> >
> http://myserver.com/cgi-bin/mapserver?map=parcel.map&mapxy=x_from_mysql+y_fr
> om_mysql&scale=150000
> >
> >
> > If you have a common unique parcel ID in both the mysql database and the
> parcels shapefile, you can
> > grab that ID from your search and then redirect to something like:
> >
> >
> http://myserver.com/cgi-bin/mapserver?map=parcel.map&qlayer=parcels&mode=ite
> mquery&item=parcelID&value
> > =unique_ID_from_mysql
> >
> > In turn, in your mapfile your parcels layer would have a query template
> like:
> >
> > http://myserver.com/cgi-bin/mapserver?map=parcel.map&mapext=[shpext]
> >
> > to display the map.
> >
> > At least, that's how I'd approach it from ms_3.3. I understand itemquery
> has changed in 3.5, and
> > there may be better ways to get there.
> >
> >
> >
> > Hope this helps,
> >
> > --Ken Boss
> > MN DNR Forestry Resource Assessment
> >
> >
> > > From: "Jim Burnett" <jimburnett at ntelos.net>
> > > To: <mapserver-users at lists.gis.umn.edu>
> > > Subject: [mapserver-users] basic search question
> > > Date: Thu, 23 Aug 2001 08:44:19 -0400
> > > MIME-Version: 1.0
> > > X-Priority: 3
> > > X-MSMail-Priority: Normal
> > > X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
> > >
> > > Can I do a seach on my standard database(mysql) for an address, and then
> pop up the parcel(map)
> > based on my search?
> > >
> > > So, can I create a map, based on search results?
> > > I know I can click in the map, and query were I am clicking, but I want
> to do the opposite, and do a
> > search, then display the map....
> > >
> > >
> > >
> > >
> > > -jim
> > >
> >
> >
>
More information about the MapServer-users
mailing list