ThinkGeo.com    |     Documentation    |     Premium Support

Problems with projection / map-Extent

Hi,

i have data in EPSG31466-ccordinates. As an exampe i just create a square with 1km each side with the coordinates
2528020, 5665666
2528020, 5666666
2529020, 5666666
2529020, 5665666
2528020, 5665666.

When i render this in Geomedia on a map with coordinate-system GK2, it is shown (as expected) as a square.

I need to show data in the same projection in MapSuite. If i just create a feature with a rectangle-shape with the given coordinates, i don’t see anything on the map, even when i set the CurrentExtent of the mapcomponent to the bounding-box of the layer (i use an inMomemoryLayer).

When i apply a projection from 31466 to 4326 on the FeatureSource of my layer i see data in the right “area” of the map, but distorted (the square is then a rectangle with twice the width as height)

When i apply a projection from 31466 to google on the FeatureSource of my layer i don’t see anything.

The same Problems arise with my WMS-Services. The data is stored as EPSG:31466, but when the data is shown on the map the projection is wrong.

Any help is appreciated.

Regards,
Andreas

Hi Andreas,

Please try the test code as below, which looks works well. If you don’t need cover the shape into other layer, you don’t need set its projection, just need assign correct mapunit, style and extent.

Map1.MapUnit = GeographyUnit.Meter;

        LayerOverlay overlay = new LayerOverlay();
        InMemoryFeatureLayer layer = new InMemoryFeatureLayer();
        layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
        layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

        RectangleShape rect = new RectangleShape(2528020, 5666666, 2529020, 5665666);
        
        layer.InternalFeatures.Add(new Feature(rect));
        overlay.Layers.Add(layer);
        Map1.Overlays.Add(overlay);

        layer.Open();
        Map1.CurrentExtent = layer.GetBoundingBox();

        Map1.Refresh();

For the WMS-Services, it’s a little special, because it cannot be reprojection, so if the target projection is not 3857 or 4326 maybe you will met some problem. But you can let us know the detail and show us the code, so we can help you see whether the problem can be solved.

Regards,

Don

Hi Don,

thank you, it works now.

Regards,
Andreas

Hi Andreas,

I am glad to hear that works.

Regards,

Don