园林绿化
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

  1. #terraformer gis格式转换插件
  2. 官方网站:http://terraformer.io/
  3. github地址: https://github.com/Esri/terraformer
  4. https://github.com/Esri/terraformer-wkt-parser
  5. =============================================================
  6. // parse ArcGIS JSON, convert it to a Terraformer.Primitive
  7. var primitive = Terraformer.ArcGIS.parse({
  8. x:"-122.6764",
  9. y:"45.5165",
  10. spatialReference: {
  11. wkid: 4326
  12. }
  13. });
  14. // take a Terraformer.Primitive or GeoJSON and convert it to ArcGIS JSON
  15. var point = Terraformer.ArcGIS.convert({
  16. "type": "Point",
  17. "coordinates": [45.5165, -122.6764]
  18. });
  19. =============================================================
  20. // parse a WKT file, convert it into a primitive
  21. var primitive = Terraformer.WKT.parse('LINESTRING (30 10, 10 30, 40 40)');
  22. // take a primitive and convert it into a WKT representation
  23. var polygon = Terraformer.WKT.convert({
  24. "type": "Polygon",
  25. "coordinates": [
  26. [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],
  27. [ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]
  28. ]
  29. });