Hi,
I’m trying to utilize a map window in the Google projection (epsg 3857), including allowing editing of features.
However, I want my features stored in my database as UTM zone 32 (epsg 25832) to maintain backward compatability with other applications. They’re stored as WKT as it’s a non-spatial db.
My app’s basically a clone of a previous app (that works perfectly), that was all in UTM zone 32. I’m just adding “Projection” clauses whereever needed for this new app.
But it seems like Map Suite ignores some of the Projection settings, especially on the EditOverlay.FeatureSource object.
I’m looping thru the features in the overlay, either using “Map1.EditOverlay.Features” or “Map1.EditOverlay.FeatureSource.InternalFeatures”, and I’ve set the Projection of the EditOverlay in advance:
Map1.EditOverlay.FeatureSource.Projection = New ManagedProj4Projection(ManagedProj4Projection.GetEpsgParametersString(3857), ManagedProj4Projection.GetEpsgParametersString(25832))
But the features that are retrieved from EditOverlay seem to be in the 3857 projection regardless of the Projection setting, which I assumed to handle coordinate conversions automagically ?
Please help me by explaining the inner working of the illusive “Projection” setting on overlays and layers in this scenario.
Cheers.
Handling re-projection with EditOverlay and layers?
Ah well!
I started by disabling all Projection settings, as it seemed I’d lost track of the ones I’d defined. And then enabled just a basic few.
I then utilized ManagedProj4Projection’s ConvertToInternalProjection, as in:
ft = (Layer).FeatureSource.Projection.ConvertToInternalProjection(ft) '3857 => 25832
This did the trick, the ft.GetWellKnownText() then returned UTM32 coordinates instead of 3857/Google ditto.
I was too overzealeous with my projection handling, it seems :-)
No worries any more. Cheers.
Hi Lars,
Thanks for your detail update, I think it still be a valuable topic if someone met same problem.
Any question please feel free to let us know.
Regards,
Don