ThinkGeo.com    |     Documentation    |     Premium Support

Need help with coordinates OGC Services - Europe

Hi,

According to the coordinates, Mszczonowska street is at 52.132839559508824, 20.891170983827966.
(Mszczonowska, 05-090 Janki, Poland
Latitude: 52.13284 | Longitude: 20.891171), but I can’t get this location by entering pointshape in the code below.

In addition, I am trying to draw a line based on the following data, also does not get the expected result on screen.

“\ColdFront1.txt”
LINESTRING (52.132839559508824 20.8911709838279696.52.13277891365223 20.891067296445456.52.13271766617681 20.89096031310927)

@page “/work-with-ogc-services”
@using System.Collections.ObjectModel
@using ThinkGeo.Core
@using System.Text
<MapView Id=“map” @ref=“map”
Width=“100”
Height=“100”
MapViewSizeUnitType=“MapViewSizeUnitType.Percentage”
Center="@(new PointShape(52.132839559508824,20.891170983827966))"
Zoom=“15”
MapUnit="@ThinkGeo.Core.GeographyUnit.Meter">










@code {
MapView map;
Collection serverUris = new Collection { new Uri(“http://ows.mundialis.de/services/service”) };
Dictionary<string, string> parameters = new Dictionary<string, string>
{
{ “layers”, “OSM-WMS”},
{ “STYLE”, “default”},
{ “CRS”,“4326”}
};

private List<StylingModel> stylings;
private string accessId = Guid.NewGuid().ToString();
GeoCollection<Layer> Layers = new GeoCollection<Layer>();

protected override void OnInitialized()
{
    string baseDirectorybaseDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Data");

    LineStyle lineStyle = LineStyle.CreateSimpleLineStyle(GeoColors.Black, 2, false);

    InMemoryFeatureLayer inMemoryFeatureLayerColdFront = new InMemoryFeatureLayer();
    inMemoryFeatureLayerColdFront.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(lineStyle);
    inMemoryFeatureLayerColdFront.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

    StreamReader s = new StreamReader(baseDirectorybaseDirectory + @"\ColdFront1.txt");

    LineShape lineShape2 = new LineShape(s.ReadLine());
    inMemoryFeatureLayerColdFront.InternalFeatures.Add(new Feature(lineShape2));

    Layers.Add("ColdFront", inMemoryFeatureLayerColdFront);
}

}

Thanks for answers

@page "/work-with-ogc-services"
@using System.Collections.ObjectModel
@using ThinkGeo.Core
@using System.Text
<MapView Id="map" @ref="map"
         Width="100"
         Height="100"
         MapViewSizeUnitType="MapViewSizeUnitType.Percentage"
         Center="@(new PointShape(52.132839559508824,20.891170983827966))"     
         Zoom="15"
         MapUnit="@ThinkGeo.Core.GeographyUnit.Meter">
    <OverlaysSetting>
        <WmsTileOverlay Id="WmsOverlay" Parameters="@parameters"
                        ServerUris="@serverUris"
                        TileHeight="512" TileWidth="512">
        </WmsTileOverlay>
        <LayerOverlay Id="RadiusOverlay" Layers="@Layers"></LayerOverlay>
    </OverlaysSetting>
    <MapToolsSetting>
        <MapTools>
            <ZoomBarMapTool />
        </MapTools>
    </MapToolsSetting>
</MapView>

@code {
    MapView map;
    Collection<Uri> serverUris = new Collection<Uri> { new Uri("http://ows.mundialis.de/services/service") };
    Dictionary<string, string> parameters = new Dictionary<string, string>
{
        { "layers", "OSM-WMS"},
        { "STYLE", "default"},
        { "CRS","4326"}
    };

    private List<StylingModel> stylings;
    private string accessId = Guid.NewGuid().ToString();
    GeoCollection<Layer> Layers = new GeoCollection<Layer>();

    protected override void OnInitialized()
    {
        string baseDirectorybaseDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Data");

        LineStyle lineStyle = LineStyle.CreateSimpleLineStyle(GeoColors.Black, 2, false);

        InMemoryFeatureLayer inMemoryFeatureLayerColdFront = new InMemoryFeatureLayer();
        inMemoryFeatureLayerColdFront.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(lineStyle);
        inMemoryFeatureLayerColdFront.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

        StreamReader s = new StreamReader(baseDirectorybaseDirectory + @"\ColdFront1.txt");

        LineShape lineShape2 = new LineShape(s.ReadLine());
        inMemoryFeatureLayerColdFront.InternalFeatures.Add(new Feature(lineShape2));

        Layers.Add("ColdFront", inMemoryFeatureLayerColdFront);
    }

}

<MapView Id=“map” @ref=“map”
Width=“100”
Height=“100”
MapViewSizeUnitType=“MapViewSizeUnitType.Percentage”
Center="@(new PointShape(20.891170983827966,52.132839559508824))"
Zoom=“15”
MapUnit="@ThinkGeo.Core.GeographyUnit.DecimalDegree">










I have found solution for first problem
Center="@(new PointShape(20.891170983827966,52.132839559508824))"
MapUnit="@ThinkGeo.Core.GeographyUnit.DecimalDegree">

Map point to street.

I have found solution for second problem, i have switched data in file
LINESTRING (52.132839559508824 20.8911709838279696.52.13277891365223 20.891067296445456.52.13271766617681 20.89096031310927)
from x, y to y,x.
Works :slight_smile:

Hi Poul,

It looks your solve the two questions you found, and thanks for your share.

Any question please feel free to let us know.

Regards,

Ethan