Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Suggestion: make two sets of interfaces - data and methods #8

Closed
jcdekoning opened this issue May 29, 2015 · 3 comments
Closed

Suggestion: make two sets of interfaces - data and methods #8

jcdekoning opened this issue May 29, 2015 · 3 comments

Comments

@jcdekoning
Copy link

Hello,

I have a file with data as geojson. I want to load this in and do some operations on the data (for example checking if a point is inside a polygon) with the use of NTS. For reading in the geojson data I wanted to use GeoJSON. Unfortunally it is not easy to convert (cast) the geometries from that library to the ones NTS is using.

Then I found this GeoApi project with its goal to make geo libraries more compatible with each other. The GeoJSON project is not using this library. I therefore forked it to find out if it is easy to add the different interfaces to the geometry classes in the GeoJSON project. Unfortunately by using the IPoint interface from GeoAPI I also need to implement all kind of geometric operations. Something which is already implemented in NTS.

Should the interfaces not be split up in pure data container interfaces and interfaces describing the available methods for a geometry. This way I can easily cast a geometry created by the GeoJSON library over to NTS.

Would love to hear your feedback.

Johan

@pauldendulk
Copy link
Member

Perhaps specific interfaces could be created for the parts that only hold data. The existing interfaces should then be split into a data part and a method part which is derived from the data part.

@FObermaier
Copy link
Member

Why not use NetTopologySuite.IO.GeoJSON package.
It was derived from @jbatterman s GeoJSON-Net code a while back. It might not be fully in line with the current package, but you get NTS/GeoAPI geometries for free :)

The original GeoAPI package was derived from the GeoAPI java (some ancient 0.x version) package that has undergone some sort of standardization. That was a long time before I joined the project so I cannot really say anything about it.

The only implementation of the GeoAPI interface set (.NET) that I know of is NetTopologySuite.
For your project I would suggest you go with a set of extension methods to cast GeoJSON-Net geometries to GeoAPI geometries.

@DGuidi
Copy link
Contributor

DGuidi commented May 29, 2015

The original GeoAPI package was derived from the GeoAPI java

Actually, we (I) started with this goal, but then I switched to a simple(r) "abstraction" over NTS/JTS Geometry model.
Anyway, as @FObermaier said, it's straightforward to create some extension methids to converto from/to GeoJSON-Net objects.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants