-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GeoAPI 1.7.5 is incompatible with latest ProjNet4GeoAPI #31
Comments
Could you try this package: |
I have tried the above package and it seems to solve the issue. |
@FObermaier any chance to publish your package to NuGet as a pre-release? |
@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... |
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.csusing 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
|
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()
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 |
The information provided is incomplete.
|
Hi! i did not understand every think but here is the message of the vs Hallo Felix, 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 |
@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? |
@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 the references: I hope this are the required informations.?!?? regards Jan |
Seems like your projNET4GeoAPI is not up to date... |
ProjNet v1.3.0.4 does not work with GeoAPI v1.7.5, you should use v1.7.3 |
See NetTopologySuite/GeoAPI#50
The text was updated successfully, but these errors were encountered: