How to overwriter ShapeMarkerFactory In GeoServer?

36 Views Asked by At

I want to create a new Mark in GeoServer's SLD style, but I can't find MarkFactory interface in GeoServer sources code, and I can't find the ShapeMarkFactory class in these code. I don't know where can I add the Geotool class in GeoServer's source code and make it work, or where I can overwriter the ShapeMarkFactory class to add a new WellKnowName Mark In Mark.

1

There are 1 best solutions below

0
Ian Turton On

You should add a new factory to GeoServer rather than try to modify the existing one.

There is a Factory tutorial for GeoTools (which is what does the work in GeoServer) which will show the basic principal for creating a factory and using the SPI system to register it with GeoTools applications like GeoServer.

Once you have written your new factory which can either extend ShapeMarkFactory or implement MarkFactory if you want a different prefix to trigger it. You'll need a file called META-INF/services/org.geotools.renderer.style.MarkFactory (in the resources folder of your project) that file should contain a line with the fully qualified name of your factory.

Then you can use mvn to compile the project into a jar file or a zip including any necessary external jars. You can then add those jars to the WEB-INF/lib folder of your GeoServer install and restart it.