Open alex-s-gardner opened 3 weeks ago
Nice. Then rasters can extend that method too.
It should work on any geometry but return a GI geometry.
I have it as crs!
in GeoArrays, which is more Julian? But yeah, would be good to have as a common definition (like read/write). Not sure about it always wrapping if the object doesn't implement it.
I like crs
or crs!
if it doesn't reallocate
IMO crs!(x)
only makes sense if x
is mutable and can change its CRS, which is not the case for LibGEOS, Shapefile, GeoJSON, WKB, all other Julia reader geometries, and GI wrappers (I'm probably missing a few here). crs
is also used as a getter so I'd tend to prefer setcrs
(and maybe optional setcrs!
for e.g. ArchGDAL and GeoDataFrames / Tables in general).
I guess if we went down this road we might want to introduce:
GI.getcrs
and then phase out GI.crs
I'm ok with crs
and setcrs
. That's what Rasters always had
setcrs
can have the fallback of just wrapping with GI geoms for when the original object can't hold crs
A simple setcrs utility would be a nice to have. Doing this:
is a bit awkward. a setcrs utility
would help clean things up