-2

I want to render some data on a map. They are stored as points in my database (PostGIS), each one is associated with a name. I want to render points with the same place name in the same colour.

However, I don't want to put the name of the places directly in my .xml style file. (Too many places)

Do you know how can I do ?

Maybe an idea is to try to return JSON data in OpenLayers js, but I don't know how I can get it. Does GeoServer enable to return JSON to OpenLayers?

nmtoken
  • 13,355
  • 5
  • 38
  • 87
Gabriel
  • 181
  • 1
  • 5

1 Answers1

1

If you are serving your data with Geoserver, let me suggest that you serve the data as a WMS service.

You can style the data with SLD, and have them labeled, like shown in this article: Labeling

Devdatta Tengshe
  • 41,311
  • 35
  • 139
  • 263