GithubHelp home page GithubHelp logo

Comments (5)

jtmiclat avatar jtmiclat commented on June 16, 2024 1

recognized source of error since overlay was first invented in the 1970s.
nice.

I think i was intending for sliver but got the words jumbled up. I think we can catch the area being 0 as a default and if the user has more of a threshold they can build their own validator

from geowrangler.validation import BaseValidator

class AreaValidator(BaseValidator):
    validator_column_name = "area_is_not_almost_zero"
    fix_available = False  # Telling the validator that there is no available fixes
    warning_message = "Found geometries with area almost zero"  # warning message
    geometry_types = ["Polygon", "MultiPolygon"]  # What kind of geometies to validate and fix

    def check(self, geometry):
        # Checks if the geometry is valid. If False, warn the user
        return geometry.area > 0.0000001 # or whatever threshold they have 

validated_gdf = AreaValidator().validate(gdf)

from geowrangler.

jtmiclat avatar jtmiclat commented on June 16, 2024

We actually have a broken polygon for slither in data/broker.geojson

    {
      "type": "Feature",
      "properties": {
        "id": "slither"
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              0.0,
              0.0
            ],
            [
              0.0,
              1.0
            ],
            [
              0.0,
              0.0
            ]
          ]
        ]
      }
    },

A way to detect this is by getting the polygon area.

Btw the polygon has an area. Is this correct?

In [36]: wkt.loads("POLYGON ((122.95320551089915 11.473736609261481, 122.952381 11.4737421, 122.95320551089915 11.47373660926148, 122.95320551089915 11.473736609261481))").area
Out[36]: 7.323127874328026e-19

from geowrangler.

joshuacortez avatar joshuacortez commented on June 16, 2024

Oh I computed the area on the projected polygon. Maybe it's a precision thing. The sample broken polygon you mentioned seems good!

from geowrangler.

joshuacortez avatar joshuacortez commented on June 16, 2024

I just noticed, it it supposed to be slither or sliver? Just learned that sliver is the term for the polygon I made in my example (got it from overlaying two geometries). I wonder if it makes sense to have a minimum threshold for slivers

from geowrangler.

joshuacortez avatar joshuacortez commented on June 16, 2024

Yep agree!

from geowrangler.

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.