Socket
Book a DemoInstallSign in
Socket

geonode-simplegeo

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geonode-simplegeo

Geography for Node.js

0.0.1
latest
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

PROJ BINDINGS UPDATE NOTES

  • I had to get a tetanus shot because of the rust on my C++ "skills."
  • Currently hardcoded the WAF build script to use /opt/local/* for Proj.
  • Tested against Proj 4.7.0 on MacOS X 10.5.
  • Projection object constructor currently only accepts Proj4 strings.
  • Transformation is currently "in-place," but this can be changed pretty easily.

Code Example

var srcProj = new geonode.Projection("+init=epsg:4326"); var dstProj = new geonode.Projection("+init=esri:54004")

sys.puts(srcProj.definition); // " +init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0" sys.puts(dstProj.definition); // " +init=esri:54004 +proj=merc +lat_ts=0 +lon_0=0 +k=1.000000 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs +towgs84=0,0,0"

var myPoint = new geonode.Geometry("POINT(1 2)");

// transformation is "in-place" geonode.Projection.transform(srcProj, dstProj, myPoint);

sys.puts(myPoint.toWkt()); // "POINT (111319.4907932735659415 221194.0771677151496988)"

~ geonode ~

Bringing geography to node.js.

Example

var geonode = require("geonode");

var myPoint = new geonode.Geometry("POINT(1 2)");
sys.puts(myPoint.toWkt()); // "POINT (1.0000000000000000 2.0000000000000000)"

var myPolygon = new geonode.Geometry("POLYGON((0 0, 3 0, 3 3, 0 3, 0 0))");
sys.puts(myPolygon.contains(myPoint)); // "true"

Installation

$ git clone git://github.com/paulsmith/geonode.git
$ cd geonode
$ node-waf configure build

Prerequisites

  • GEOS 3.1.x

TODO

In no particular order:

  • Finish wrapping GEOS C API
    • Coordinate sequence functions
    • Geometry constructors
    • Some topology operations -- polygonize, line merge, etc.
    • WKB read/write
  • R-Tree index (with asynchronous searches, inserts, updates, deletes)
  • Prepared geometries for faster predicates (contains, intersects, within)
  • GDAL OGR wrapper -- non-blocking reads from datasources
  • Proj wrapper
  • Better organized unit tests, more coverage
  • GeoJSON read/write
  • De-cargo-cult the C++, be more idiomatic
  • Document API

More tk ...

-- Paul Smith

@paulsmith pauladamsmith.com

Keywords

geography

FAQs

Package last updated on 09 Dec 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.