I had the same problem and ended up crafting a WMS GetMap request based on
the bounding box retreived via REST, with a proportional size, e.g.
GET /geoserver/rest/workspaces/myworkspace/featuretypes/mylayer.json
"""
'latLonBoundingBox': {u'crs': u'EPSG:4326',
u'maxx': 129.00192885,
u'maxy': -10.4123898666667,
u'minx': 96.8168171166666,
u'miny': -35.1899382666667},
"""
then create url like:
GET
/geoserver/myworkspace/wms?STYLES=&LAYERS=mylayer&SERVICE=WMS&FORMAT=image/png&MAXFEATURES=100000&REQUEST=GETMAP&SRS=EPSG:4326&HEIGHT=395&WIDTH=800&VERSION=1.1.1&BBOX=96.8168171166666,-10.4123898666667,129.00192885,-35.1899382666667
I'm proportionally calculating the pixels from the ratio of x/y, it does
the job =)
On Mon, Apr 16, 2012 at 9:03 AM, Jay L. <[email protected]> wrote:
> List,
>
> I am using the REST API to create a layer picker (using openlayers) which
> programmatically displays the the available wms layers in a given
> workspace. In this way users can explore the layer metadata prior to
> adding them to the map and thereby reducing load time so lots of layers are
> not loaded onto the page.
>
> I want to provide the user with a representative thumbnail of the image in
> this layer picker. I am currently doing this via a flat file system where
> I take a screenshot of the layer in QGIS and then resize it for display on
> the webpage. The metadata is loading programmatically, but the thumbnails
> are hand coded....not good!
>
> Is it possible to access a preview of a wms layer via the REST API?
>
> Thanks,
> Jay
>
>
> ------------------------------------------------------------------------------
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2
>
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
--
Regards,
Adon Metcalfe
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users