mirror of
https://github.com/bvanroll/cs-map-project.git
synced 2025-08-29 20:02:43 +00:00
fam, dit is zo onplezant
This commit is contained in:
64
Globals/Globals.csproj
Normal file
64
Globals/Globals.csproj
Normal file
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{993C82FA-6F2D-4F9C-9712-0301E70CEAB6}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Globals</RootNamespace>
|
||||
<AssemblyName>Globals</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="GeoJSON.Net, Version=1.2.16.0, Culture=neutral, PublicKeyToken=42c00ea87f5f14d4">
|
||||
<HintPath>..\packages\GeoJSON.Net.1.2.20-rc\lib\net45\GeoJSON.Net.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
|
||||
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MultiPolygonPunten.cs" />
|
||||
<Compile Include="PolygonPunten.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Punt.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
39
Globals/MultiPolygonPunten.cs
Normal file
39
Globals/MultiPolygonPunten.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GeoJSON.Net.Geometry;
|
||||
|
||||
namespace Globals
|
||||
{
|
||||
public class MultiPolygonPunten
|
||||
{
|
||||
public double MaximumX, MinimumX, MaximumY, MinimumY;
|
||||
public List<PolygonPunten> PolygonPunten;
|
||||
public string Naam;
|
||||
|
||||
public MultiPolygonPunten(List<PolygonPunten> polygonPunten, string naam = "")
|
||||
{
|
||||
PolygonPunten = polygonPunten;
|
||||
Naam = naam;
|
||||
VindMaximumEnMinimum(polygonPunten);
|
||||
}
|
||||
|
||||
public MultiPolygonPunten(MultiPolygon multiPolygon, string naam = "")
|
||||
{
|
||||
Naam = naam;
|
||||
PolygonPunten = new List<PolygonPunten>();
|
||||
foreach (Polygon polygon in multiPolygon.Coordinates)
|
||||
{
|
||||
PolygonPunten.Add(new PolygonPunten(polygon, naam));
|
||||
}
|
||||
VindMaximumEnMinimum(PolygonPunten);
|
||||
}
|
||||
|
||||
private void VindMaximumEnMinimum(List<PolygonPunten> polygonPunten)
|
||||
{
|
||||
MaximumX = polygonPunten.Max(p => p.MaximumX);
|
||||
MaximumY = polygonPunten.Max(p => p.MaximumY);
|
||||
MinimumX = polygonPunten.Max(p => p.MinimumX);
|
||||
MinimumY = polygonPunten.Max(p => p.MinimumY);
|
||||
}
|
||||
}
|
||||
}
|
50
Globals/PolygonPunten.cs
Normal file
50
Globals/PolygonPunten.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Shapes;
|
||||
using GeoJSON.Net.Geometry;
|
||||
using Polygon = GeoJSON.Net.Geometry.Polygon;
|
||||
|
||||
namespace Globals
|
||||
{
|
||||
public class PolygonPunten
|
||||
{
|
||||
public double MaximumX, MinimumX, MaximumY, MinimumY;
|
||||
public List<Punt> Punten;
|
||||
public string Naam;
|
||||
|
||||
public PolygonPunten(List<Punt> punten, string naam = "")
|
||||
{
|
||||
Punten = punten;
|
||||
Naam = naam;
|
||||
MaximumX = punten.Max(punt => punt.X);
|
||||
MaximumY = punten.Max(punt => punt.Y);
|
||||
MinimumX = punten.Min(punt => punt.X);
|
||||
MinimumY = punten.Min(punt => punt.Y);
|
||||
}
|
||||
|
||||
public PolygonPunten(Polygon p, string naam = "")
|
||||
{
|
||||
Naam = naam;
|
||||
Punten = new List<Punt>();
|
||||
MaximumX = double.MinValue;
|
||||
MaximumY = double.MinValue;
|
||||
MinimumX = double.MaxValue;
|
||||
MinimumY = double.MaxValue;
|
||||
foreach (LineString l in p.Coordinates)
|
||||
{
|
||||
foreach (Position pos in l.Coordinates)
|
||||
{
|
||||
if (pos.Longitude > MaximumX) MaximumX = pos.Longitude;
|
||||
if (pos.Longitude < MinimumX) MinimumX = pos.Longitude;
|
||||
if (pos.Latitude > MaximumY) MaximumY = pos.Latitude;
|
||||
if (pos.Latitude < MinimumY) MinimumY = pos.Latitude;
|
||||
Punten.Add(new Punt(pos.Longitude, pos.Latitude, naam));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
36
Globals/Properties/AssemblyInfo.cs
Normal file
36
Globals/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Globals")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Globals")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("993c82fa-6f2d-4f9c-9712-0301e70ceab6")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
33
Globals/Punt.cs
Normal file
33
Globals/Punt.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace Globals
|
||||
{
|
||||
public class Punt
|
||||
{
|
||||
public double X, Y;
|
||||
public string Naam;
|
||||
public Punt(double x, double y, string naam = "")
|
||||
{
|
||||
Naam = naam;
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (string.Equals(Naam, "", StringComparison.Ordinal)) return "UNKNOWN";
|
||||
else return Naam;
|
||||
}
|
||||
|
||||
public Point GetPoint()
|
||||
{
|
||||
return new Point(X, Y);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
|
BIN
Globals/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Normal file
BIN
Globals/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Normal file
Binary file not shown.
BIN
Globals/obj/Debug/Globals.csprojAssemblyReference.cache
Normal file
BIN
Globals/obj/Debug/Globals.csprojAssemblyReference.cache
Normal file
Binary file not shown.
5
Globals/packages.config
Normal file
5
Globals/packages.config
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="GeoJSON.Net" version="1.2.20-rc" targetFramework="net472" />
|
||||
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net472" />
|
||||
</packages>
|
Reference in New Issue
Block a user