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

Drop flatgeobuf dependency in geozero crate #235

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

pka
Copy link
Member

@pka pka commented Aug 29, 2024

@pka pka force-pushed the drop-flatgeobuf-dep branch from f535df6 to 63475db Compare August 29, 2024 07:56
Copy link
Member

@michaelkirk michaelkirk left a comment

Choose a reason for hiding this comment

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

Thanks for taking on this long standing nuisance!

I'm on board in theory, but I had some questions before proceeding.

geozero/tests/geozero-api.rs Show resolved Hide resolved
@@ -23,6 +19,12 @@ fn json_to_svg() -> Result<()> {
Ok(())
}

/*
Copy link
Member

Choose a reason for hiding this comment

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

If you want to keep this, can you leave a comment for us-in-the-future explaining why it's here but commented out?

let props = feature.properties()?;
assert_eq!(props["id"], "DNK".to_string());
assert_eq!(props["name"], "Denmark".to_string());
// process_properties is not public. We should have iterators!
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain more what you mean by "we should have iterators"?

My guess is that you mean something like:

GeoJsonLineReader::next(&mut self) -> Result<Option<geojson::Feature>> 

So that we can write:

while let Some(feature) = json.next()? {
    ...
}

Is that right? Or something else? If so, that seems reasonable.


Though, TBH, this example doesn't seem like a great fit for the geozero API anyway. In my experience, geozero is mostly concerned with processing entire datasets. This example relies mostly on things intrinsic to flatgeobuf, including some API's added to FGB as helpers for implementing geozero APIs, but are not actually geozero APIs themselves.

Copy link
Member Author

Choose a reason for hiding this comment

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

Exactly. We should have a common feature iterator for GeozeroDatasource.

Copy link
Member

Choose a reason for hiding this comment

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

I'd really love to have a feature iterator. I've thought briefly about it before but I got stuck because I don't know how to combine the push-based nature of the GeomProcessor with the pull-based nature of the iterators

@@ -43,7 +43,6 @@ hex = "0.4"
kdbush = "0.2"
log = "0.4.19"
lyon = "1.0.1"
polylabel = "2.5"
Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing you've removed this example because it uses FGB. We could convert it to use geojson, but I'm guessing you've judged it to be not worth the upkeep?

That seems fine, just making sure I understand.

Copy link
Member Author

Choose a reason for hiding this comment

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

Exactly. This example should go either into the flatgeobuf or the polylabel crate. I tried to use geojson, but I had the same problem with the missing feature iterator.

@pka pka force-pushed the drop-flatgeobuf-dep branch 2 times, most recently from 3477741 to f5ec4e0 Compare August 29, 2024 22:07
@michaelkirk michaelkirk added this pull request to the merge queue Aug 30, 2024
@michaelkirk michaelkirk removed this pull request from the merge queue due to a manual request Aug 30, 2024
@michaelkirk
Copy link
Member

Everything's looking good, but I'll let you take care of sequencing your various merges @pka.

@pka pka added this pull request to the merge queue Aug 30, 2024
@pka pka removed this pull request from the merge queue due to a manual request Aug 30, 2024
@pka pka force-pushed the drop-flatgeobuf-dep branch from f5ec4e0 to 463f721 Compare August 30, 2024 23:27
@pka pka enabled auto-merge August 30, 2024 23:28
@pka pka added this pull request to the merge queue Aug 30, 2024
Merged via the queue into georust:main with commit 73902dd Aug 30, 2024
1 check passed
@pka pka deleted the drop-flatgeobuf-dep branch August 30, 2024 23:41
@pka pka mentioned this pull request Aug 30, 2024
github-merge-queue bot pushed a commit that referenced this pull request Sep 5, 2024
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.

3 participants