[GeoNode-users] GeoNode Layer Style Weather Symbols and Web Links

Julierme Pinheiro juliermeopensourcedeveloper at gmail.com
Mon Jan 21 09:18:43 PST 2019


Hi Toni,

am I correct that you´re using the geoserver css extension?

Yes. You are right. I am using css extension.

Can you supply the generated sld?

Yes. I am send it in attached.

$ ll ./geoserver/data/styles/thunder.svg

-rwxr-xr-x 1 tomcat8 tomcat8 1918 jan 21 10:52 ./thunder.svg*

I changed geonode_css.css file as shown bellow and I am sending
geonode_css.sld in attached. It still not working.

* [weather = 4]{
  mark: symbol('circle');
  mark-size: 5;
}

:mark {
  fill: cyan;
  stroke: darkblue;
}

[weather = 0] {
  mark: url(day.svg);
  mark-mime: "image/svg";
  mark-size: 100;
}


I appreciated you help and time.

Kind regards

Julierme

On Mon, Jan 21, 2019 at 2:08 PM Toni Schönbuchner <
toni.schoenbuchner at csgis.de> wrote:

> Hey Julierme,
>
> am I correct that you´re using the geoserver css extension?
> Can you supply the generated sld?
>
> Further the output of:
>
> $ ll ./geoserver/data/styles/sunny.svg
>
> Further I think the mime type in sld for svg is
> <Format>image/svg+xml" </Format>
>
> your could try
> mark-mime: "image/svg+xml"
> (unsure about this just a shot in the dark)
>
> Cheers,
> Toni
>
> -----------------------------------------------
> CSGIS
>
> -----------------------------------------------
> Kolonnadenstraße 1
> 04109 Leipzig
> -----------------------------------------------
> Tel  +49/ (0) 341 24 04 738
> Fax  +49/ (0) 341 24 04 739
> Web http://csgis.de
> -----------------------------------------------
>
> Hinweis gemäß § 33 BDSG
> Daten der Verfahrensbeteiligten werden gespeichert. Dieses Dokument ist
> ausschließlich für den
> Adressaten bestimmt. Der Inhalt der E-Mail ist vertraulich. Falls Sie
> diese E-Mail versehentlich
> erhalten haben, rufen Sie uns unter obiger Rufnummer umgehend an und
> löschen Sie diese Nachricht
> von Ihrem Computer. Jegliche Art von Reproduktionen, Verbreitung,
> Vervielfältigung, Veränderung,
> Verteilung und/oder Veröffentlichung dieser E-Mail ist verboten.
>
> Am 21.01.2019 um 16:51 schrieb Julierme Pinheiro <
> juliermeopensourcedeveloper at gmail.com>:
>
> Dear Jorge and Toni,
>
> Thank you very much for your reply.
>
> I have a table (db_brasilia_weather) in postgis. The table
> db_brasilia_weather has two attributes: weather and url_image. weather
> attribute has integer values of weather status and url_image attribute: the
> path for the weather images cloudy.svg, thunder.svg, sunny.svg, rainy.svg.
>
> db_brasilia_weather
>
> id     weather      url_image
> 1          0             sunny.svg
> 2          5             thunder.svg
> 3          1             rainy.svg
>
> *.svg images are stored in  /webapps/geoserver/data/styles
>
> Based on the information, Creating Point Styles in [1] and Item 3.4.2
> about Graphic in [2], I created the following CSS (geonode.css) file:
>
> * {
>   mark: symbol('circle');
>   mark-size: 5;
> }
>
> :mark {
>   fill: cyan;
>   stroke: darkblue;
> }
>
> [weather = 0] {
>   mark: url(./geoserver/data/styles/sunny.svg);
>   mark-mime: "image/svg";
>   mark-size: 100;
> }
> I have tried mark: url(sunny.svg),
> url("./geoserver/data/styles/sunny.svg"), but none of these configuration
> have been successful.
>
> Any additional comment on this matter will be very appreciated.
>
> Thank you very much for your time in advance.
>
> Kind Regards
>
> Julierme
>
>
> [1]
> http://docs.geonode.org/en/master/tutorials/advanced/adv_data_mgmt/pretty_maps/css.html#creating-point-styles
> [2]
> https://docs.geoserver.org/stable/en/user/styling/workshop/css/point.html
>
>
>
>
>
> On Sun, Jan 20, 2019 at 5:53 AM Toni Schönbuchner <
> toni.schoenbuchner at csgis.de> wrote:
>
>> Hi Julierme,
>>
>> I don´t think you can access a postgis entity  directly from SLD.
>> The Point Symbolizer allows external graphics as mark or ressource.
>>
>> https://docs.geoserver.org/stable/en/user/styling/sld/reference/pointsymbolizer.html#externalgraphic
>> Where an external ressource could also be identified as URL.
>>
>> Means you could add the SVG to your static root or in some other public
>> directory or even dropbox and use it as symbol. As alternative it should
>> work
>> to specific a relative path outside of the data dir where tomcat is
>> allowed to read
>> from. With second linking to the file gets harder.
>>
>> May I ask you why the svg should be stored in the database? – unsure if
>> there
>> is some better way but for sure you could just create a django view to
>> output
>> the svg from postgres and use it like this in your sld.
>>
>> Cheers,
>>
>> Toni
>>
>> > Today's Topics:
>> >
>> >   1. Re: GeoNode Layer Style Weather Symbols and Web  Links
>> >      (Julierme Pinheiro)
>> >
>> >
>> > ----------------------------------------------------------------------
>> >
>> > Message: 1
>> > Date: Fri, 18 Jan 2019 18:59:40 -0200
>> > From: Julierme Pinheiro <juliermeopensourcedeveloper at gmail.com>
>> > To: geonode-users <geonode-users at lists.osgeo.org>
>> > Subject: Re: [GeoNode-users] GeoNode Layer Style Weather Symbols and
>> >       Web     Links
>> > Message-ID:
>> >       <CAKTKyJK9dtC9MX_QHHH+bJvswgBzcC=
>> BPOwodR840KZLPoZ0aA at mail.gmail.com>
>> > Content-Type: text/plain; charset="utf-8"
>> >
>> > Hi GeoNode users,
>> >
>> > Regarding my previous email, looking at GeoServer documentation
>> > <
>> https://docs.geoserver.org/stable/en/user/styling/sld/extensions/pointsymbols.html#external-graphics
>> >,
>> > I got the piece of SLD bellow, but burg02.svg is being retrieved from
>> > $GEOSERVER_DATA_DIR/styles.
>> >
>> > I would like to have:
>> > 1 - burg02.svg being retrieved from a postgres table;
>> > 2 - make a webpage link on burg02.svg through the  SLD file
>> >
>> >
>> > <PointSymbolizer>
>> >   <Graphic>
>> >     <ExternalGraphic>
>> >       <OnlineResource xlink:type="simple" xlink:href="burg02.svg" />
>> >       <Format>image/svg+xml</Format>
>> >     </ExternalGraphic>
>> >     <Size>20</Size>
>> >   </Graphic>
>> > </PointSymbolizer>
>> >
>> >
>> > Any hint on that will be very appreciated.
>> >
>> > Kind regards
>> >
>> > Julierme
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20190121/40afa9d5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: geonode_css.sld
Type: application/octet-stream
Size: 2017 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20190121/40afa9d5/attachment.obj>


More information about the geonode-users mailing list