-
Notifications
You must be signed in to change notification settings - Fork 47
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
Crash when only one feature #30
Comments
Interesting. Can you try logging the output out objectIds on line 71: |
The best thing to do is probably check to see if is an array
|
Having to work slowly through the service list to find which one is the issue - however, I find that unsurprizingly, it also crashes when service return empty (not uncommon in this instance - it is shapefile of permits and want weekly update as changes often and can none). |
I really should have better logging and error handling. It's been on my todo list. It would save time if at the end it just said... |
If it returns empty, does it return undefined or some standard? If it returned an empty array, or a boolean value we could easily detect. |
I am getting it on an odd one: (node:6308) DeprecationWarning: process.EventEmitter is deprecated. Use require( TypeError: Cannot read property 'sort' of null |
objectId is null. |
I wonder if that would take care of these two (line 71) |
Yup. That works well. Now I get: |
(My services file is large so giving this a good workout). |
Hopefully the script is helping with some of the other services. It's not perfect, but it will usually get the job done with some minor adjustments 😄 |
ya i'm getting code=400 as well... anyone got a fix? |
ok, the issue with code=400 with me is on there being sublayers.... |
It should be straightforward to define sublayers under the root REST endpoint, and I'll look into that for future improvements. For now, all sublayers need to be defined explicitly in the services.txt file:
|
i solved it by using just sublayers, not anything above (which caused the 400s) |
(node:13548) DeprecationWarning: process.EventEmitter is deprecated. Use require
('events') instead.
info: Number of features for service: 1
info: Getting chunks of 100 features...
info: query -> 0 out of 1
C:\AGStoShapefile-master\AGStoSHP.js:71
objectIds.sort();
^
TypeError: Cannot read property 'sort' of null
at requestService (C:\AGStoShapefile-master\AGStoSHP.js:71:11)
at Request._callback (C:\AGStoShapefile-master\AGStoSHP.js:64:4)
at Request.self.callback (C:\AGStoShapefile-master\node_modules\request\requ
est.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (C:\AGStoShapefile-master\node_modules\request\reques
t.js:1171:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage. (C:\AGStoShapefile-master\node_modules\reques
t\request.js:1091:12)
at IncomingMessage.g (events.js:292:16)
C:\AGStoShapefile-master>node AGStoSHP.js services.txt W:/NZPM_Shapefiles
The text was updated successfully, but these errors were encountered: