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

TypeError: Cannot read property 'attributes' of undefined #37

Open
flibbertigibbet opened this issue Nov 9, 2017 · 3 comments
Open

Comments

@flibbertigibbet
Copy link

Appears to specifically be an issue with esri2geo, but reporting here as unsure of exact cause.

info: all requests settled
info: creating Coastal.Coastline_line json
info: Creating Esri JSON
info: Creating GeoJSON
info:  TypeError: Cannot read property 'attributes' of undefined
    at toGeoJSON (/projects/AGStoShapefile/node_modules/esri2geo/esri2geo.js:18:24)
    at /projects/AGStoShapefile/AGStoSHP.js:140:3
    at _fulfilled (/projects/AGStoShapefile/node_modules/q/q.js:854:54)
    at self.promiseDispatch.done (/projects/AGStoShapefile/node_modules/q/q.js:883:30)
    at Promise.promise.promiseDispatch (/projects/AGStoShapefile/node_modules/q/q.js:816:13)
    at /projects/AGStoShapefile/node_modules/q/q.js:624:44
    at runSingle (/projects/AGStoShapefile/node_modules/q/q.js:137:13)
    at flush (/projects/AGStoShapefile/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Was able to finish the job successfully after editing node_modules/esri2geo/esri2geo.js to skip processing in the toGeoJSON loop where the feature from the array was falsy.

services.txt:

https://encdirect.noaa.gov/arcgis/rest/services/encdirect/enc_coastal/MapServer/70|Coastal.Coastline_line
@tannerjt
Copy link
Owner

Thanks for documenting the error. I'm not sure what exactly is going wrong, but you're right that it's trying to access an attribute on a feature that is either null or undefined. When you look at your final feature count after the change to esri2geo, do you still get the total 31,849?

@flibbertigibbet
Copy link
Author

According to ogrinfo, the final feature count came out at 30,439.

@flibbertigibbet
Copy link
Author

Managed to get a download with the full feature count using the python tool esridump.

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

No branches or pull requests

2 participants