mirror of
https://github.com/wavded/js-shapefile-to-geojson
synced 2024-11-23 14:34:54 +00:00
Merge pull request #10 from mcclintock-lab/support-for-points
Fixed support for Point datasets
This commit is contained in:
commit
da6c4a8cf3
@ -256,20 +256,22 @@
|
||||
for (var r = 0, record; record = records[r]; r++){
|
||||
feature = {}, fbounds = record.bounds, points = record.points, parts = record.parts
|
||||
feature.type = "Feature"
|
||||
if (record.shapeType !== 'Point') {
|
||||
feature.bbox = [
|
||||
fbounds.left,
|
||||
fbounds.bottom,
|
||||
fbounds.right,
|
||||
fbounds.top
|
||||
]
|
||||
}
|
||||
geometry = feature.geometry = {}
|
||||
|
||||
switch (record.shapeType) {
|
||||
case "Point":
|
||||
geometry.type = "Point"
|
||||
geometry.coordinates = [
|
||||
record.points.x,
|
||||
record.points,y ]
|
||||
record.x,
|
||||
record.y ]
|
||||
break
|
||||
case "MultiPoint":
|
||||
case "PolyLine":
|
||||
|
Loading…
Reference in New Issue
Block a user