Hello,
In my project I try to load an image which its corners are not rectangular.
After loading, the image is displayed as a rectangle (as it should) but the corners’ coordinates are not as they should be.
It seems that the corners are being “cut” as an aligned rectangle.
I attach a document with examples to show what I mean.
Thanks,
Miri.
Opening a non rectangular GDAL raster layer
Hi Miri,
It looks we render the image correct, the problem is it looks resize.
The coordinate is related with your world file for image if that image isn’t coordinates self-contained. So please check the world file first, then view your map setting to make sure you are using correct MapUnit and whether you are using Projection.
In fact I guess the problem should be you are using different x-y system in two tools, because it looks the width and height is reverse in two screen shots. In our map x meant longitude and y meant latitude.
Regards,
Don
Hi Don,
Thanks for helping.
What I’d like to know is if there is a way to load a raster image that its corners’ coordinates are not a rectangle (the image edges are not parallel). It means that the upper left coordinate is not on the same latitude as the upper right coordinate and that the 2 left corners are not on the same longitude value.
The shape of the image may be a trapeze or another Quadrilateral. Also, the image is not aligned to the north.
Are these images supported? So far I don’t see a way to load such a map image because there must be a rectangle bounding box.
Is there a workaround or a solution?
Thanks,
Miri.
Hi Miri,
I asked our developer about the corner, and know if your corner is transparent, we will draw that as transparent also.
From your screen shots, we don’t know how your image looks like in Opticks because your background of that utility is black also.
Could you please make sure the image don’t contains a black corner but is a transparent corner?
Regards,
Don
Hello Don
I will try to clarify my question.
The transparency issue is not relevant to my problem. The corners are not black or transparent.
I need to know how to open/load and correctly place the image on the map in the correct geographic location.
When we try to open a trapezoid image (meaning an image that it’s corners geographic location creates a trapezoid shape) by RasterLayer we see that the image is been “Cropped” to a rectangular image .
As you can see in the attached file in the initial question:
In Opticks - the geographic location of the corners represents a trapezoid
In thinkGeo - the geographic location of the corners represents a rectangle (which has the same top left corner as the original top left of the trapezoid, but the right bottom corner is dislocated.)
In case we are not able to perform a correct geographical placement of trapezoids image by thinkGeo, we may need to use other platforms.
So this is a critical issue for us.
Is there a workaround or a solution for this issue?
Regards
Miri
Hi Miri,
Thanks for your further information about your question.
Just like you know, in our map we need to specified a rectangle shape for an image as its world file, it cannot be a irregular shape like rectangular, so when you render your image in our map, you can see the black edge.
But we won’t crop the shape. You can watch your two screen shots, it only looks resize but contains all shapes. About it’s upper-left point is in same coordinate but the lower-right is different, I think that’s related your world file for nsf. We plot image based on corresponding world file or its self-contained world information.
So if you want to shows nsf in our map which looks like in opticks, please check the world file whether it contains correct extent information, and please show me your code how to render nsf, I want to know whether it’s self-contained world information or have a corresponding world file.
Regards,
Don