07-01-2019 03:45 AM
Does anyone know if its possible to create a model to allow the user to select an image and then do an Export to GeoTIFF, defining the output name for the image? The ideal situation would be to be able to select multiple images, but if it has to be one by one it will fit the request also.
A second situation (version of the model) would be to clip the image based on a vectorial limit, before the output. Is there any operator to do that?
If any of this is possible, how to do it?
Solved! Go to Solution.
07-01-2019 05:25 AM
Yes, all of that is possible and easy in Spatial Modeler. Check out this example in the Spatial Modeler Tutorials section for vector-based subsetting:
Raster Output supports a number of formats to write directly, including TIFF.
07-13-2019 01:36 PM
I'm using the model, and it clips and export the result perfectly.
The question is that I'm using binary images, and the part of the mbr image that is outside of the clipped area is all in black, as you can see in the attached image.
Since the images are in black and white I can't change the foreground color in GeoMedia to a different one than black, but I can't have the rest of the image, outside the AOI, in black.
Is there any way to solve this?
07-15-2019 12:11 PM
After doing some tests in Spatial Model Editor, using the preview window, I can see that if I:
... I get a resulting image that solves this issue.
My question is: how do I include the operations of the 2nd and the 3rd bullet in the Model?
07-17-2019 02:05 AM
The Preview is persisting the NoData mask and so you’ll need an output format which also persists it. Which unfortunately means, if I recall correctly, you’ll need to wait for the 2019 releases later this year to have that type of TIFF supported by Spatial Modeler.
The other alternative to try would be to go 2-bit and code the data 0 for background (outside the AOI), 1 for black line work and 2 for white paper (or vice versa). There are several examples in Spatial Modeler Tutorials showing you how to attach Colour and opacity attributes to the class values you use.
Hope that helps.
07-17-2019 02:31 AM
Could you reference one tutorial that has this kind of situation?
I'll need to do a recode of the colors, but my main question (that I don't know if is explained in the tutorials), is how do I specify that I want to assign a value to one color, but just outside the AOI.
If you have an idea of a tutorial that has this situation I would appreciate.
Thanks a lot for your help.
07-22-2019 08:03 AM
Back from vacation and catching up with a few things.
Example of attaching colour attributes:
For converting from 1-bit to 2-bit here's what I'd do: Add 1 to your original data, so 0s and 1s become 1s and 2s (and the NoData mask remains a NoData mask) and then use the Replace NoData With operator to convert the NoData mask to values of 0. Now you have 0s (the area beyond your clipping AOI), 1s and 2s (black linework and white paper, depending on which way round they were originally encoded). Attach Color and Opacity attributes to these as appropriate and then send to GeoTIFF in Raster Output. You may need to use the Set Thematicity operator as well to make sure the data is being defined as thematic (rather than athematic / continuous).
07-22-2019 08:46 AM
The Add operator. Specify one of the input ports as "1" and the other as the raster stream.