Closed evetion closed 2 years ago
This line is what limits createlinestring
to Float64
:
https://github.com/yeesian/ArchGDAL.jl/blob/e401e0079d97dac9d4755a4bc9dce345a9c5bf81/src/ogr/geometry.jl#L1519
(is this a real limitation of GDAL or something we have imposed unnecessarily?)
While point uses Real
:
https://github.com/yeesian/ArchGDAL.jl/blob/e401e0079d97dac9d4755a4bc9dce345a9c5bf81/src/ogr/geometry.jl#L1580
This code is all pretty hard to understand though: https://github.com/yeesian/ArchGDAL.jl/blob/e401e0079d97dac9d4755a4bc9dce345a9c5bf81/src/ogr/geometry.jl#L1484-L1675
Another thing that would be good to break out into named lists that we then loop over, so the code is a little more self-documenting.
Maybe this is an unnessesary limitation, swapping to <:Real
seems to work fine.
Seeing its defined in multiple places, something like this could help:
const _VECTYPES = Vector{<:Tuple{<:Real,<:Real}}}},
Vector{<:Tuple{<:Real,<:Real,<:Real}}}},
Vector{<:Vector{<:Real}}}}
I don't think it's due to any fundamental GDAL reason, and is probably me not being sufficiently clever to think about how to write it to cover all cases.
I'll PR when I have time, its an easy fix.
Encountered in #290, with creation of geometry from
GeoInterface.coordinates(geom)
, which are nestedVector
s of<:Real
.While you can create points with Integers:
You cannot do so with more complex geometries, even with LineString:
Not even with other Float types: