[Geoserver-devel] Implement custom function

Hello everyone,

I am trying to implement a new function on my geoserver but I keep failing. I succeed to implement WPS process but function…
I tried the tutorial on geotools (http://docs.geotools.org/latest/userguide/tutorial/function.html) but it won’t work. The problem is not the custom function itself but more a problem of referencing. How do I reference a new function to geoserver and use it in SLD ? Can you be a more bit precise than
"

  1. We can now register our factory.

    Create the file:

    • META_INF/services/org.geotools.filter.FunctionFactory
  2. Fill in the following contents (one implementation class per line):

    org.geotools.tutorial.function.ExampleFunctionFactory
    

"

and describe the steps I may have missed .

Thank you

···

Matthieu BONVENTI

Hi Matthieu,

you can have a look at this project https://github.com/geobeyond/fluxomajic/tree/master/src/main/resources/META-INF/services and after building place your library in the geoserver lib directory.

Hope it helps.

Francesco

···

Matthieu BONVENTI

Thank you, I found the solution my self, I d like to send a mail to people who wrote the function tutorial

The folder name is not META_INF but META-INF and I had to put it in a folder named “resources” that I created under src/main.

Now it works perfectly…maybe they should have said this in the tutorial…

Matthieu Bonventi

      1. 오후 3:15에 “Francesco Bartoli” <francesco.bartoli@anonymised.com>님이 작성:

Hi Matthieu,

you can have a look at this project https://github.com/geobeyond/fluxomajic/tree/master/src/main/resources/META-INF/services and after building place your library in the geoserver lib directory.

Hope it helps.

Francesco

------------------------------------
Ing. Francesco Bartoli
CTO & Owner
Geobeyond Srl
Via M. Augusta 68
02040 - Vacone (RI) - Italy
http://www.geobeyond.it
Mob: +39 333 2997173
Mail: francesco.bartoli@anonymised.com
Twitter: @geobeyond
SkypeId: francesco_bartoli

Il giorno 16/gen/2015, alle ore 12:51, Bonventi Matthieu <matthieu.bonventi@anonymised.com> ha scritto:

Hello everyone,

I am trying to implement a new function on my geoserver but I keep failing. I succeed to implement WPS process but function…
I tried the tutorial on geotools (http://docs.geotools.org/latest/userguide/tutorial/function.html) but it won’t work. The problem is not the custom function itself but more a problem of referencing. How do I reference a new function to geoserver and use it in SLD ? Can you be a more bit precise than
"

  1. We can now register our factory.
    Create the file:

    • META_INF/services/org.geotools.filter.FunctionFactory
  2. Fill in the following contents (one implementation class per line):

    org.geotools.tutorial.function.ExampleFunctionFactory
    

"

and describe the steps I may have missed .

Thank you

Matthieu BONVENTI


New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

On Fri, Jan 16, 2015 at 3:18 PM, Bonventi Matthieu <
matthieu.bonventi@anonymised.com> wrote:

Thank you, I found the solution my self, I d like to send a mail to people
who wrote the function tutorial

The folder name is not META_INF but META-INF and I had to put it in a
folder named "resources" that I created under src/main.

Now it works perfectly...maybe they should have said this in the
tutorial...

The tutorial is in the source code, you can also make a pull a request and
contribute a fix :slight_smile:

https://github.com/geotools/geotools/blob/master/docs/user/tutorial/function.rst

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------

Thanks for catching the typo - fix applied:

https://github.com/geotools/geotools/commit/699fc4295a82906cc684d71d8eb39b3ec939c129

···

On 16 January 2015 at 06:18, Bonventi Matthieu <matthieu.bonventi@anonymised.com> wrote:

Thank you, I found the solution my self, I d like to send a mail to people who wrote the function tutorial

The folder name is not META_INF but META-INF and I had to put it in a folder named “resources” that I created under src/main.

Now it works perfectly…maybe they should have said this in the tutorial…

Matthieu Bonventi

      1. 오후 3:15에 “Francesco Bartoli” <francesco.bartoli@anonymised.com>님이 작성:

Hi Matthieu,

you can have a look at this project https://github.com/geobeyond/fluxomajic/tree/master/src/main/resources/META-INF/services and after building place your library in the geoserver lib directory.

Hope it helps.

Francesco

------------------------------------
Ing. Francesco Bartoli
CTO & Owner
Geobeyond Srl
Via M. Augusta 68
02040 - Vacone (RI) - Italy
http://www.geobeyond.it
Mob: +39 333 2997173
Mail: francesco.bartoli@anonymised.com
Twitter: @geobeyond
SkypeId: francesco_bartoli

Il giorno 16/gen/2015, alle ore 12:51, Bonventi Matthieu <matthieu.bonventi@anonymised.com> ha scritto:

Hello everyone,

I am trying to implement a new function on my geoserver but I keep failing. I succeed to implement WPS process but function…
I tried the tutorial on geotools (http://docs.geotools.org/latest/userguide/tutorial/function.html) but it won’t work. The problem is not the custom function itself but more a problem of referencing. How do I reference a new function to geoserver and use it in SLD ? Can you be a more bit precise than
"

  1. We can now register our factory.
    Create the file:

    • META_INF/services/org.geotools.filter.FunctionFactory
  2. Fill in the following contents (one implementation class per line):

    org.geotools.tutorial.function.ExampleFunctionFactory
    

"

and describe the steps I may have missed .

Thank you

Matthieu BONVENTI


New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Jody Garnett

Ah ok I didn’t notice . I was talking about the tutorial on geotools website. All seems to be ok now, I’m beginner I hope to learn a lot about geoserver/geotools in the near future

Matthieu Bonventi

That is the source code for the website, in about 30 mins the website will update with the fix.

···

On 16 January 2015 at 07:07, Bonventi Matthieu <matthieu.bonventi@anonymised.com> wrote:

Ah ok I didn’t notice . I was talking about the tutorial on geotools website. All seems to be ok now, I’m beginner I hope to learn a lot about geoserver/geotools in the near future

Matthieu Bonventi


Jody Garnett