-
Notifications
You must be signed in to change notification settings - Fork 51
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
Implementing an srsinfo function? #79
Comments
Hi @mthh, Sorry for the late reply. I have been working on the v3.0.0 version with the new architecture for a long time and it is almost done. It would be very nice if the gdal3.js supported all the features of Gdal :). For gdalinfo there are gdalinfo_bin.cpp and gdalinfo_lib.cpp files. gdalinfo_lib.cpp does the actual work and is included in the gdal library. gdalinfo_bin.cpp compiles to binary using gdalinfo_lib.cpp and is not included in the gdal library. For the gdalsrsinfo file there is only the gdalsrsinfo.cpp file which is compiled to binary, not included in the gdal library. This makes things difficult. In the current version, we were writing the codes that are not in the gdal library with javascript, and it looks like it will be necessary to write the entire gdalsrsinfo.cpp file with javascript. In v3.0.0, I moved all javascript code to c++ and now we can directly access the code written by c++. In this system, if we change the main function in gdalsrsinfo.cpp to another name, it will be called by js and simply implemented. If you want to add it to the version with v2.x and open PR, I will merge it directly. If you haven't done any work yet, I will release v3.0.0 alpha in 1-2 weeks and I can add it to new version. But it may cause issues because it will be in alpha version and may require migration in the code due to the new architecture. https://github.com/users/bugra9/projects/10?pane=info What do you think about it? |
Hi @bugra9,
Great news!
I haven't done any work on it yet. |
I will include it in v3.0.0-alpha and try to release it as soon as possible. |
@mthh, I created a branch for v3.0.0 and opened PR. Your feedback is very important to me. Main features:
V3.0.0 branch: https://github.com/bugra9/gdal3.js/tree/v3.0.0-cpp.js-integration Web: https://gdal3.js.org/v3/ Dependencies: Docker, node.js, cmake > 3.28 |
In the same way as
ogrinfo
andgdalinfo
are implemented in https://github.com/bugra9/gdal3.js/tree/master/src/allJsFunctions/application, we could have asrsinfo
function that offers roughly the same functionality as gdalsrsinfo (https://gdal.org/programs/gdalsrsinfo.html).This would seem useful to me, as there doesn't seem to be a good parser for WKT2 projection definitions in JavaScript, and gdal can convert srs definitions into many formats (proj4, projjson, wkt1, various flavors of wkt2, etc.).
Given the code of
gdalsrsinfo
(https://github.com/OSGeo/gdal/blob/master/apps/gdalsrsinfo.cpp) it seems to require a bit of work to port it but I can take a look if you're interested in such a feature.The text was updated successfully, but these errors were encountered: