(Remove at will)
I am testing to see if I CAN post to the forum as my other attempts to post have resulted in "An error has occurred" when I try to see my posts.
Sorry about the inconvenience.
Keld Laursen
Test
Hi Keld,
I noticed two threads you posted with the errors. I guess there might be some invalid characters in it. Here is a guide on posting rules, it might be help.thinkgeo.com/forums/MapSuite…fault.aspx
I will remove the two invalid posts and would you please check the content and try to post again?
Please feel free to let us know if you have any questions, it would be our pressure to assist you.
Thanks,
Troy
Hi Keld,
I found your content in our internal system. I attached it here so that you can reuse it and I reviewed your issue, it looks like a projection issue to make the epsg 25832 layer to match with Google layer, As we don’t have the data to recreate your issue, would you please attach some UTM zone 32N data here?
You can also send email to forumsupport@thinkgeo.com if the data are beyond the uploading file size. Or you can contact support@thinkgeo.com to setup an ftp account for you.
Also, you can feel free to open a new thread to make the topic looks make sense.
Thanks,
Troy
(It seems like my previous attempt at posting didn’t work. I have tried to limit the number of fonts etc. to reduce complexity)
Hello.
I am trying to get acquainted with Map Suite, which we will be using to show agricultural fields in one of our products.
We show fields on various backgrounds, depending on subscriptions. A few of the backgrounds are based on the Google API.
All our field data are stored in UTM zone 32N, datum Euref89. Google wants to show a Mercator map, which gives me some headaches.
We have tried to change the projection of our data into Mercator, but scale gets wrong. The fields are placed correctly on the map, but the map is about twice as large at it should be, if we ask our scale and map boundaries. This is very likely because Mercator has distance errors as we get further and further away from the equator.
I have therefore tried to project the Google layer into UTM instead. This works – mostly, as the fields are shown with the correct scale, but the map behind them is distorted as we near the edges of the displayed map rectangle. This results in my field polygons moving on the map if I pan the map.
Here is my code to set the projections used in our program:
m_GoogleMapProjection = new Proj4Projection();
m_GoogleMapProjection.InternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString(); // Epsg: 3857
m_GoogleMapProjection.ExternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(25832);
m_GoogleMapProjection.Open();
m_Epsg25832Projection.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(25832);
m_Epsg25832Projection.ExternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(25832);
m_Epsg25832Projection.Open();
Here is the code used to map a Google map into a layer:
string cacheDirectory = FileUtil.MapTileFileCacheFolderPath;
// Obs: Cachen bruges ikke når TileMode = SingleTile
GoogleMapsLayer worldLayer = new GoogleMapsLayer(cacheDirectory, ConfigurationManager.AppSettings[“GoogleClientId”], ConfigurationManager.AppSettings[“GooglePrivateKey”]);
worldLayer.MapType = mapType;
worldLayer.TileMode = GoogleMapsTileMode.SingleTile;
worldLayer.ProjectionFromSphericalMercator = m_Controller.CurrentProjection;
LayerOverlay worldOverlay = new LayerOverlay();
worldOverlay.Name = “WorldOverlay”;
worldOverlay.IsVisible = true;
worldOverlay.Layers.Add(“WorldLayer”, worldLayer);
GoogleMapsZoomLevelSet zoomLevelSet = new GoogleMapsZoomLevelSet();
zoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
m_Map.Overlays.Insert(0, worldOverlay);
When I add the polygon layer it is done like this:
m_FieldPolygonLayer = new FieldPolygonInMemoryLayer();
m_FieldPolygonLayer.FeatureSource.Projection = m_Epsg25832Projection;
Note that I use the UTM projection on this layer. A colleague tried to use the same projection as on the Google layer, but the fields ended up being somewhere in France. The correct place is somewhere in Denmark.
Also: When I switch from either no background or from a background which is already in EPSG 25832 and to Google Map background, then I get relocated to somewhere in France.
So: When I pan on a Google map, the data moves around on the map because of some scale problem I expect. Any ideas as to how I can resolve this?
And: When I change the background map from something that use UTM, EUREF89 to Google Map I get thrown somewhere else in the world. Probably because of some problem with extents and changing projections. Any ideas as to how to keep the zoom and, especially, the map position?
Best regards,
Keld Laursen
KNOWLEDGE CENTRE FOR AGRICULTURE