We also could potentially consider a shortcut in the REST API to the

> reflector, so you could use the same layer endpoint to get a
> visualization. Though that probably warrants a larger conversation, as
> it takes us from a REST API just for configuration to more
> functionality.
>

If I am understanding correctly, this would be quite helpful.  Currently I
am using javascript to loop through a workspace to get the layer names,
then loop through the layers to get the metadata I want to display, and now
will need to implement a reflector call using
workspace:layer_name&parameters.  I imagine that I will store the layer
names in an array which I iterate over.  If it were possible to get a
reflector call through the restapi to avoid another level of iteration,
that would be great (ie get metadata and preview concurrently).  Still
learning javascript, so a better approach might exist!


>
> On Sun, Apr 15, 2012 at 9:54 PM, Jay L. <[email protected]> wrote:
> > How the heck did I miss that in the documentation! Too much focus on the
> > REST API maybe!
> >
> > Facepalms as well!
> >
> > Thanks all for the info.
> >
> >
> > On Sun, Apr 15, 2012 at 9:45 PM, Adon Metcalfe <[email protected]>
> > wrote:
> >>
> >> Facepalm - that's much better, also has great docs =)
> >>
> >> http://docs.geoserver.org/latest/en/user/tutorials/wmsreflector.html
> >>
> >>
> >> On Mon, Apr 16, 2012 at 9:37 AM, Gabriel Roldan <[email protected]>
> >> wrote:
> >>>
> >>> On Sun, Apr 15, 2012 at 10:23 PM, Adon Metcalfe <
> [email protected]>
> >>> wrote:
> >>> > 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 =)
> >>>
> >>> hint: you can save yourself some work by using the wms reflector
> >>> instead. For example:
> >>> <http://demo.opengeo.org/geoserver/wms/reflect?layers=topp:states>
> >>> It till fill up automatically any missing parameter to some sensible
> >>> default.
> >>>
> >>> Cheers,
> >>> Gabriel
> >>> >
> >>> > 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
> >>> >
> >>>
> >>>
> >>>
> >>> --
> >>> Gabriel Roldan
> >>> OpenGeo - http://opengeo.org
> >>> Expert service straight from the developers.
> >>
> >>
> >>
> >>
> >> --
> >> 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
> >
>
------------------------------------------------------------------------------
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

Reply via email to