cartodb: Invalid geometries after export/import
Context
The dataset with all geometries as valid generates, a different number of, invalid geometries when importing it depending on the export format.
Steps to Reproduce
- CSV.
- SHP.
- GeoPackage.
- Import all of them.
- Run the queries:
SELECT count(*) FROM chicago_census_tracts_csv where st_isvalidreason(the_geom) != 'Valid Geometry'
SELECT count(*) FROM chicago_census_tracts_shp where st_isvalidreason(the_geom) != 'Valid Geometry'
SELECT count(*) FROM chicago_census_tracts_gpkg where st_isvalidreason(the_geom) != 'Valid Geometry'
Current Result
Tables count for invalid geometries:
- chicago_census_tracts_csv: 0
- chicago_census_tracts_shp: 3
- chicago_census_tracts_gpkg: 36
Expected result
I would expect to have all geometries as valid, independently of the export format.
Additional info
Using QGIS Geometry Checker Plugin I wasn’t able to detect invalid geometries from step 2 files. However, I was able to detect invalid geometries after exporting again the imported gpkg dataset at step 3.
cc @javisantana
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 53 (51 by maintainers)
Commits related to this issue
- OGR_CT: increase the tolerance used to consider identical source and target units (github #185, follow up of github #184) To determine if input and output units of longitude/latitude are the same (so... — committed to aashish24/gdal-svn by deleted user 7 years ago
- OGR_CT: increase the tolerance used to consider identical source and target units (github #185, follow up of github #184) To determine if input and output units of longitude/latitude are the same (so... — committed to OSGeo/gdal by rouault 7 years ago
- OGR_CT: increase the tolerance used to consider identical source and target units (github #185, follow up of github #184) To determine if input and output units of longitude/latitude are the same (so... — committed to OSGeo/gdal by rouault 7 years ago
I ran the following regression tests as well:
.carto
file: OK2.1.2+svn.37167-precise1
: OKReady for production.
For the record, here’s a snippet showing how I got to debug our test case:
First, compile GDAL with debug symbols and open the resulting
ogr2ogr
withgdb
:Now we can set breakpoints as needed and execute the conversion of our test case: