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