2

I have a layer with polygons - rectangles to be specific. For every rectangle there is an image specified. That's basically ImageMosaic format but ImageMosaic does not have feature info on those rectangles and I need it to be able to filter out specific rectangles.

I'd like to render a specific image for every rectangle feature and want this image to be stretched to the rectangle boundaries. This gives me repeated images in the rectangle

<GraphicFill>
  <Graphic>
    <ExternalGraphic>
      <OnlineResource
        xlink:type="simple"
        xlink:href="http://image.url" />
      <Format>image/png</Format>
    </ExternalGraphic>
  </Graphic>
</GraphicFill>

while I need one stretched image like:

<VendorOption name="graphic-resize">stretch</VendorOption>

No idea how to model this, maybe somehow with labels?

1

I'm afraid there is no vendor option providing the behavior you need. It could be implemented though.

  • that'a a pitty but.. what I have right now is almost what I need besides the size of the image. I've used centroid point symolizer with external image, the only thing left is to calculate pixels size of the image, isn't this possible somehow with env params wms_height, wms_scale_denominator etc? – PiotrkS Jan 20 '17 at 14:04
  • It would make for a very convoluted SLD, and would still not work, since you can only assign a size to an image, but not a form factor (e.g., control width and height independently). Adding a stretch option would not be that much work, if you are interested I can point you to the classes that need to be modified, or if you want someone else to do it for you, there is also commercial support available, see here for a list of providers: geoserver.org/support – Andrea Aime Jan 21 '17 at 10:02
  • I can at least try :) please give me few class names that I can look around – PiotrkS Jan 23 '17 at 7:56

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.