Skip to content

Commit 1105a3c

Browse files
committed
Update GeoAPI reference to 1.7.4
Remove BitConverter replacement on LineSegments, DoubleBits and CommonBits Remove StringEx Code documentation NTS.IO.Streams
1 parent 472e618 commit 1105a3c

File tree

49 files changed

+346
-267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+346
-267
lines changed
+11-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup>
4-
<fwVersion Condition=" '$(fwVersion)' == '' ">portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10</fwVersion>
5-
</PropertyGroup>
6-
<ItemGroup>
7-
<Reference Include="GeoAPI">
8-
<HintPath>$(SolutionDir)packages\GeoAPI.1.7.4-pre3\lib\$(fwVersion)\GeoAPI.dll</HintPath>
9-
</Reference>
10-
</ItemGroup>
11-
</Project>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<fwVersion Condition=" '$(fwVersion)' == '' ">portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10</fwVersion>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<Reference Include="GeoAPI">
8+
<HintPath>$(SolutionDir)packages\GeoAPI.1.7.4\lib\$(fwVersion)\GeoAPI.dll</HintPath>
9+
</Reference>
10+
</ItemGroup>
11+
</Project>

BuildTools/GeoAPI.Reference.targets

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup>
4-
<fwVersion Condition=" '$(fwVersion)' == '' ">net40-client</fwVersion>
5-
</PropertyGroup>
6-
<ItemGroup>
7-
<Reference Include="GeoAPI">
8-
<HintPath>$(SolutionDir)packages\GeoAPI.1.7.4-pre3\lib\$(fwVersion)\GeoAPI.dll</HintPath>
9-
</Reference>
10-
</ItemGroup>
11-
</Project>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<fwVersion Condition=" '$(fwVersion)' == '' ">net40-Client</fwVersion>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<Reference Include="GeoAPI">
8+
<HintPath>$(SolutionDir)packages\GeoAPI.1.7.4\lib\$(fwVersion)\GeoAPI.dll</HintPath>
9+
</Reference>
10+
</ItemGroup>
11+
</Project>

BuildTools/GeoAPI.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.7.4-pre3
1+
1.7.4

NTS.Converter.DotSpatial.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</description>
1515
<summary>NTS Topology Suite is a direct-port of all the functionalities offered by JTS Topology Suite</summary>
1616
<tags>NTS DotSpatial Topology</tags>
17-
<copyright>Copyright 2013</copyright>
17+
<copyright>Copyright 2013-2015</copyright>
1818
<language>en-US</language>
1919
<dependencies>
2020
<dependency id="NetTopologySuite" version="$version$" />

NTS.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</description>
1616
<summary>NTS Topology Suite is a direct-port of all the functionalities offered by JTS Topology Suite</summary>
1717
<tags>NTS Topology OGC SFS</tags>
18-
<copyright>Copyright 2007-2013</copyright>
18+
<copyright>Copyright 2007-2015</copyright>
1919
<language>en-US</language>
2020
<frameworkAssemblies>
2121
<frameworkAssembly assemblyName="System" targetFramework="" />

NetTopologySuite.Converter/NetTopologySuite.Converter.DotSpatial/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
<package id="DotSpatial.Projections" version="1.7" targetFramework="net40-Client" />
66
<package id="DotSpatial.Serialization" version="1.7" targetFramework="net40-Client" />
77
<package id="DotSpatial.Topology" version="1.7" targetFramework="net40-Client" />
8-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40-Client" />
8+
<package id="GeoAPI" version="1.7.4" targetFramework="net40-Client" />
99
</packages>

