Giter VIP home page Giter VIP logo

Comments (12)

HarelM avatar HarelM commented on June 22, 2024 1

I have tried the above package and it seems to solve the issue.
Can you please release/pre-release it to the regular NuGet repository?
This currently prevents me from bumping up the versions for the other NTS packages.

from projnet4geoapi.

FObermaier avatar FObermaier commented on June 22, 2024

Could you try this package:
https://www.myget.org/feed/nettopologysuite/package/nuget/ProjNET4GeoAPI

from projnet4geoapi.

HarelM avatar HarelM commented on June 22, 2024

@FObermaier any chance to publish your package to NuGet as a pre-release?

from projnet4geoapi.

HarelM avatar HarelM commented on June 22, 2024

@airbreather any chance you could help out here? I'm guessing this only needs to be published to NuGet...? This is currently a blocker in terms of upgrading to the officially released NTS version with all of the .net core updates...

from projnet4geoapi.

airbreather avatar airbreather commented on June 22, 2024

Should be done now, here was my test:

ConsoleApp0.csproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="NetTopologySuite.Core" Version="1.15.0" />
    <PackageReference Include="ProjNet4GeoAPI" Version="1.4.0" />
  </ItemGroup>

</Project>

Program.cs

using System;

using GeoAPI.CoordinateSystems;
using GeoAPI.Geometries;

using NetTopologySuite.Geometries;

using ProjNet.Converters.WellKnownText;
using ProjNet.CoordinateSystems.Transformations;

static class Program
{
    static void Main()
    {
        const string WorldMercatorWkt = @"PROJCS[""WGS 84 / World Mercator"",GEOGCS[""WGS 84"",DATUM[""WGS_1984"",SPHEROID[""WGS 84"",6378137,298.257223563,AUTHORITY[""EPSG"",""7030""]],AUTHORITY[""EPSG"",""6326""]],PRIMEM[""Greenwich"",0,AUTHORITY[""EPSG"",""8901""]],UNIT[""degree"",0.0174532925199433,AUTHORITY[""EPSG"",""9122""]],AUTHORITY[""EPSG"",""4326""]],PROJECTION[""Mercator_1SP""],PARAMETER[""central_meridian"",0],PARAMETER[""scale_factor"",1],PARAMETER[""latitude_of_origin"",0],PARAMETER[""false_easting"",0],PARAMETER[""false_northing"",0],UNIT[""metre"",1,AUTHORITY[""EPSG"",""9001""]],AXIS[""Easting"",EAST],AXIS[""Northing"",NORTH],AUTHORITY[""EPSG"",""3395""]]";

        var worldMercator = (IProjectedCoordinateSystem)CoordinateSystemWktReader.Parse(WorldMercatorWkt, System.Text.Encoding.UTF8);
        var wgs84 = worldMercator.GeographicCoordinateSystem;

        var transformFactory = new CoordinateTransformationFactory();
        var wgs84ToWorldMercator = transformFactory.CreateFromCoordinateSystems(sourceCS: wgs84, targetCS: worldMercator).MathTransform;

        var hollywoodSignWgs84 = new Coordinate(-118.3215, 34.1341);
        var hollywoodSignWorldMercator = GeometryFactory.Default.CreatePoint(wgs84ToWorldMercator.Transform(hollywoodSignWgs84));

        var laxWgs84 = new Coordinate(-118.4085, 33.9416);
        var laxWorldMercator = GeometryFactory.Default.CreatePoint(wgs84ToWorldMercator.Transform(laxWgs84));

        Console.WriteLine("Distance from LAX to the Hollywood sign: " + hollywoodSignWorldMercator.Distance(laxWorldMercator) + " meters");
    }
}

Output

Distance from LAX to the Hollywood sign: 27502.1310701851 meters

from projnet4geoapi.

osmvermesser avatar osmvermesser commented on June 22, 2024

hi!

i add to this - because i did not find an other way of help.

i even update to 1.7.5 in vb.net and my old code looks like

