This project is read-only.

Layer offset

Apr 16, 2011 at 2:12 PM

Hi everyone,

Is it possible to put some offset in a layer that is to be projected on map? The reason for this is that I have several local map sources that I have to use and they aren't very precise so I need to tune them to one another occasionally.



Apr 18, 2011 at 3:27 PM

if you assign a ProjectionInfo to your layer, you can modify FalseEasting and FalseNorthing values to move your layer around

Hth FObermaier

Apr 20, 2011 at 9:15 PM

Thanks. I've tried to assign slightly different FalseEasting value (for instance from 500000 to 501000) and then clicked Apply in Layer/Projection dialog, but nothing happened. Then I've clicked Apply in Map Layers/Projection dialog and the layer moved to the right. But when I turned back to original value of FalseEasting, the layer remained on it's position - it doesn't move back. After that, whatever I do, after clicking Apply button in Map Projection dialog, the layer moves to the there a bug or am I doing something wrong? I'm prone to think it's the other one :)


Apr 21, 2011 at 9:34 AM

My guess would be that somehow the Layer is not aware that the projection has changed and thus does not invalidate the vertices, but that is just a guess. Unfortunatly I have no time to check.

Try calling InvalidateVertices() after changing the projection.

If that is the problem, ProjectionInfo would need some way to propagize that it is "dirty" (e.g. _isDirty flag) that would have to be handled. Raise an issue!

Hth FObermaier


Apr 21, 2011 at 9:08 PM

I have used the following method:

- changing FalseEasting/FalseNorthing parameter for my layer,

- reprojecting the layer on map,

- calling map.MapFrame.Invalidate() method.

This procedure works fine with smaller raster images (using MapImageLayer), but not with larger ones. I understood from older topics that native Windows functions are used for smaller images, while for larger ones GDAL is utilized. Could this be a good trace to finding a bug?

I will raise an issue as you said.