NetTopologySuite.Converter/NetTopologySuite.Converter.Test/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
<package id="DotSpatial.Projections" version="1.7" targetFramework="net40-Client" />
66
<package id="DotSpatial.Serialization" version="1.7" targetFramework="net40-Client" />
77
<package id="DotSpatial.Topology" version="1.7" targetFramework="net40-Client" />
8-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40-Client" />
8+
<package id="GeoAPI" version="1.7.4" targetFramework="net40-Client" />
99
<package id="NUnit" version="2.6.4" targetFramework="net40-Client" />
1010
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="DotSpatial.Projections" version="1.7" targetFramework="net40-Client" />
4-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40-Client" />
4+
<package id="GeoAPI" version="1.7.4" targetFramework="net40-Client" />
55
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40-Client" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="GeoAPI" version="1.7.4" targetFramework="net40-Client" />
44
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="portable-net403+sl50+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10" />
3+
<package id="GeoAPI" version="1.7.4" targetFramework="portable-net403+sl50+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10" />
44
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="portable-net403+sl50+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10" />
55
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40-Client" />
3+
<package id="GeoAPI" version="1.7.4" targetFramework="net40-Client" />
44
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net40-Client" />
55
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40-Client" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="GeoAPI" version="1.7.4" targetFramework="net40-Client" />
44
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40-Client" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="GeoAPI" version="1.7.4" targetFramework="net40-Client" />
44
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40-Client" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="GeoAPI" version="1.7.4" targetFramework="net40-Client" />
44
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40-Client" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="GeoAPI" version="1.7.4" targetFramework="net40-Client" />
44
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="GeoAPI" version="1.7.4" targetFramework="net40" />
44
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40-Client" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="GeoAPI" version="1.7.4" targetFramework="net40-Client" />
44
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="portable-net403+sl50+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="GeoAPI" version="1.7.4" targetFramework="portable-net403+sl50+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10" />
44
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40-Client" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="GeoAPI" version="1.7.4" targetFramework="net40-Client" />
44
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40-Client" />
3+
<package id="GeoAPI" version="1.7.4" targetFramework="net40-Client" />
44
<package id="Microsoft.SqlServer.Types" version="10.50.1600.1" />
55
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net4-client" />
4-
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net4-client" />
5-
<package id="Microsoft.Data.Edm" version="5.6.4" targetFramework="net4-client" />
6-
<package id="Microsoft.Data.OData" version="5.6.4" targetFramework="net4-client" />
7-
<package id="Microsoft.Data.Services.Client" version="5.6.4" targetFramework="net4-client" />
8-
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net4-client" />
9-
<package id="NUnit" version="2.6.4" targetFramework="net4-client" />
10-
<package id="System.Spatial" version="5.6.4" targetFramework="net4-client" />
11-
<package id="WindowsAzure.Storage" version="5.0.2" targetFramework="net4-client" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="GeoAPI" version="1.7.4" targetFramework="net4-client" />
4+
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net4-client" />
5+
<package id="Microsoft.Data.Edm" version="5.6.4" targetFramework="net4-client" />
6+
<package id="Microsoft.Data.OData" version="5.6.4" targetFramework="net4-client" />
7+
<package id="Microsoft.Data.Services.Client" version="5.6.4" targetFramework="net4-client" />
8+
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net4-client" />
9+
<package id="NUnit" version="2.6.4" targetFramework="net4-client" />
10+
<package id="System.Spatial" version="5.6.4" targetFramework="net4-client" />
11+
<package id="WindowsAzure.Storage" version="5.0.2" targetFramework="net4-client" />
1212
</packages>