Dim csFact As CoordinateSystemFactory = New CoordinateSystemFactory()
Dim ctFact As CoordinateTransformationFactory = New CoordinateTransformationFactory()

    Dim gcs_WGS84 As ProjNet.CoordinateSystems.GeographicCoordinateSystem = ProjNet.CoordinateSystems.GeographicCoordinateSystem.WGS84

    Dim EPSG31468 As ICoordinateSystem = csFact.CreateFromWkt("PROJCS[""DHDN / 3-degree Gauss-Kruger zone 4 (E-N)"",GEOGCS[""DHDN"",DATUM[""Deutsches_Hauptdreiecksnetz"",SPHEROID[""Bessel 1841"",6377397.155,299.1528128,AUTHORITY[""EPSG"",""7004""]],TOWGS84[598.1,73.7,418.2,0.202,0.045,-2.455,6.7],AUTHORITY[""EPSG"",""6314""]],PRIMEM[""Greenwich"",0,AUTHORITY[""EPSG"",""8901""]],UNIT[""degree"",0.0174532925199433,AUTHORITY[""EPSG"",""9122""]],AUTHORITY[""EPSG"",""4314""]],PROJECTION[""Transverse_Mercator""],PARAMETER[""latitude_of_origin"",0],PARAMETER[""central_meridian"",12],PARAMETER[""scale_factor"",1],PARAMETER[""false_easting"",4500000],PARAMETER[""false_northing"",0],UNIT[""metre"",1,AUTHORITY[""EPSG"",""9001""]],AXIS[""Easting"",EAST],AXIS[""Northing"",NORTH],AUTHORITY[""EPSG"",""5678""]]")
    Dim utm32 As IProjectedCoordinateSystem = ProjectedCoordinateSystem.WGS84_UTM(32, True)
    Dim trans As ICoordinateTransformation = ctFact.CreateFromCoordinateSystems(EPSG31468, gcs_WGS84)

NewCoordinate = trans.MathTransform.Transform(OldCoordinate)

is there somebody who could help? the code example of airbreather i am not able to migrate to my project.

regards Jan

from projnet4geoapi.

FObermaier avatar FObermaier commented on June 22, 2024

The information provided is incomplete.

  • what kind of build failure message do you see?
  • can you set up a sample that you can show?

from projnet4geoapi.

osmvermesser avatar osmvermesser commented on June 22, 2024

Hi!

i did not understand every think but here is the message of the vs

2021-04-30_07h41_53

Hallo Felix,
vom Namen her vermute ich, dass Du aus dem deutschsprachigen Raum kommst. Leider verstehe ich Deine Rückfrage nicht so ganz.

Die Fehlermeldung aus VS habe ich oben einmal eingefügt.

Ein Beispiel? Die betreffenden Codezeilen habe ich ja auch schon vor Deiner Rückmeldung schon gepostet. Oder meinst Du etwas anderes?

Regards / Gruß Jan

from projnet4geoapi.

FObermaier avatar FObermaier commented on June 22, 2024

@osmvermesser, while you are right about me living in germany, we don't want to exclude others.

Looking at the documentation for BC31091 reveals that there must be some mismatch. Can you post the packages that you reference in your project, or the content of the project file?

from projnet4geoapi.

osmvermesser avatar osmvermesser commented on June 22, 2024

@FObermaier , I don't want to exclude anyone and if I had understood what it was about I would have continued to write in English!

i attach my vb-file

niv2osmand.txt

the references:

2021-04-30_11h07_30

2021-04-30_11h08_03

I hope this are the required informations.?!??

regards Jan

from projnet4geoapi.

HarelM avatar HarelM commented on June 22, 2024

Seems like your projNET4GeoAPI is not up to date...
Here's my proj file using 2.0:
https://github.com/IsraelHikingMap/Site/blob/6ba6a5e634154f560be00a96d0e69dbc5ecf3f81/IsraelHiking.API/IsraelHiking.API.csproj#L28
And here it was using 1.7.5:
https://github.com/IsraelHikingMap/Site/blob/3713aaee2ea54c391febdce66172a7e032db6684/IsraelHiking.API/IsraelHiking.API.csproj#L28
I hope this helps...

from projnet4geoapi.

FObermaier avatar FObermaier commented on June 22, 2024

ProjNet v1.3.0.4 does not work with GeoAPI v1.7.5, you should use v1.7.3
ProjNet v1.4.1 works with GeoAPI v1.7.5
If you don't have any constraints that require GeoAPI I encourage you to use the ProjNet v2.0 package

from projnet4geoapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.