Very good suggestion. I did set a default value and was able to save the
layer based on the SQL view that has this query

SELECT *, %myheight% as height from mytable

The kml that I can get from the preview works too.'

Now when i try to use the variable %myheight% like in this string in the kml
file

 

http://myurl:8080/geoserver/drive/wms?service=wms&viewparams=
myheight:revenue__million&request=GetMap&version=1.1.1&format=ap
plication/vnd.google-earth.kml+xml&layers=drive:mytable&styles=point
&height=2048&width=2048&transparent=false&srs=EPSG:4326&
format_options=SUPEROVERLAY:false;AUTOFIT:true;KMPLACEMARK:false;KMSCORE:80;
KMATTR:true;MODE:refresh

 

it does not work any more and I get the following error in the GeoServer
log:

 

I also see that the following parameter gets send out (one can see that the
MYHEIGHT actually is used as parameter ):
ViewParams = [{MYHEIGHT=revenue__million}]

 

This is the GeoServer error message :

WARN [geotools.jdbc] - Failed to use ST_Estimated_Extent, falling back on
envelope aggregation

org.postgresql.util.PSQLException: ERROR: relation "mytable" does not exist

  Where: SQL statement "SELECT has_table_privilege((SELECT usesysid FROM
pg_user WHERE usename = session_user), '"tmp"."kc_comp_query"', 'select')"

 

Any ideas why geotools fails to get the extent ?

Cheers

Karsten


>>> : Re: [Geoserver-users] how to create a totally dynamic GeoServer layer
- and dynamic heights in KML output ?

Maybe you have to set a valid default value in the sql view parameters table
below the view (one existing column) to allow geoserver to validate the
query and check the type of the attribute. 

For instance, if your table has the following columns: 

gid,value1, value2, the_geom

try to set value1 as default value and try to save.
Check the geoserver log if you have errors to see the generated query and
why it fails.

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to