-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: master
Are you sure you want to change the base?
Conversation
if(feature.geometry === undefined || feature.geometry === null) { | ||
feature.geometry = { | ||
type: "Point", | ||
coordinates: [ 0, 0] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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].
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
===
instead of ==
feedback welcome