Skip to content

Conversation

@jumpinjackie
Copy link
Contributor

This pull request enhances the IGeoJsonGeometry interface to have more utility than being just a marker interface for JSON serialization:

  • Add readonly TypeName property exposing the TypeName property that all Geometry classes have, allowing for easy type identification without trial-and-error casting or CLR type checks.
  • Add a Transform method that allows an IGeoJsonGeometry to be transformed (re-projected) through a user-supplied transformation function.
  • Add readonly BoundingBox property exposing the BoundingBox property that all Geometry classes have.

Also included is some fixes:

  • JsonIgnore the Point property of Point class
  • GeometryCollection.FromDbGeometry() throws NotImplementedException if it contains component LineString or MultiLineString instances
  • For any FromDbGeometry() method that throws NotImplementedException (because of unknown/unsupported geometry type), indicate this type in the exception message.

Also included is unit tests covering the transformation functionality and verifying the DbGeometry -> GeometryCollection conversion supports all valid component geometry types

Update tests to also verify TypeName.
…le coordinate transformation function. This change does not impose or demand the use of a particular re-projection library, that part is left to the consumer of this library to fill in.
Also document the (frankly) bizarre formatting convention of this bounding box array. It's not [minX, minY, maxX, maxY] as one might expect, it's [minY, minX, maxY, maxX]
 - Constant-ify all usages of geometry type string literals with the GeometryType class
 - Add message for NotImplementedExceptions thrown for unknown/unsupported geometry types
 - Fix GeometryCollection failing to be created from DbGeometry if it has component LineStrings or MultiLineStrings
 - Fix missing casts on transformation of any multi- geometry type
 - Add unit test for DbGeometry -> GeometryCollection round tripping
 - Add unit tests for geometry transformation using a simple displacement transform function

All WKT strings used in these tests sourced from the Wikipedia article about WKT: https://en.wikipedia.org/wiki/Well-known_text
@alatas alatas added this to the 2.2.0 milestone Jan 11, 2017
@alatas alatas self-requested a review January 11, 2017 18:57
@alatas alatas changed the base branch from master to 2.2.0 January 11, 2017 19:02
@alatas alatas merged commit f981f03 into alatas:2.2.0 Jan 11, 2017
alatas added a commit that referenced this pull request Jan 12, 2017
additions to @jumpinjackie's changes #11
-removed unnecessary imports, files, "Me" and other keywords
-removed base interface implementatation and converted all generic base classes to non-generic
-combined transform functions together and formatted
-added serialize function with jsonoutput settings
-base geom/geog factory functions converted to non-generic and shorthened with reflection
-added props to transformexception
-converted to vs2015
-changed unit tests according to lib changes
@alatas alatas mentioned this pull request Jan 17, 2017
@alatas alatas removed the inreview label Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants