Coder Social home page Coder Social logo

geo structs about geo HOT 7 OPEN

georust avatar georust commented on June 3, 2024
geo structs

from geo.

Comments (7)

sunng87 avatar sunng87 commented on June 3, 2024

Perhaps we can follow some open standard like OGC Simple Feature Access

To answer some questions above (Just my opinion)

  1. Base types: Point, LineString, Polygon; there are also some other types as defined in SFA 6.1 Geometry Object Model
  2. Hole in polygon is represented as InteriorRing (A LineString). A polygon has only one exterorRing and 0 or multiple interiorRing. So wind order doesn't matter.
  3. Self intersecting polygons are not supported (? you may check the definition in that document to confirm)
  4. We don't need to deal with topology in this lib
  5. (x,y) is required and z, m is optional
  6. GeometryCollection is in this spec
  7. Projections are out of this library's scope, only numeric coordinates are involved

from geo.

calvinmetcalf avatar calvinmetcalf commented on June 3, 2024

not a bad idea, the way point xy is distinct from point xyz fits well with rust fyi ogc has the same types as geojson (Point,LineString,Polygon,MultiPoint,MultiLineString,MultiPolygon,GeometryCollection) plus a few more (MultiCurve, MultiSurface,Curve, Surface, PolyhedralSurface, TIN).

The GeoJSON and some databases like postgres have a somewhat laxer view on self intersections and what not, then tends to be a bit more practical in the real world.

The OGC spec is awful, the page number are romen numerals for gods sack.

Hemisphere spanning polygons are still a problem

from geo.

sunng87 avatar sunng87 commented on June 3, 2024

SFA GOM is based on a classic object-oriented model, but in rust we prefer composition over inheritance, so we don't need to implement types like Curve, Surface...

I think the shared types of SFA and GeoJSON are in highest priority.

Another reference is JTS geom types. JTS is widely used in Java GIS libraries as foundation. You can find its type system is very practical.

from geo.

frewsxcv avatar frewsxcv commented on June 3, 2024

Maybe we should open separate GitHub issues to discuss each of these points individually to facilitate better, more organized discussion.

In terms of XYZM, does the M coordinate value ever get used for geospatial calculations like distance and area? After reading this I would think that it wouldn't.

from geo.

calvinmetcalf avatar calvinmetcalf commented on June 3, 2024

yeah m is rarely used, wkb specifically is pretty down to earth and is something we could translate into rust pretty easily

from geo.

frewsxcv avatar frewsxcv commented on June 3, 2024

Unless I'm looking at this incorrectly, it looks like JTS's distance operation only works on XY even though they offer XYZ (and M).

from geo.

sunng87 avatar sunng87 commented on June 3, 2024

True, seems the whole library doesn't use z for distance: https://github.com/simplegeo/jts/blob/master/src/com/vividsolutions/jts/algorithm/CGAlgorithms.java

from geo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.