[Chameleon] Using shapes drawin using ROI tools
Paul Spencer
pspencer at dmsolutions.ca
Fri Apr 1 08:34:03 EST 2005
Mike,
the ROI tools can be used for this. The ROI tools offer you the ability
to define rectangles, circles, polygons and to select features from
existing layers. The geometry of the ROI(s) are stored in a session
variable $_SESSION['ROIRENDERER']. Check out
htdocs/widgets/ROIManager/ROIRenderer.php for details on how this array
is structured and used to draw ROIs on the map.
The strategy I would use would be to create a widget that submits the
page and sets a form variable to indicate that it was pressed. The
ParseURL function can then check for the contents of the session
variable ROIRENDERER and create appropriate SQL to query the database
from it. Depending on what you want to do with the results, you have
several options. To display tabular results, you can put the results of
the query into a sharedresource and have the table widget display them.
Or you can have your widget output the results directly.
Cheers
Paul
Mike Leahy wrote:
> Hello list,
>
> I'm currently working on a tool that allows users to define study areas
> by selecting features interactively on a map. We've previously
> accomplished with some success using the Rosa applet, but we'd like to
> make the change to Chameleon - browser compatibility and flexibility of
> design being two of the stronger motivators for doing so. However, the
> Chameleon query tool still only allows point selections. Furthermore,
> since the ability to select by rectangle, circle or polygon is somewhat
> important for our application, I'd like to know how difficult it might
> be to use the existing functionality in the ROI group of widgets.
> Basically, what I'd like to know is how I can get the shape(s) drawn
> with the ROI widgets so I can perform queries against a PostGIS table.
> We'll likely be adding functionality for other options (e.g., features
> within a given distance from the ROI, or from selected features), so I'm
> thinking that getting the ROI shapes, performing the appropriate
> queries, then adding classes or layers to the map in Chameleon is likely
> our best option.
>
> I can probably get this figured out on my own after a fair bit of
> tinkering...but I'm hoping that some of the participants in this list
> can offer a some tips that would give me a head start. Or perhaps there
> are some other widgets, or some ways of using the ROI widgets that can
> accomplish something like what we're looking to do.
>
> Thanks in advance for any advice.
> Mike
>
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
>
More information about the Chameleon
mailing list