ThinkGeo.com    |     Blog    |     Wiki    |     Support

GeoTiff is "jumping" on zooming

Hi Ethan,
to use projected Datasets I think I have to project them:
Base Coordinate System (internal) for MapSuite is EPSG:=3857 or 900913…correct?
When adding a layer I must set projection like

proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(25832);
        proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();

correct?
So I have to do this each time adding a projected layer?
Am I wrong?
How to handle multiple layers with different projection?

I think, that’s the question.

We use several layers in different projection and digitize vector data on the raster, storing the vector geometry in PostGIS.
When reading the captured data with ohter GIS (like QGIS) the results are correct.
So why not project both layer?

I’m a bit confused about “…the two layer cannot cover…”

Regards
Hardy

Hi Hardy,

I want to apologize for I hadn’t describe it clearly.

At the beginning we thought your shape file is not the same projection with your geotiff file, so we only set projection to the shape file(it contains the prj file). That’s why I mentioned the two layer cannot cover.

And after that when our developer implement the workaround, they ignore the projection, so you are right, if assign projection the jump appears obvious.

Just like I mentioned, it’s hard totally fix the not match between raster and vector layer, so the project magnify the not match result, that’s why we watch the jump after reproject.

I will ask our developer to research it and see how to provide a solution or workaround.

Please wait my update.

Regards,

Ethan

Hi Hardy,

Because we will have one day vacation, so our developer will back 3 days later. I want to update the status of this problem.

Because the different of tiff tile and screen pixel, the raster layer cannot totally match vector layer, that’s the reason of the “jump”.

After reprojection, the jump is watched easier because this process enlarged the error, the workaround we provided before is try to reduce the jump range by set a offset, and it don’t works after reproject because we need move this process to DrawImageCore instead of GetImageCore.

But we are thinking another solution for it, if this solution still don’t works, we have to get back the workaround and try to find a better value for different levels.

Regards,

Ethan

Hi Hardy,

Our developer had fixed this issue, it don’t need the workaround now, we fixed some bugs related with it and when test it works better than before.

Please get the packages:


and

when they are avialiable in NuGet, any question please let us know.

Regards,

Ethan

Hi Ethan,

I have installed the new packages.
Working fine.

But now we get some problems when loading/displaying raster in different scales:
Zooming out from 1:500 to 1:1000 the raster will be displayed as stripes…

Exporting the map to GeoTIFF and reloading (remember my last post) will not display the GeoTIFF. But zooming out three or four times the GeoTIFF will be displayed as stripes.

It seems to me an issue with compression from raster.

Attached you’ll find an exported GeoTIFF. (EPSG 25832).

Please try to load that file with your Printing Example.
Zoom around…you should get the issue.

Regards
HardyTemp.zip (1.1 MB)

in addition a screen shot showing the issue from production area…

Have fun…

Hi Hardy,

Thanks for your update.

It looks when I tested it the simple code cannot render the tiff file.

        map.MapUnit = GeographyUnit.Meter;

        GeoTiffRasterLayer layer = new GeoTiffRasterLayer(@"D:\tmpB35.tif", @"D:\tmpB35.tfw");
        layer.Open();
        map.CurrentExtent = layer.GetBoundingBox();

        LayerOverlay overlay = new LayerOverlay();
        overlay.Layers.Add(layer);

        map.Refresh();

Our developer will looks into it, try to reproduce your issue and solve it.

Any update I will let you know.

Regards,

Ethan

Hi Hardy,

Please try this package: https://www.nuget.org/packages/ThinkGeo.MapSuite.Layers.Wmts/11.0.0-beta018

It should solved this new problem.

Regards,

Ethan

Hi Ethan,

it’s working.
Many thanks for your support.

Best regards
Hardy

Hi Hardy,

I am glad to hear that works.

Any question please let us know.

Regards,

Ethan

Hi Ethan,

sorry for getting back to this issue.
But when using a GeoTIFF File without TFW File and loading a TrackOverlay the raster will be shifted.
Removing the TrackOverlay the raster will go back to it’s legal position…
Very strange…

I have tested that behaviour with several tif files.
Only when using tfw the raster will keep the correct position.

So I have generated tfw files for all tif files in my project…

Maybe you can check that.

Regards
Hardy

Hi Hardy,

Thanks for your information. We tried to remove TrackOverlay follow you mentioned, but we hadn’t reproduced the issue. We tested the “bevenrode.tif” without “.tfw” file.

If you think we miss any step please point out, any code or sample is helpful.

And this post is too long, if you think we need to disucss about it further, could you please create a new post about it?

Thanks,
Rex