#477 closed enhancement (wontfix)
Add GEOSCoordSeq_set function that takes a list of coordinates
Reported by: | olt | Owned by: | hobu |
---|---|---|---|
Priority: | minor | Milestone: | 3.5.0 |
Component: | C API | Version: | main |
Severity: | Unassigned | Keywords: | |
Cc: | strk |
Description (last modified by )
Creating a GEOSCoordSequence requires calls to GEOSCoordSeq_setX and GEOSCoordSeq_setY for each point. There should be a GEOSCoordSeq_set function that takes a list of points.
Something like:
GEOSCoordSeq_set(const GEOSCoordSequence* s, double *val, unsigned int n)
Attachments (2)
Change History (15)
comment:1 by , 13 years ago
Cc: | added |
---|---|
Description: | modified (diff) |
comment:2 by , 13 years ago
comment:3 by , 13 years ago
Description: | modified (diff) |
---|
Attached is a patch that starts the attempt. I am unable to compile it because of the Lion ar/llvm bug https://svn.macports.org/ticket/30309
by , 13 years ago
Attachment: | 447-patch.patch added |
---|
comment:4 by , 13 years ago
Milestone: | 3.3.1 → 3.4.0 |
---|---|
Version: | 3.3.0 → svn-trunk |
by , 13 years ago
comment:6 by , 13 years ago
Updated the patch. Added two tests and changed the signature to match GEOSCoordSeq_create. dim, n -> n, dim
comment:7 by , 13 years ago
What happens if you specify a number of ordinate values which is bigger than the number of coordinates the sequence was created with ? What if it's smaller ? What's the use case to allow that ? Should this whole thing be a constructor instead (GEOSCoordSeq_createWithValues) ?
comment:8 by , 13 years ago
Sandro,
You're right, this should probably be changed to a constructor that takes in an array, dimension count, and point count.
We'll update the patch and provide it.
Howard
comment:10 by , 10 years ago
@hobu, was this change found to not be worth the trouble ? Or did you just not have time ?
comment:11 by , 10 years ago
Seemed like sugar and not that interesting.
We were able to work around the function call overhead in a different way for Shapely, so our need for it went away.
comment:12 by , 10 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I confirm it's not that interesting, just tried quickly with a GEOSCoordSeq_createXYZ taking 3 arrays of doubles and using it from postgis. The result is slower than the current version !
So, closing
comment:13 by , 10 years ago
For the record (if anyone wants to clone before it disappears): https://github.com/strk/libgeos/tree/svn-trunk-GEOSCoordSeq_createXYZ
I don't understand that signature. Is it an array of pointers to doubles ? Does it save 1 call for point or is it meant to do 1 call per dimension for any sized CoordinateSequence ?