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

Handle null geometry #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Handle null geometry #1

wants to merge 3 commits into from

Conversation

ajturner
Copy link
Contributor

@ajturner ajturner commented Sep 3, 2017

feedback welcome

@ajturner ajturner self-assigned this Sep 3, 2017
if(feature.geometry === undefined || feature.geometry === null) {
feature.geometry = {
type: "Point",
coordinates: [ 0, 0]
Copy link
Member

Choose a reason for hiding this comment

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

What are your thoughts on setting this as coordinates: [ null, null]. We've made some adjustments to winnow to handle null coordinates. While not valid GeoJSON, this still loads in AGOL and ArcGIS Pro. No point is rendered for the feature with null coordinates, but it does appear in the attribute table.

Copy link
Contributor

Choose a reason for hiding this comment

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

still kind of a hack, ideally we'd be able to handle undefined here

Copy link
Member

@rgwozdz rgwozdz May 9, 2018

Choose a reason for hiding this comment

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

I took some sample data and removed geometry so as to simulate feature.geometry: undefined. Passed through FeatureServer and winnow without any observable problems. However, the result in Pro was undesirable - even if only one feature had geometry undefined, the whole dataset was loaded as a table rather than a layer. And attribute table wouldn't load. I found the best all around behavior in Pro with coordinates: [ null, null].

Copy link
Contributor

Choose a reason for hiding this comment

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

ok...oh Pro, why you so fickle?

Copy link
Contributor

Choose a reason for hiding this comment

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

do you think we should make the data conform inside Winnow or throw a warning somewhere?

Copy link
Member

Choose a reason for hiding this comment

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

We could both, that way providers wouldn't have to do this kind of transformation, but then there would be a paper trail should questions arise.

Copy link
Contributor

Choose a reason for hiding this comment

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

works for me

geometry: geometry
function formatFeature (input) {
let feature = {};
if(input.type == "Feature") {
Copy link
Member

Choose a reason for hiding this comment

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

=== instead of ==

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.

None yet

3 participants