[Geoserver-users] getting a list of attributes from a layer

Hello,

in order to allow users of my Gmaps-frontend to filter Layers by
submitting CQL-statements I would like to get a list of attributes
like this:

&cql_filter=(POPULATION > 1200000)

in this case the given Layer contains the attribute POPULATION that is
assigned to districts of a country. The filter allows, to select
shapes of such districts to be rendered if the POPULATION assigned to
the district is greater than a number, the user may type in an
input-field.

That is straight forward, anyway I need to find out the attribute
names (in this case POPULATION) to set up input boxes that fit the
given layer. The attributes will become quite diverse since we will
map water/sanitation installations that can be dozens of different
things from a lake to a handpump. The handpump has a throughput the
lake has a depth etc.

So I would need to query the layer for its attributes. As of now I
copy the names from the wms-atom preview in geoserver but of course,
that is no option in the long run...

Is there any CQL-Magic or something similar to do that?

something like:

"request=ListAttributes&layers=workspacename:layername"

:wink: ?

best regards

HZN

Hi,

What about using WFS describeFeatureType ?

http://localhost:8080/geoserver/wfs?request=DescribeFeatureType&typeName=topp:states

Regards,

Laszlo

On 2013-12-12 01:43, Hartmut Noack wrote:

Hello,

in order to allow users of my Gmaps-frontend to filter Layers by
submitting CQL-statements I would like to get a list of attributes
like this:

&cql_filter=(POPULATION > 1200000)

in this case the given Layer contains the attribute POPULATION that is
assigned to districts of a country. The filter allows, to select
shapes of such districts to be rendered if the POPULATION assigned to
the district is greater than a number, the user may type in an
input-field.

That is straight forward, anyway I need to find out the attribute
names (in this case POPULATION) to set up input boxes that fit the
given layer. The attributes will become quite diverse since we will
map water/sanitation installations that can be dozens of different
things from a lake to a handpump. The handpump has a throughput the
lake has a depth etc.

So I would need to query the layer for its attributes. As of now I
copy the names from the wms-atom preview in geoserver but of course,
that is no option in the long run...

Is there any CQL-Magic or something similar to do that?

something like:

"request=ListAttributes&layers=workspacename:layername"

;-) ?

best regards

HZN

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
[http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk)
_______________________________________________
Geoserver-users mailing list
[Geoserver-users@anonymised.comsts.sourceforge.net](mailto:Geoserver-users@lists.sourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geoserver-users](https://lists.sourceforge.net/lists/listinfo/geoserver-users)

Am 12.12.2013 08:23, schrieb sores:

Hi,

What about using WFS describeFeatureType ?

http://localhost:8080/geoserver/wfs?request=DescribeFeatureType&typeName=topp:states

This

does not yield any output at all. At least not for my layers(I
deleted the demos).

As of now I get the layer as CSV and process it with PHP:

$url =
"localhost:8080/geoserver/wfs?request=getfeature&version=1.0.0&outputformat=csv&service=wfs&typename=workspace:Tan_regions";

//Send post request.
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
    $passwordStr = "user:pass";
    curl_setopt($ch, CURLOPT_USERPWD, $passwordStr);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Collect result.
$result = curl_exec($ch);
curl_close ($ch);

$parts = explode("\"",$result);
//break the string up at the "-character to get rid of the_geom
//grab the first part (one row of values remains at $parts['2'])
$prop_names = explode (",",$parts['0']);

This gives me a list of the given attributes but it seems to be a
major PITA to get the respective values for setting up presets, users
could choose whithout typing...

ahhhrrrmmmm... and I do not think, that this is the most neat of all
thinkable methods :wink:

best regards

HZN

Regards,

Laszlo

On 2013-12-12 01:43, Hartmut Noack wrote:

Hello,

in order to allow users of my Gmaps-frontend to filter

Layers by

submitting CQL-statements I would like to get a list of

attributes

like this:

&cql_filter=(POPULATION > 1200000)

in

this case the given Layer contains the attribute POPULATION that
is

assigned to districts of a country. The filter allows, to select

shapes of such districts to be rendered if the POPULATION assigned
to

the district is greater than a number, the user may type in an

input-field.

That is straight forward, anyway I need to find out

the attribute

names (in this case POPULATION) to set up input boxes

that fit the

given layer. The attributes will become quite diverse

since we will

map water/sanitation installations that can be dozens of

different

things from a lake to a handpump. The handpump has a

throughput the

lake has a depth etc.

So I would need to query the

layer for its attributes. As of now I

copy the names from the wms-atom

preview in geoserver but of course,

that is no option in the long

run...

Is there any CQL-Magic or something similar to do that?

something like:

"request=ListAttributes&layers=workspacename:layername"

:wink: ?

best regards

HZN

------------------------------------------------------------------------------

Rapidly troubleshoot problems before they affect your business. Most IT

organizations don't have a clear picture of how application

performance

affects their revenue. With AppDynamics, you get 100%

visibility into your

Java,.NET, & PHP application. Start your 15-day

FREE TRIAL of AppDynamics Pro!

http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk

[1]

_______________________________________________ Geoserver-users

mailing list

Geoserver-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/geoserver-users [2]

Links: ------ [1]
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk

[2]

https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------

Rapidly troubleshoot problems before they affect your business. Most IT

organizations don't have a clear picture of how application
performance affects their revenue. With AppDynamics, you get 100%
visibility into your Java,.NET, & PHP application. Start your
15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk

_______________________________________________ Geoserver-users
mailing list Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Am 12.12.2013 08:23, schrieb sores:

Hi,

What about using WFS describeFeatureType ?

http://localhost:8080/geoserver/wfs?request=DescribeFeatureType&typeName=topp:states

Using this URL in the Browser works OK and as expected but I do not get
anything with PHP/curl

best regards
HZN

Regards,

Laszlo

On 2013-12-12 01:43, Hartmut Noack wrote:

Hello,

in order to allow users of my Gmaps-frontend to filter

Layers by

submitting CQL-statements I would like to get a list of

attributes

like this:

&cql_filter=(POPULATION > 1200000)

in

this case the given Layer contains the attribute POPULATION that is

assigned to districts of a country. The filter allows, to select

shapes of such districts to be rendered if the POPULATION assigned to

the district is greater than a number, the user may type in an

input-field.

That is straight forward, anyway I need to find out

the attribute

names (in this case POPULATION) to set up input boxes

that fit the

given layer. The attributes will become quite diverse

since we will

map water/sanitation installations that can be dozens of

different

things from a lake to a handpump. The handpump has a

throughput the

lake has a depth etc.

So I would need to query the

layer for its attributes. As of now I

copy the names from the wms-atom

preview in geoserver but of course,

that is no option in the long

run...

Is there any CQL-Magic or something similar to do that?

something like:

"request=ListAttributes&layers=workspacename:layername"

:wink: ?

best regards

HZN

------------------------------------------------------------------------------

Rapidly troubleshoot problems before they affect your business. Most IT

organizations don't have a clear picture of how application

performance

affects their revenue. With AppDynamics, you get 100%

visibility into your

Java,.NET, & PHP application. Start your 15-day

FREE TRIAL of AppDynamics Pro!

http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
[1]

_______________________________________________
Geoserver-users

mailing list

Geoserver-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/geoserver-users [2]

Links:
------
[1]
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
[2]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users