Opened 5 years ago

Last modified 5 years ago

#2805 new defect

Bitonal Images Colour Override Not Respected in Viewer

Reported by: crispinatime Owned by:
Priority: medium Milestone: 4.0
Component: Server Version: 3.1.0
Severity: major Keywords:
Cc: External ID:

Description

As per http://osgeo-org.1560.x6.nabble.com/Colour-Overrides-in-Bitonal-Images-tt5412153.html

I have replicated this on MG 3.1.1 and 4.0 Preview

I can't get the colour override to work for bitonal images. Converting a site from AIMS to MGOS and this is the final difference to resolve. Has anyone tried/used this feature recently. Sample data:

ns9359.tif

<http://osgeo-org.1560.x6.nabble.com/file/t200954/ns9359.tif>

ns9359.tfw

<http://osgeo-org.1560.x6.nabble.com/file/t200954/ns9359.tfw>

eg layer style below

Expected outcome - bitonal image appears in viewer with colour overrides Actual outcome - bitonal image appears in viewer in black/white original

<ColorStyle>

<ColorRule>

<LegendLabel /> <Color>

<ExplicitColor>ffff00</ExplicitColor>

</Color>

</ColorRule> <ColorRule>

<LegendLabel /> <Color>

<ExplicitColor>ff0000</ExplicitColor>

</Color>

</ColorRule>

</ColorStyle>

Attachments (2)

bitonal.jpg (31.1 KB ) - added by crispinatime 5 years ago.
Expected Outpuy Colours
text_watermark.png (699.6 KB ) - added by jng 5 years ago.
Raster map with text watermark

Download all attachments as: .zip

Change History (11)

comment:1 by jng, 5 years ago

If the AIMS environment you are migrating from is still up, could you attach a viewer screenshot of what this raster is meant to look like?

comment:2 by jng, 5 years ago

Milestone: 4.0

by crispinatime, 5 years ago

Attachment: bitonal.jpg added

Expected Outpuy Colours

comment:3 by crispinatime, 5 years ago

I wondered if the GDAL resampling options didn't respect colour depth after resampling but even with the optional GDAL resampling turned off the same effect occurs

comment:4 by jng, 5 years ago

I loaded this example raster on a 2.5.2 install and the settings aren't respected there either. I'm wondering if this has ever worked for the GDAL provider?

comment:5 by jng, 5 years ago

Welp, I think I have my answer.

The GDAL FDO provider doesn't appear to support bitonal images in its raster data model, and because raster data model capabilities don't surface up to MapGuide's GETPROVIDERCAPABILITIES API, we have no means to cut off parts of the editor UI that are not supported or applicable, thus giving a false appearance in Maestro that you can edit bitonal color settings for a raster layer pointing to a GDAL feature source:

comment:6 by crispinatime, 5 years ago

So, that is a bit of a problem then!

A separate ticket for Maestro maybe in offering that option when the source is GDAL?

I thought I came up with a workaround to apply custom transparent PNG watermarks to raster the specific raster layers I want to tint. However, I only just found out that watermarks cannot be applied to raster layers. This seems a RFC-worthy addition as many aerial imagery providers require custome copyrights. Is this right or am I missing something else?

by jng, 5 years ago

Attachment: text_watermark.png added

Raster map with text watermark

comment:7 by jng, 5 years ago

Are you sure? I just made a throwaway map with NaturalEarth raster with a text watermark (the NE attribution text) and it appears just fine (see attached text_watermark.png)

Regarding the underlying issue at hand. I wonder if the WMS FDO provider supports bitonal images. If you served your raster image behind another WMS server (for the sake of argument, something *not* MapGuide) and then try to setup a WMS raster image layer in MapGuide with the desired bitonal color settings, do these color settings apply in this case?

If the WMS provider works in this case, then it may assist in getting bitonal image support into the GDAL FDO provider because I'm pretty sure the WMS FDO provider also uses GDAL as well.

comment:8 by crispinatime, 5 years ago

OK-- I was not sure and I did manage to add a watermark via a solid colour PNG with transparency to a layer. What I DIDN'T see was the watermark editor panel in Maestro, I had to create a layer watermark in the Maestro GUI for a vector layer and then use the XML editor to copy the watermark from the vector layer to the raster layer. Are you seeing the watermark panel for rasters in Maestro?

(MapGuide 4.0 Preview, Maestro build from trunk)

Note: See TracTickets for help on using tickets.