-
Notifications
You must be signed in to change notification settings - Fork 21
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
GeoJSON support (writer at first) #16
Conversation
Sorry for the late response. Thx for all your work. Some thoughts of mine:
I would prefer if there is a GeoJSONWriter class that mimics the WKTWriter, e.g. provides I would also prefere if we keep the c++ code base as small as possible. My first idea for the problem was to write a WKT to GeoJSON parser. Works fine but maybe is not that efficient if you want bboxes and SRIDs on your GeoJSON output. For the SRID and GeoJSON you have to call c++ functions again. I'm trying to merge this anyway. I really appreciate your work! Regards |
Some comments:
|
Ok. I did some cosmetic changes and added an alias for the Did you benchmark point 2) ? Have you considered using other libs like geoscript for your software? Not sure if calling c/c++ code is the best way to go. Maybe we should add more async calls to the lib? Anyway cool to see the binding in action :) |
…e/master Conflicts: wscript
No, but it is logical that it's slower, isn't it? Not just concerning CPU cycles but memory consumption, too. It's the user's responsibility to fork processes to do heavy computing etc. All the data is in memory, isn't it? This is why async calls are not needed. I have not studied your code in detail, but it seems that you have included some EIO calls in the background. Which function did you make async? Now I have remerged your changes into my repository ( like this: https://gist.github.com/964057 ). akidee/master
Which branch do I need to checkout to continue development? I don't see the geojson branch which I find here. (Sorry for my lack of git knowledge, but this seems to be a little bit confusing ;) ) |
Conflicts: test/geojsonwriter-test.coffee
Oh, probably you should close the pull request since my latest commits, to synchronize your changes, are now included. |
These functions should be async:
I'm going to add a example for this too. I'm not sure if asnc calls make sense in this context. Maybe your are right. Depends on the complexity of the functions and geometries. Sorry for the confusion. I created a branch and plan to merge this back into the master soon. |
No problem. Am I right that I can call them without a callback and they are sync functions then? If no, then I am not OK with this API. All these functions should be synchronous by default. In this context, it does not pay off. |
Add a callback and they become async functions. Without callback they are sync: 645f676#L0R14 Ok. I close this pull request and merge the geojson branch as soon as possible. |
I added a GeoJSONWriter class (without providing JS access), defined in src/geojsonwriter.hpp which can accessed in Geometry::toJSON(decimalPlaces, bbox):
Tests are added.