Skip to content

Commit

Permalink
Add Known limitations section to README (#23)
Browse files Browse the repository at this point in the history
* Add Known limitations section to README

* Validity
* Fullglobe
* Measures

* Fix typo

* Fix gh version suffix in Directory.Build.props
  • Loading branch information
FObermaier authored Feb 8, 2022
1 parent 5f51421 commit bc17118
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 8 deletions.
24 changes: 17 additions & 7 deletions NetTopologySuite.IO.SqlServerBytes.sln
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 15.0.26124.0
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetTopologySuite.IO.SqlServerBytes", "src\NetTopologySuite.IO.SqlServerBytes\NetTopologySuite.IO.SqlServerBytes.csproj", "{0402AAFA-DC37-4844-97E2-6205C5BE8882}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetTopologySuite.IO.SqlServerBytes", "src\NetTopologySuite.IO.SqlServerBytes\NetTopologySuite.IO.SqlServerBytes.csproj", "{0402AAFA-DC37-4844-97E2-6205C5BE8882}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetTopologySuite.IO.SqlServerBytes.Test", "test\NetTopologySuite.IO.SqlServerBytes.Test\NetTopologySuite.IO.SqlServerBytes.Test.csproj", "{D793B2F0-9612-4511-8932-D0D2028691AA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetTopologySuite.IO.SqlServerBytes.Test", "test\NetTopologySuite.IO.SqlServerBytes.Test\NetTopologySuite.IO.SqlServerBytes.Test.csproj", "{D793B2F0-9612-4511-8932-D0D2028691AA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Items", "Items", "{6A5A94FB-AA3A-4EE4-ADBC-F9DF7D9829E5}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0402AAFA-DC37-4844-97E2-6205C5BE8882}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0402AAFA-DC37-4844-97E2-6205C5BE8882}.Debug|Any CPU.Build.0 = Debug|Any CPU
Expand All @@ -25,4 +29,10 @@ Global
{D793B2F0-9612-4511-8932-D0D2028691AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D793B2F0-9612-4511-8932-D0D2028691AA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {00C34697-7D1D-4794-B3A0-7DE54D6654C5}
EndGlobalSection
EndGlobal
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,28 @@ var parameter = command.Parameters
//parameter.SqlDbType = SqlDbType.Udt;
//parameter.UdtTypeName = "geography";
```

## Known limitations
### Validity
SqlServer and NetTopologySuite have a slightly different notion of a geometry's validity. SqlServer stores this
information along with the geometry data and the `SqlServerBytesWriter` uses NetTopologySuite's `Geometry.IsValid` value.
You might get SqlServer geometries that return `STIsValid() = true` but `STIsValidReason() = false`.

### Fullglobe
SqlServer geography types include `FULLGLOBE`, basically a polygon where the globe is the outer ring (shell)
and the interior rings (holes) define areas that are excluded. To achive this, SqlServer is rigid about
ring orientations for geographies.
Kind | requested Orientation
--- | ---
outer rings | **counter clockwise**
inner rings | **clockwise**

**This is _currently_ not representable using NetTopologySuite geometries** and the `SqlServerBytesWriter`
throws an `ArgumentException` if writing a geometry is requested that has an exterior ring oriented **clockwise**.

#### Measures
SqlServer geography types use the metric system for measures like length, distance and area.
For NetTopologySuite geometries everything is planar and thus all return values are in the unit of the input
coordinates. In case the coordinates are geographic these values are mostly useless.
Furthermore you can easily create buffers of geometries that exceed the extent of a hemisphere. SqlServer rejects these.

2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<PropertyGroup Condition=" '$(GITHUB_ACTIONS)' == 'True' ">
<Deterministic>true</Deterministic>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<NtsBuildMetadata Condition=" '$(NtsBuildMetadata)' == '' ">ci.github.$(GITHUB_ACTION)</NtsBuildMetadata>
<NtsBuildMetadata Condition=" '$(NtsBuildMetadata)' == '' ">ci.github.$(GITHUB_RUN_ID)</NtsBuildMetadata>

<NtsOfficialRelease Condition=" '$(GITHUB_REF)' == 'refs/heads/master' And '$(GITHUB_EVENT_NAME)' == 'push' ">true</NtsOfficialRelease>
</PropertyGroup>
Expand Down

0 comments on commit bc17118

Please sign in to comment.