yocontra / node-gdal-next

Node.js bindings for GDAL (Geospatial Data Abstraction Library) [Fork]
https://contra.io/node-gdal-next/
Apache License 2.0
75 stars 36 forks source link

Support for ogrlineref function #9

Closed zhangjinzhou closed 4 years ago

zhangjinzhou commented 4 years ago

Do we have plan to include ogrlineref in this nodejs implementation?

yocontra commented 4 years ago

How do you see the API looking for this?

zhangjinzhou commented 4 years ago

@contra What do you mean? The gdal official has the function. We are looking for the functionality in nodejs implementation to add new feature to our application.

yocontra commented 4 years ago

ogrlineref is a command line tool (like ogr2ogr) and not a function that we can expose in the nodejs binding. We would need to re-implement ogrlineref as a real interface to be able to bind to it. This library is a straight up link from JS to the native gdal libraries and doesn't intend to re-implement any of the command line tools that are bundled with the gdal library.

You can read the source code for ogrlineref here: https://github.com/OSGeo/gdal/blob/master/gdal/apps/ogrlineref.cpp

All of the same functions that the ogrlineref CLI uses are available in this binding, so you can reimplement whatever functionality you need from that in JS.

You could also just install gdal on the machine and run the command line tool using child_process

zhangjinzhou commented 4 years ago

@contra Thanks! Good to know. We usually run ogr2ogr tools with commandline tool in nodejs. I will do the same thing.