[OpenLayers-Users] Open Layers Capabilities
Tim Schaub
tschaub at opengeo.org
Tue Nov 4 16:35:58 EST 2008
Hey-
Danielle Bram wrote:
> Hi Everyone,
>
>
>
> I am new to Open Layers and am considering using it to develop an
> interactive map. Before I continue, I wanted to verify whether it is
> possible to achieve the following tasks in Open Layers before I spend a
> ton of time immersing myself in the application. Any feedback (even
> just yes or no) would be greatly appreciated.
>
>
>
> 1. Can I enable a data download tool so users could download data
> in a common GIS format such as shapefile?
Keep in mind that OpenLayers is a client-side library for putting maps
in web applications. We're all JavaScript. That means we can't do
anything that your browser can't do by itself.
Specifically, we can't currently trigger a prompt for a user to save
data [1]. So, even if we did write data into shapefile format(s), we
couldn't directly prompt your user to save the file(s). We could,
however, POST the data to some service that would spit it back with the
appropriate headers to prompt a download. This would be silly though [2].
We do deal in lots of vector data formats. This is generally useful for
reading and writing data from/to a remote service. So, we can read data
in KML, GeoJSON, GML, WKT, GPX, etc. and write back out the same. The
writing part typically involves writing a data structure or document
that is sent to a remote service (for creating new data or updating
existing data).
>
> 2. Would I be able to enable a tool that performs a type of
> “identify all” or drill-down identify that grabs attribute information
> from all vector layers at a location that is clicked?
>
>
There are a few (standard) ways to get attribute information from
features. The WMS spec [3] describes a GetFeatureInfo request. A
service that handles WMS requests will return formatted attribute
information based on a pixel location in a rendered map image. You can
configure your application to generate GetFeatureInfo requests if you
have a service that speaks WMS [4].
The WFS spec [5] describes a GetFeature request. This request returns
the full feature data - geometry and other attributes. With OpenLayers,
you can configure your application to issue GetFeature requests for data
[5] - then you can let you users interact with that data client-side.
So, OpenLayers is useful when you build an application that takes
advantage of a service or services that deal in feature data. Poke
around the examples to see more [6].
Tim
[1] We can trigger a prompt for download in browsers that fully support
the data scheme for urls (see http://www.ietf.org/rfc/rfc2397.txt).
This, of course, does not include Internet Explorer.
[2] If you want your users to download data, you'll be better off with a
service that already knows about Shapefiles. GeoServer, for example,
can write Shapefiles. So, we (OpenLayers) post GML (or whatever) and
your application can provide a link for users to download a Shapefile
from GeoServer (or another service that writes Shapefiles).
[3] http://www.opengeospatial.org/standards/wms
[4] http://openlayers.org/dev/examples/getfeatureinfo.html
[5] http://openlayers.org/dev/examples/wfs.html
[6] http://openlayers.org/dev/examples
>
> Thank you for your help….
>
> Danni
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
--
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.
More information about the Users
mailing list