2

I'd like to ask what ways there might be to adjust a point's getFeatureInfo search area so that it matches a "pointer" (i.e slightly offset) symbol.

We are running GeoServer 2.2.0 (part of an Opengeo Suite) and the symbology(SLD) for some point layers is various forms of "pointers", that is to say that the center of the icon is not at the center of the point, rather it points to the point, like an arrow or a badge with a small pointer at the bottom or a map pin. (SVG graphics.)

There appears to be two ways one can get the point symbols offset:

I. Modify the SVG graphic to contain a transparent area in one end, see exhibit A. This method provides an empty area for getFeatureInfo corresponding to the transparent area in the SVG symbol as in geoserver's docs on point slds - one can however then click to the side of the visible symbol and still get a hit, which is unwanted.

II. Use the offset function in the SLD for the point layer. The effect this has is that while the "pointer", or pin symbol is properly offset the search area remains centered on the point. See B.

1

GetFeatureInfo doesn't work on an area only a point (x/y or i/j pixel coordinate) in a GetMap image.

If the problem is that the point symbol doesn't match the location you want to be queried, then one solution for GeoServer would be to define a buffer, that you add to the GetFeatureInfo request buffer=<bufferwidth> defined in pixels.

See the GeoServer vendor parameters docs for more details.

0

I think both of those solutions are not perfect :

Add a transparent area at the bottom of the icon will add problems with legend rendering (Icons are very small)

The parameters to use for the offset SLD function will vary with the map scale, because it modifies the geometry (in map units) and not the icon position in pixel.

Unfortunatelly I never found the perfect solution for set the point on the ceter of a pin with Geoserver :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.