[Mapserver-users] Options for spatial selects

Lowell Filak lfilak at medinaco.org
Thu Jul 15 14:26:29 EDT 2004


You can use $layer->queryByShape($map,$shape) which only requires a
shape object and not a shapefile.
You can create a shape object dynamically with the x/y pairs sent from
the javascript (don't forget to call setbounds() - SWIGMapScript only).

Note: If you use the SWIGMapScript doc please ignore the "int slayer"
reference on queryByShape, "shapeObj" is correct.

Lowell

The following message was sent by "Ben Lewis" <blewis at atsincorp.com> on
Thu, 15 Jul 2004 12:22:24 -0400.

> Thanks Lowell,
> We are ok with the javascript part. 
> 
> You mention creating temporary shape objects. Do you mean creating a
> shape file and then deleting it after use or is it possible to create a
> temporary shape object in memory without creating a shapefile?  We are
> creating shapefiles on the fly with no problem. 
> 
> You also mention using that object in a query against a selected layer.
> How does one use a shape (temporary or otherwise) to do a spatial query
> against a selected layer?
> 
> Thank you much for your help.
> 
>  - Ben
> 
> 
> -----Original Message-----
> From: Lowell Filak [mailto:lfilak at medinaco.org] 
> Sent: Thursday, July 15, 2004 10:31 AM
> To: Ben Lewis; mapserver-users at lists.gis.umn.edu
> Subject: Re: [Mapserver-users] Options for spatial selects
> 
> Sounds feasible, you may want to check JBOX & DBOX to see if a circle
> shape could be incorporated into one of those before starting from
> scratch if all you need are basic shapes for selecting.
> More complex selection shapes may require using mapscript to generate a
> temporary shape shape object to use for a query on a selected layer.
> 
> HTH
> 
> Lowell
> 
> The following message was sent by "Ben Lewis" <blewis at atsincorp.com> on
> Thu, 15 Jul 2004 09:23:55 -0400.
> 
> > I have a project in which a user wants to select a bunch of features 
> > on the map by creating a shape and defining a spatial query. What are 
> > the options for mapserver based solutions?
> >  
> > One I can think of is using the tolerance value of the identify 
> > function.  One would use javascript to click and drag to create a 
> > circle on the screen, then send mapserver the identify coordinates 
> > (circle
> > center) and tolerance (circle radius) to return everything in the 
> > circle.
> >  
> > Any other ideas? 
> >  
> > I know PostGIS could be used, but I'm looking for mapserver/mapscript 
> > approaches, ideally using shape files.
> >  
> >  - Ben
> >  
> > _______________________________
> > 
> > Benjamin Lewis - Senior Analyst
> > Advanced Technology Solutions, Inc. 
> > Lancaster, Pennsylvania
> > 717.399.7007
> > http://www.atsincorp.com <http://www.atsincorp.com/>
> > 
> > 
> 
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list