Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

geocsv-info

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

geocsv-info

node.js utility for finding out more information about a csv file with geometry fields

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

geocsv-info

node.js utility for finding out more information about a spatial csv file

Example

var geocsvinfo = require('geocsv-info');

geocsvinfo('example.csv', function(err, info){
	console.log(info);
}); 

//result
info = { 
	count: 3,
	separator: '|',
	headers: [ 'id', 'name', 'wkt' ],
	fields: {
		id: 'Number',
		name: 'String',
		wkt: 'String'
	},
	geometryField: { 
		id: 2, 
		name: 'wkt', 
		encoding: 'WKT' 
	},
	extent: { minX: 10, minY: 10, maxX: 45, maxY: 40 } 
};

Supported Geometry Encoding

  • 'WKT'
  • 'GeoJSON'
  • 'PointFromColumns' (latitude/longitude)

Options

  • 'separator' : char
    • use specified character as separator instead of autodetecting it
  • 'estimate' : int
    • max # of features to compute extent from

Output

  • count: int
    • total # of features
  • filesize: int
    • total filesize in bytes
  • separator: char
  • headers: string[]
    • list of all field names
  • fields: object
    • an object mapping each fieldname to its basic type ("Number" or "String"). includes geometry fields interpreted as if it was a normal csv
  • geometryField: object
    • encoding: "WKT", "GeoJSON", or "PointFromColumns"
    • name: string | object
      • string for WKT, GeoJSON encoding
      • object with x, y properties for geometry with PointFromColumns encoding
    • id: int | object
      • field index
      • int for WKT, GeoJSON encoding
      • object with x, y properties for geometry with PointFromColumns encoding
  • extent: object
    • minX : number
    • minY : number
    • maxX : number
    • maxY : number

Keywords

FAQs

Package last updated on 17 Nov 2014

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc