pgrouting icon indicating copy to clipboard operation
pgrouting copied to clipboard

pgr_alphaShape with alpha <> 0 in v2.1.0

Open ani82 opened this issue 9 years ago • 7 comments

Dear all,

running SELECT * FROM pgr_alphaShape('SELECT id::integer, ST_X(the_geom)::float AS x, ST_Y(the_geom)::float AS y FROM edge_table_vertices_pgr',0.1::float);

with a float > 0 always returns NULL as geometry on my machine. Running it with alpha = 0 or alpha = unset returns a valid polygon.

I run the following configuration:

  • pgrouting 2.1.0 compiled with -- libcgal 4.2.5 and boost 1.54 -- tested as well with self-compiled CGAL 4.7 + boost 1.55
  • POSTGIS 2.2.1
  • Postresql 9.5 on Ubuntu 14.04 with PG sources from Postgresql.org repo

is this a bug in v2.1.0 and should I upgrade?

ani82 avatar Feb 02 '16 17:02 ani82

Interesting error, bug, we need to replicate can you post a link where we can get the exact same data you are using?.

cvvergara avatar Feb 02 '16 22:02 cvvergara

Hi Vicky,

I attach the following shape file. Please rename the extension from TXT to SHP. Looking forward to your opinion. exportRenameToSHP.txt

A

ani82 avatar Feb 03 '16 07:02 ani82

A .shp by itself is not useful. Please zip up the .shp, .shx and .dbf files and send the zip file to us. Or alternatively pg_dump -U postgres -h localhost -t <table> -Fp -Z -f file.sql.gz <dbname> and send us the file.sql.gz

woodbri avatar Feb 03 '16 13:02 woodbri

export.zip here you go...

ani82 avatar Feb 03 '16 13:02 ani82

Sorry for late reply. I will check above at this weekend.

sanak avatar Feb 23 '16 04:02 sanak

Great. Thank you!

ani82 avatar Feb 25 '16 14:02 ani82

@ani82 Sorry for my late confirmation. I confirmed that alpha value 0.1 returns nothing as you mentioned, but large alpha value (like 1000000) returns some coordinates. Your geometry data unit is not "decimal degree", but "meters", so, I think that more larger value was necessary.

About alpha value meaning, please see the following site. http://doc.cgal.org/latest/Alpha_shapes_2/group__PkgAlphaShape2.html Thanks,

sanak avatar Mar 13 '16 01:03 sanak

There is now https://postgis.net/docs/manual-dev/ST_AlphaShape.html

cvvergara avatar Oct 05 '22 01:10 cvvergara