Code Monkey home page Code Monkey logo

Comments (5)

Doctor-Who avatar Doctor-Who commented on May 19, 2024

Just a small update, if you need I fund that enhancement it's not a problem but I can do that only until end of this year :/

from grass.

metzm avatar metzm commented on May 19, 2024

The result of v.out.ogr is correct, the result of v.out.postgis is wrong.

If I understand correctly, the vector to be exported has been imported previously with v.in.ogr. Please provide a sample dataset for testing in shapefile, GeoPackage or similar format.

More detailed explanations:
When a vector with overlapping polygons is imported, the overlapping parts are converted to a topological vector representation: the overlapping parts are represented as separate topological areas and get the categories of all overlapping polygons. These category values are stored in layer 1, if only one OGR layer has been imported. In this case, the number of overlapping polygons is stored as category value in layer 2. Topological areas that represent overlapping parts of input polygons can be identified by selecting areas that have a category in layer 2. In a topological representation, overlaps are areas with more than one category in layer 1. Such overlaps can be resolved by deleting the wrong category value(s) from areas with several category values in layer 1. The user has to decide which category values are wrong.

See also vector categories

from grass.

Doctor-Who avatar Doctor-Who commented on May 19, 2024

Thanks for your explanation. I understand well now but I'm trying to find an automatic full GRASS way.
I will prepare tomorrow a sample dataset.

From now, example data from PostGreSQL :
image
Dark blue area are duplicates. Dark blue area with non white linear but light blue are underneath the bigger polygon.
Everything has unique gid value.

Import PostGIS > GRASS with v.clean - snap, v.clean - break
image
Everything has been cut out, got perfect topology with some duplicated geometries.
Got unique cat value except for exact duplicate object but other v.clean function, such remove duplicate geometries are not working due to what you explain during our training session and here.

From now, I've export with v.out.ogr to PostGIS and use following SQL query ;

DELETE FROM schema.layer AS a
    USING schema.layer AS b
WHERE a.gid > b.gid AND ST_Equals(a.geom, b.geom);

Is there an automatic way in GRASS to do that or should we consider to add a new v.clean function for that (We can see how to fund that) ?

image
Result is fine, no duplicate and topology fit perfect.

from grass.

Doctor-Who avatar Doctor-Who commented on May 19, 2024

Dear @metzm
Please find a GPKG with sample data downloadable here : https://cloud.sirs-fr.com/index.php/s/emcazNaF7XaqagQ
It contains a landcover database after snap, clean process and with exact geometries duplicate
An other layer will help you to locate those cases.

from grass.

Doctor-Who avatar Doctor-Who commented on May 19, 2024

Solve by using v.out.ogr instead and then clean duplicate with PostGIS

from grass.

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.