Jeffrey Warren wrote:
Collaborating on a spec would be great. Cascadenik is so much more legible than SLD, but you're right, that's probably because I'm so comfortable with CSS. One advantage to using JSON-compliant markup is that styles don't have to be static. This works well for pure JavaScript/HTML renderers like Cartagen and OpenLayers, but not as well for Mapnik... maybe there's a way to gracefully degrade.
Example:

way: {
strokeStyle: function() { return "#"+(parseInt((this.user),36).toString(16)+"000000").truncate(6,"")
},
lineWidth: 2,
fillStyle: "white"
}

Kind of hacky, but it yields:

http://map.cartagen.org/?gss=http://unterbahn.com/cartagen/style.gss

...that is, it colors ways by author name - i see a lot of "crschmidt" in there :-)

I'm looking through the SLD spec and it looks like it does not specify event handlers, though of course OpenLayers has the Control class. It'd be great to preserve that kind of scripting power in a style standard.

It's not explicitly in the SLD specification, but rather in the Filter specification that SLD builds upon. There are 'expressions' in Filters that can take 'functions'.

I'm not sure how much a standard should really have specific scripting stuff in it, as you pretty much have to commit to a particular scripting language. But you should be able to extend the standard to get at that, in functions we do things like evaluate freemarker templates. We've been doing dynamic symbolizers based on values of the data, see http://blog.geoserver.org/2008/12/08/dynamic-symbolizers-part-1/ But it's a bit of a hack on the spec.

So you don't need JSON to do dynamic styles, and if we want to make a styling language that is used by more than javascript clients we probably shouldn't try to stick to JSON.


Another thing I was wondering about is whether there's a source for OSM data in GeoJSON? It would be great not to have to parse OSM xml into json for every request, so I'm considering running a weekly planet.osm source to serve GeoJSON... is that available already?

You can use GeoServer to generate GeoJSON through WFS from OSM data, see http://blog.geoserver.org/2009/01/30/geoserver-and-openstreetmap/

We have some servers set up with OSM data, but I don't think we're regularly updating them.

best regards,

Chris


Best,
Jeff


On Mon, Apr 27, 2009 at 11:11 AM, Chris Holmes <[email protected] <mailto:[email protected]>> wrote:



    Christopher Schmidt wrote:

        On Sun, Apr 26, 2009 at 02:41:36PM -0400, Jeffrey Warren wrote:

            Absolutely, Christopher - I'm a big admirer of the
            OpenLayers community, and
            the things you can do with it are impressive. Still, I
            haven't seen an
            implementation of an entire map in vector on the client side
            - examples such
            as this:
            http://openlayers.org/dev/examples/wfs-reprojection.html

            ...which are great, still use a pre-rendered tile base
            layer. What I'm
            hoping is that by sending *only* vector data, mappers can
            completely design
            maps from the ground up with their own GSS stylesheets.


        Like http://crschmidt.net/mapping/choropleth.html ? (Note that the
        styling suppot here was written before SLD support was
        implemented, and
        could now be done entirely using SLD instead of custom OpenLayers
        rules.)


    Contributing to OpenLayers++

    Cartagen looks to have some cool ideas, but it'd be really awesome
    if it was done by improving OpenLayers core and being a thin layer
    on top that's optimized for Android and iPhone.

    We've been thinking about GSS/Cascadenik type ideas, but having it
    go to and from OpenLayers Style objects, as an alternative to SLD.
     See http://opengeo.org/services/coredevelopment/openlayers/css_styling/

    It'd be really great to have a web designer friendly alternative to
    SLD.  It may be a bit too early right now, but at some point we
    should start an adhoc spec group, following on the successes of
    GeoRSS, GeoJSON, and WMS-C, to make a standard for CSS for Map
    Styling.  It'd be great to be able to share styles between
    GeoServer, Mapnik and MapServer, and to use Openlayers as a cross
    platform style editor (or the common basis for different approaches
    to map styling).  We'd be interested in collaborating on a spec, and
    on implementations for OpenLayers and GeoServer.

    Chris.

        Regards,


-- Chris Holmes
    OpenGeo - http://opengeo.org
    Expert service straight from the developers.



_______________________________________________
Geowanking mailing list
[email protected]
http://geowanking.org/mailman/listinfo/geowanking_geowanking.org

Reply via email to