Source: formats/geojson/GeoJSONConstants.js

  1. /*
  2. * Copyright 2003-2006, 2009, 2017, 2020 United States Government, as represented
  3. * by the Administrator of the National Aeronautics and Space Administration.
  4. * All rights reserved.
  5. *
  6. * The NASAWorldWind/WebWorldWind platform is licensed under the Apache License,
  7. * Version 2.0 (the "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License
  9. * at http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software distributed
  12. * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  13. * CONDITIONS OF ANY KIND, either express or implied. See the License for the
  14. * specific language governing permissions and limitations under the License.
  15. *
  16. * NASAWorldWind/WebWorldWind also contains the following 3rd party Open Source
  17. * software:
  18. *
  19. * ES6-Promise – under MIT License
  20. * libtess.js – SGI Free Software License B
  21. * Proj4 – under MIT License
  22. * JSZip – under MIT License
  23. *
  24. * A complete listing of 3rd Party software notices and licenses included in
  25. * WebWorldWind can be found in the WebWorldWind 3rd-party notices and licenses
  26. * PDF found in code directory.
  27. */
  28. /**
  29. * @exports GeoJSONConstants
  30. */
  31. define([],
  32. function() {
  33. "use strict";
  34. /**
  35. * Provides GeoJSON string constants.
  36. * @alias GeoJSONConstants
  37. * @constructor
  38. * @classdesc Contains some GeoJSON string constants.
  39. */
  40. var GeoJSONConstants = function () {};
  41. GeoJSONConstants.FIELD_TYPE = "type";
  42. GeoJSONConstants.FIELD_CRS = "crs";
  43. GeoJSONConstants.FIELD_NAME = "name";
  44. GeoJSONConstants.FIELD_BBOX = "bbox";
  45. GeoJSONConstants.FIELD_COORDINATES = "coordinates";
  46. GeoJSONConstants.FIELD_GEOMETRIES = "geometries";
  47. GeoJSONConstants.FIELD_GEOMETRY = "geometry";
  48. GeoJSONConstants.FIELD_PROPERTIES = "properties";
  49. GeoJSONConstants.FIELD_FEATURES = "features";
  50. GeoJSONConstants.FIELD_ID = "id";
  51. GeoJSONConstants.TYPE_POINT = "Point";
  52. GeoJSONConstants.TYPE_MULTI_POINT = "MultiPoint";
  53. GeoJSONConstants.TYPE_LINE_STRING = "LineString";
  54. GeoJSONConstants.TYPE_MULTI_LINE_STRING = "MultiLineString";
  55. GeoJSONConstants.TYPE_POLYGON = "Polygon";
  56. GeoJSONConstants.TYPE_MULTI_POLYGON = "MultiPolygon";
  57. GeoJSONConstants.TYPE_GEOMETRY_COLLECTION = "GeometryCollection";
  58. GeoJSONConstants.TYPE_FEATURE = "Feature";
  59. GeoJSONConstants.TYPE_FEATURE_COLLECTION = "FeatureCollection";
  60. GeoJSONConstants.FIELD_CRS_NAME = "name";
  61. GeoJSONConstants.FIELD_CRS_LINK = "link";
  62. // Default Named CRS string
  63. // OGC CRS URNs such as "urn:ogc:def:crs:OGC:1.3:CRS84" shall be preferred over legacy identifiers
  64. // such as "EPSG:4326"
  65. GeoJSONConstants.WGS84_CRS = "urn:ogc:def:crs:OGC:1.3:CRS84";
  66. GeoJSONConstants.EPSG4326_CRS = "EPSG:4326";
  67. return GeoJSONConstants;
  68. }
  69. );