A utility for finding out more information about a spatial CSV file.
$ npm install geocsv-info --save
var geocsvinfo = require('geocsv-info');
geocsvinfo('example.csv', function(err, info){
console.log(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
}
};
'WKT'
'GeoJSON'
'PointFromColumns'
(latitude/longitude)
'separator'
: char- use specified character as separator instead of autodetecting it
'estimate'
: int- max # of features to compute extent from
count
: int- total # of features
filesize
: int- total filesize in bytes
separator
: charheaders
: 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
- an object mapping each fieldname to its basic type (
geometryField
: objectencoding
:"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
: objectminX
: numberminY
: numbermaxX
: numbermaxY
: number
Copyright © 2013 Brandon Reavis
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.