NetTopologySuite.IO/NetTopologySuite.IO.Streams.CloudStorage/CloudStreamProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public CloudStreamProvider(CloudBlobContainer container, string kind, string pa
1212
if(path == null)
1313
throw new ArgumentNullException("path");
1414

15-
if (StringEx.IsNullOrWhitespaceNTS(path))
15+
if (String.IsNullOrWhiteSpace(path))
1616
throw new ArgumentException("path");
1717

1818
if (container == null)

NetTopologySuite.IO/NetTopologySuite.IO.Tests/ShapeFile.Extended/HelperMethods.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using GeoAPI.Geometries;
33
using NetTopologySuite.IO.Handlers;
4-
using NetTopologySuite.Utilities;
54
using Assert = NUnit.Framework.Assert;
65

76
namespace NetTopologySuite.IO.Tests.ShapeFile.Extended
@@ -52,7 +51,7 @@ public static void AssertDoubleValuesEqual(double num1, double num2)
5251

5352
public static void AssertDoubleValuesEqual(double num1, double num2, double requiredPrecision, string errorMessage = "")
5453
{
55-
if (StringEx.IsNullOrWhitespaceNTS(errorMessage))
54+
if (String.IsNullOrWhiteSpace(errorMessage))
5655
{
5756
Assert.AreEqual(num1, num2, requiredPrecision);
5857
}

NetTopologySuite.IO/NetTopologySuite.IO.Tests/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40-Client" />
3+
<package id="GeoAPI" version="1.7.4" targetFramework="net40-Client" />
44
<package id="Microsoft.SqlServer.Types" version="10.50.1600.1" />
55
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net40-Client" />
66
<package id="Npgsql" version="2.0.12.1" targetFramework="net40-Client" />
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="GeoAPI" version="1.7.4-pre3" targetFramework="net40-Client" />
3+
<package id="GeoAPI" version="1.7.4" targetFramework="net40-Client" />
44
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net40-Client" />
55
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,77 @@
1-
using System;
2-
using System.IO;
3-
using NetTopologySuite.Utilities;
4-
5-
namespace NetTopologySuite.IO.Streams
6-
{
7-
public class FileStreamProvider : IStreamProvider
8-
{
9-
public FileStreamProvider(string kind, string path, bool validatePath = false)
10-
{
11-
if (path == null)
12-
throw new ArgumentNullException("path");
13-
14-
if (StringEx.IsNullOrWhitespaceNTS(path))
15-
throw new ArgumentException("Invalid Path", "path");
16-
17-
if (validatePath && !File.Exists(path))
18-
throw new FileNotFoundException(path);
19-
20-
Kind = kind;
21-
Path = path;
22-
}
23-
24-
public string Path { get; private set; }
25-
26-
public bool UnderlyingStreamIsReadonly
27-
{
28-
get { return false; }
29-
}
30-
31-
public Stream OpenRead()
32-
{
33-
return File.Open(Path, FileMode.Open, FileAccess.Read, FileShare.Read);
34-
}
35-
36-
public Stream OpenWrite(bool truncate)
37-
{
38-
if (truncate)
39-
{
40-
return File.Open(Path, FileMode.Create, FileAccess.Write, FileShare.None);
41-
}
42-
return File.Open(Path, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite); //jd: I would like to use FileShare.None however the GeoTools shapefilewriter writes a dummy file while holding an existing handle
43-
}
44-
45-
public string Kind { get; private set; }
46-
}
1+
using System;
2+
using System.IO;
3+
4+
namespace NetTopologySuite.IO.Streams
5+
{
6+
/// <summary>
7+
/// An implementation of <see cref="IStreamProvider"/> that gives acces to file streams
8+
/// </summary>
9+
public class FileStreamProvider : IStreamProvider
10+
{
11+
/// <summary>
12+
/// Creates an instance of this class
13+
/// </summary>
14+
/// <param name="kind">The kind of stream</param>
15+
/// <param name="path">The path to the stream</param>
16+
/// <param name="validatePath">A value indicating if the provided path is to be validated</param>
17+
public FileStreamProvider(string kind, string path, bool validatePath = false)
18+
{
19+
if (path == null)
20+
throw new ArgumentNullException("path");
21+
22+
#if NET40
23+
if (string.IsNullOrWhiteSpace(path))
24+
#else
25+
if (string.IsNullOrEmpty(path))
26+
#endif
27+
throw new ArgumentException("Invalid Path", "path");
28+
29+
if (validatePath && !File.Exists(path))
30+
throw new FileNotFoundException(path);
31+
32+
Kind = kind;
33+
Path = path;
34+
}
35+
36+
/// <summary>
37+
/// Gets a value indicating the path to the file
38+
/// </summary>
39+
public string Path { get; private set; }
40+
41+
/// <summary>
42+
/// Gets a value indicating that the underlying stream is read-only
43+
/// </summary>
44+
public bool UnderlyingStreamIsReadonly
45+
{
46+
get { return false; }
47+
}
48+
49+
/// <summary>
50+
/// Function to open the underlying stream for reading purposes
51+
/// </summary>
52+
/// <returns>An opened stream</returns>
53+
public Stream OpenRead()
54+
{
55+
return File.Open(Path, FileMode.Open, FileAccess.Read, FileShare.Read);
56+
}
57+
58+
/// <summary>
59+
/// Function to open the underlying stream for writing purposes
60+
/// </summary>
61+
/// <remarks>If <see cref="IStreamProvider.UnderlyingStreamIsReadonly"/> is not <value>true</value> this method shall fail</remarks>
62+
/// <returns>An opened stream</returns>
63+
public Stream OpenWrite(bool truncate)
64+
{
65+
if (truncate)
66+
{
67+
return File.Open(Path, FileMode.Create, FileAccess.Write, FileShare.None);
68+
}
69+
return File.Open(Path, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite); //jd: I would like to use FileShare.None however the GeoTools shapefilewriter writes a dummy file while holding an existing handle
70+
}
71+
72+
/// <summary>
73+
/// Gets a value indicating the kind of stream
74+
/// </summary>
75+
public string Kind { get; private set; }
76+
}
4777
}

0 commit comments

Comments
 (0)