3 ms·
Probably trickier than I think. I want to wrap the GDAL OGR library, which provides a common API for reading and writing spatial datasources, including PostGIS,
by paulsmith 17y ago
Probably trickier than I think. I want to wrap the GDAL OGR library, which provides a common API for reading and writing spatial datasources, including PostGIS, however the trick will be the dealing with the subtleties of blocking I/O for each underlying access method (shapefiles and other file-based sources, PostGIS, ODBC, etc.).
Ryan's node_postgres add-on [1] is a good example for how one might implement this.
[1] http://github.com/ry/node_postgres http://github.com/ry/node_postgres
- crux_ 17y agoRecommendations for you: (1) Unless there are licensing issues, you'll probably find a bunch of useful js code you can use from OpenLayers. (2) If you can live with a separate server process, it would be handy to just stand up GeoServer (or MapServer) and serve out WFS. ('Web Feature Service', which is served-up vector features in GML based on area of interest and other query params -- OpenLayers can parse this, which is good, because you probably don't want to write it yourself.) (This gets you a nice decoupling at the expense of being less standalone... for example, you could shell out to ogr2ogr to get your GML instead, or switch to mapserver, etc.) Edit: Reading your other comment, it seems speed is important, so maybe (2) isn't such a good recommendation, although it might be a good starting point since it will deal with a lot of the painful stuff (format conversions, reprojections, styling...) up front.