| 80396 | } |
| 80397 | |
| 80398 | function geometry(o) { |
| 80399 | var type = o.type, |
| 80400 | coordinates; |
| 80401 | |
| 80402 | switch (type) { |
| 80403 | case "GeometryCollection": |
| 80404 | return { |
| 80405 | type: type, |
| 80406 | geometries: o.geometries.map(geometry) |
| 80407 | }; |
| 80408 | |
| 80409 | case "Point": |
| 80410 | coordinates = point(o.coordinates); |
| 80411 | break; |
| 80412 | |
| 80413 | case "MultiPoint": |
| 80414 | coordinates = o.coordinates.map(point); |
| 80415 | break; |
| 80416 | |
| 80417 | case "LineString": |
| 80418 | coordinates = line(o.arcs); |
| 80419 | break; |
| 80420 | |
| 80421 | case "MultiLineString": |
| 80422 | coordinates = o.arcs.map(line); |
| 80423 | break; |
| 80424 | |
| 80425 | case "Polygon": |
| 80426 | coordinates = polygon(o.arcs); |
| 80427 | break; |
| 80428 | |
| 80429 | case "MultiPolygon": |
| 80430 | coordinates = o.arcs.map(polygon); |
| 80431 | break; |
| 80432 | |
| 80433 | default: |
| 80434 | return null; |
| 80435 | } |
| 80436 | |
| 80437 | return { |
| 80438 | type: type, |
| 80439 | coordinates: coordinates |
| 80440 | }; |
| 80441 | } |
| 80442 | |
| 80443 | return geometry(o); |
| 80444 | } |