I've got things up and running quite well with geoserver and I really like
geoserver a lot. It's pretty much what I've been looking for.
I do, however have a couple of questions. I apologize if these are really
silly, but I've done some searching and couldn't find any answers.
What would be the easiest (read: less time consuming) way of taking a layer
of several features and being able to write one wms getmap request that
would be able to zoom into the bounds of specified features in the layer. I
can filter features out, but I'd like to have a specific way of creating
bounds for that feature.
Specifically, I have a layer (shapefile, which I'll move to postgis at some
point) that is a county with several precincts. I'd like to be able to write
a getmap request that would call specifically one precinct (or more, I
suppose) and have the server reply with a layer that is zoomed to the extent
of that particular precinct. I could, I know, load all of the separate
precincts in as separate layers, and eventually that's likely to happen.
With that, is there a fast way of entering large numbers of files into a
datastore without hand editing the various xml files for each layer? Even if
it's a postgis datastore it seems that I'd have to enter each particular
layer by hand, either by editing xml or by using the geoserver gui.
Thanks,
Eric Aspengren
--
View this message in context: http://www.nabble.com/New-question-concerning-getting-features-tf4954449.html#a14187548
Sent from the GeoServer - User mailing list archive at Nabble.com.
easpengren ha scritto:
I've got things up and running quite well with geoserver and I really like
geoserver a lot. It's pretty much what I've been looking for.
I do, however have a couple of questions. I apologize if these are really
silly, but I've done some searching and couldn't find any answers.
What would be the easiest (read: less time consuming) way of taking a layer
of several features and being able to write one wms getmap request that
would be able to zoom into the bounds of specified features in the layer. I
can filter features out, but I'd like to have a specific way of creating
bounds for that feature.
Hum, that would be WPS (Web Processing Service), but you can hack up something with WFS as well. If you run the following WFS query:
http://localhost:8080/geoserver/wfs?request=GetFeature&version=1.0.0&typeName=topp:states&propertyName=STATE_NAME&featureid=states.39
The response will look like:
<wfs:FeatureCollection xsi:schemaLocation="http://www.openplans.org/topp http://localhost:8080/geoserver/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=topp:states http://www.opengis.net/wfs http://localhost:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd">
<gml:boundedBy>
<gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:coordinates decimal="." cs="," ts=" ">-79.763466,40.505898 71.870476,45.0061</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<topp:states fid="states.39">
<topp:STATE_NAME>New York</topp:STATE_NAME>
</topp:states>
</gml:featureMember>
</wfs:FeatureCollection>
As you can see the bounds are specified at the collection level.
The are two things to consider:
* GetFeature will return at least one attribute of the feature
you're requested, just choose one that's small
* I filtered out a specific state using a featureid filter,
but you can use an ogc filter or a cql filter on any other
attribute. The ogc filter is an xml filter (see the wfs
specification), hard to read but standard, the cql filter
is a human readable filter which is a geoserver specific
extension. For example, if I wanted to grab the Texas bounds
I could replace that featureid filter with
&cql_filter=STATE_NAME="Texas". There are some examples
of how to use the CQL syntax here:
http://docs.codehaus.org/display/GEOSDOC/Common+Query+Language+(CQL)+Tutorial+(unfinished)
(here the filters are in used in java code, but you can have a look at the filter nevertheless):
http://docs.codehaus.org/display/GEOTDOC/01+CQL+Examples
Hope this helps
Cheers
Andrea
Thank you very much. I've just about got this, now. I'll need to give myself
a crash course in Java, now, to figure out how to handle a get request that
parses the output from the first request and sends a new request based on
that parsing.
Thank-you for your help.
Eric
easpengren wrote:
I've got things up and running quite well with geoserver and I really like
geoserver a lot. It's pretty much what I've been looking for.
I do, however have a couple of questions. I apologize if these are really
silly, but I've done some searching and couldn't find any answers.
What would be the easiest (read: less time consuming) way of taking a
layer of several features and being able to write one wms getmap request
that would be able to zoom into the bounds of specified features in the
layer. I can filter features out, but I'd like to have a specific way of
creating bounds for that feature.
Specifically, I have a layer (shapefile, which I'll move to postgis at
some point) that is a county with several precincts. I'd like to be able
to write a getmap request that would call specifically one precinct (or
more, I suppose) and have the server reply with a layer that is zoomed to
the extent of that particular precinct. I could, I know, load all of the
separate precincts in as separate layers, and eventually that's likely to
happen.
With that, is there a fast way of entering large numbers of files into a
datastore without hand editing the various xml files for each layer? Even
if it's a postgis datastore it seems that I'd have to enter each
particular layer by hand, either by editing xml or by using the geoserver
gui.
Thanks,
Eric Aspengren
--
View this message in context: http://www.nabble.com/New-question-concerning-getting-features-tf4954449.html#a14207347
Sent from the GeoServer - User mailing list archive at Nabble.com.