Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add coordtype #167

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

add coordtype #167

wants to merge 1 commit into from

Conversation

rafaqz
Copy link
Member

@rafaqz rafaqz commented Sep 25, 2024

Closes #128

Currently on a GI.MultiPolygon this takes 4ns. Its not a compile time operation. We could put this in the type parameters of the wrapper geometries at construction so its instant.

A lot of packages will be able to set this absolutely to a single type, e.g. Shapefile.jl, GeoJSON.jl and LibGEOS.jl can return Float64.

@rafaqz rafaqz changed the title add coordtype add coordtype Sep 25, 2024
Comment on lines +321 to +323
coordtype(::Point{<:Any,<:Any,<:AbstractArray{T}}) where T = T
coordtype(::Point{<:Any,<:Any,<:NTuple{<:Any,T}}) where T = T
coordtype(::Point{<:Any,<:Any,<:NamedTuple{<:Any,<:NTuple{<:Any,T}}}) where T = T
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove the Point from here, so that the dispatch with parent(p) for Point feeds into these?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that will hit the fallback method in fallbacks.jl. It just get the X coord type

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also add some @test_inferred? Or is it too early for that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good idea

@asinghvi17
Copy link
Member

GeoInterface implementations:

Bridge packages

  • ArchGDAL
  • LibGEOS

Readers

  • GeoParquet
  • GeoArrow
  • GeoJSON
  • Shapefile
  • WellKnownGeometry

Other implementations

  • GeometryBasics

@rafaqz rafaqz requested review from evetion and visr September 28, 2024 16:56
@evetion
Copy link
Member

evetion commented Sep 28, 2024

I'm fine with this, but might be good to give a concrete example of what this improves. Do we also want to give some hints using coordtype for let's say GI.coordinates? That's the most type unstable thing I can think of in here.

@rafaqz
Copy link
Member Author

rafaqz commented Sep 28, 2024

Yeah, we could use it for coordinates in some cases

(Answered the rest in the issue thread)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a coordtype method
3 participants