test_class.file: geoserver/webapp/api-composer/src/test/java/com/boundlessgeo/geoserver/api/controllers/IOTest.java
test_class.identifier: IOTest
test_case.body: @Test
      public void TestProj() {
          
          //Test regurlar CRS
          String srs = "EPSG:4326";
          JSONObj obj = new JSONObj();
          IO.proj(obj, Proj.get().crs(srs), srs);
          assertEquals(srs, obj.str("srs"));
          assertNotNull(obj.get("wkt"));
          //Test complex CRS (Polar)
          srs = "EPSG:3031";
          obj = new JSONObj();
          IO.proj(obj, Proj.get().crs(srs), srs);
          assertEquals(srs, obj.str("srs"));
          assertNotNull(obj.get("wkt"));
      }
test_case.class_method_signature: IOTest.TestProj()
test_case.full_signature: @Test public void TestProj()
test_case.identifier: TestProj
test_case.invocations: proj crs get assertEquals str assertNotNull get proj crs get assertEquals str assertNotNull get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void TestProj()
focal_class.declarator: DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ssXXX"
focal_class.modifier: static final
focal_class.original_string: static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ssXXX";
focal_class.type: String
focal_class.var_name: DATE_FORMAT
focal_class.declarator: LOG = Logging.getLogger(IO.class)
focal_class.modifier: static
focal_class.original_string: static Logger LOG = Logging.getLogger(IO.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: PRETTY_TIME = new PrettyTime()
focal_class.modifier: private static
focal_class.original_string: private static PrettyTime PRETTY_TIME = new PrettyTime();
focal_class.type: PrettyTime
focal_class.var_name: PRETTY_TIME
focal_class.file: geoserver/webapp/api-composer/src/main/java/com/boundlessgeo/geoserver/api/controllers/IO.java
focal_class.identifier: IO
focal_class.class_method_signature: IO.proj(JSONObj obj, CoordinateReferenceSystem crs, String srs)
focal_class.full_signature: public static JSONObj proj(JSONObj obj, CoordinateReferenceSystem crs, String srs)
focal_class.identifier: proj
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, CoordinateReferenceSystem crs, String srs)
focal_class.return: JSONObj
focal_class.signature: JSONObj proj(JSONObj obj, CoordinateReferenceSystem crs, String srs)
focal_class.class_method_signature: IO.bounds(JSONObj obj, org.opengis.geometry.Envelope bbox)
focal_class.full_signature: public static JSONObj bounds(JSONObj obj, org.opengis.geometry.Envelope bbox)
focal_class.identifier: bounds
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, org.opengis.geometry.Envelope bbox)
focal_class.return: JSONObj
focal_class.signature: JSONObj bounds(JSONObj obj, org.opengis.geometry.Envelope bbox)
focal_class.class_method_signature: IO.bounds(JSONObj obj)
focal_class.full_signature: public static Envelope bounds(JSONObj obj)
focal_class.identifier: bounds
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj)
focal_class.return: Envelope
focal_class.signature: Envelope bounds(JSONObj obj)
focal_class.class_method_signature: IO.crs(JSONObj obj)
focal_class.full_signature: public static CoordinateReferenceSystem crs(JSONObj obj)
focal_class.identifier: crs
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj)
focal_class.return: CoordinateReferenceSystem
focal_class.signature: CoordinateReferenceSystem crs(JSONObj obj)
focal_class.class_method_signature: IO.srs(JSONObj obj)
focal_class.full_signature: public static String srs(JSONObj obj)
focal_class.identifier: srs
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj)
focal_class.return: String
focal_class.signature: String srs(JSONObj obj)
focal_class.class_method_signature: IO.workspace(JSONObj obj, WorkspaceInfo workspace, NamespaceInfo namespace, boolean isDefault)
focal_class.full_signature: public static JSONObj workspace(JSONObj obj, WorkspaceInfo workspace, NamespaceInfo namespace, boolean isDefault)
focal_class.identifier: workspace
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, WorkspaceInfo workspace, NamespaceInfo namespace, boolean isDefault)
focal_class.return: JSONObj
focal_class.signature: JSONObj workspace(JSONObj obj, WorkspaceInfo workspace, NamespaceInfo namespace, boolean isDefault)
focal_class.class_method_signature: IO.title(LayerInfo layer)
focal_class.full_signature: static Object title(LayerInfo layer)
focal_class.identifier: title
focal_class.modifiers: static
focal_class.parameters: (LayerInfo layer)
focal_class.return: Object
focal_class.signature: Object title(LayerInfo layer)
focal_class.class_method_signature: IO.description(LayerInfo layer)
focal_class.full_signature: static Object description(LayerInfo layer)
focal_class.identifier: description
focal_class.modifiers: static
focal_class.parameters: (LayerInfo layer)
focal_class.return: Object
focal_class.signature: Object description(LayerInfo layer)
focal_class.class_method_signature: IO.layer(JSONObj json, LayerInfo info, HttpServletRequest req)
focal_class.full_signature: public static JSONObj layer(JSONObj json, LayerInfo info, HttpServletRequest req)
focal_class.identifier: layer
focal_class.modifiers: public static
focal_class.parameters: (JSONObj json, LayerInfo info, HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj layer(JSONObj json, LayerInfo info, HttpServletRequest req)
focal_class.class_method_signature: IO.layerDetails(JSONObj obj, PublishedInfo layer, HttpServletRequest req)
focal_class.full_signature: public static JSONObj layerDetails(JSONObj obj, PublishedInfo layer, HttpServletRequest req)
focal_class.identifier: layerDetails
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, PublishedInfo layer, HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj layerDetails(JSONObj obj, PublishedInfo layer, HttpServletRequest req)
focal_class.class_method_signature: IO.layerDetails(JSONObj obj, LayerGroupInfo group, HttpServletRequest req)
focal_class.full_signature: public static JSONObj layerDetails(JSONObj obj, LayerGroupInfo group, HttpServletRequest req)
focal_class.identifier: layerDetails
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, LayerGroupInfo group, HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj layerDetails(JSONObj obj, LayerGroupInfo group, HttpServletRequest req)
focal_class.class_method_signature: IO.layerDetails(JSONObj obj, LayerInfo layer, HttpServletRequest req)
focal_class.full_signature: @SuppressWarnings("unchecked") public static JSONObj layerDetails(JSONObj obj, LayerInfo layer, HttpServletRequest req)
focal_class.identifier: layerDetails
focal_class.modifiers: @SuppressWarnings("unchecked") public static
focal_class.parameters: (JSONObj obj, LayerInfo layer, HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj layerDetails(JSONObj obj, LayerInfo layer, HttpServletRequest req)
focal_class.class_method_signature: IO.type(ResourceInfo r)
focal_class.full_signature: static String type(ResourceInfo r)
focal_class.identifier: type
focal_class.modifiers: static
focal_class.parameters: (ResourceInfo r)
focal_class.return: String
focal_class.signature: String type(ResourceInfo r)
focal_class.class_method_signature: IO.geometry(LayerInfo layer)
focal_class.full_signature: static String geometry(LayerInfo layer)
focal_class.identifier: geometry
focal_class.modifiers: static
focal_class.parameters: (LayerInfo layer)
focal_class.return: String
focal_class.signature: String geometry(LayerInfo layer)
focal_class.class_method_signature: IO.bbox( JSONObj bbox, LayerGroupInfo l )
focal_class.full_signature: public static JSONObj bbox( JSONObj bbox, LayerGroupInfo l )
focal_class.identifier: bbox
focal_class.modifiers: public static
focal_class.parameters: ( JSONObj bbox, LayerGroupInfo l )
focal_class.return: JSONObj
focal_class.signature: JSONObj bbox( JSONObj bbox, LayerGroupInfo l )
focal_class.class_method_signature: IO.bbox( JSONObj bbox, ResourceInfo r )
focal_class.full_signature: public static JSONObj bbox( JSONObj bbox, ResourceInfo r )
focal_class.identifier: bbox
focal_class.modifiers: public static
focal_class.parameters: ( JSONObj bbox, ResourceInfo r )
focal_class.return: JSONObj
focal_class.signature: JSONObj bbox( JSONObj bbox, ResourceInfo r )
focal_class.class_method_signature: IO.schema( JSONObj schema, FeatureType type, boolean details)
focal_class.full_signature: public static JSONObj schema( JSONObj schema, FeatureType type, boolean details)
focal_class.identifier: schema
focal_class.modifiers: public static
focal_class.parameters: ( JSONObj schema, FeatureType type, boolean details)
focal_class.return: JSONObj
focal_class.signature: JSONObj schema( JSONObj schema, FeatureType type, boolean details)
focal_class.class_method_signature: IO.feature( JSONArr arr, Feature feature)
focal_class.full_signature: public static JSONArr feature( JSONArr arr, Feature feature)
focal_class.identifier: feature
focal_class.modifiers: public static
focal_class.parameters: ( JSONArr arr, Feature feature)
focal_class.return: JSONArr
focal_class.signature: JSONArr feature( JSONArr arr, Feature feature)
focal_class.class_method_signature: IO.features( JSONArr arr, FeatureCollection<FeatureType, Feature> features)
focal_class.full_signature: public static JSONArr features( JSONArr arr, FeatureCollection<FeatureType, Feature> features)
focal_class.identifier: features
focal_class.modifiers: public static
focal_class.parameters: ( JSONArr arr, FeatureCollection<FeatureType, Feature> features)
focal_class.return: JSONArr
focal_class.signature: JSONArr features( JSONArr arr, FeatureCollection<FeatureType, Feature> features)
focal_class.class_method_signature: IO.schemaGrid( JSONObj schema, CoverageInfo info, boolean details )
focal_class.full_signature: public static JSONObj schemaGrid( JSONObj schema, CoverageInfo info, boolean details )
focal_class.identifier: schemaGrid
focal_class.modifiers: public static
focal_class.parameters: ( JSONObj schema, CoverageInfo info, boolean details )
focal_class.return: JSONObj
focal_class.signature: JSONObj schemaGrid( JSONObj schema, CoverageInfo info, boolean details )
focal_class.class_method_signature: IO.schemaGrid( JSONObj schema, CoordinateReferenceSystem crs, boolean details)
focal_class.full_signature: public static JSONObj schemaGrid( JSONObj schema, CoordinateReferenceSystem crs, boolean details)
focal_class.identifier: schemaGrid
focal_class.modifiers: public static
focal_class.parameters: ( JSONObj schema, CoordinateReferenceSystem crs, boolean details)
focal_class.return: JSONObj
focal_class.signature: JSONObj schemaGrid( JSONObj schema, CoordinateReferenceSystem crs, boolean details)
focal_class.class_method_signature: IO.store(JSONObj obj, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.full_signature: public static JSONObj store(JSONObj obj, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.identifier: store
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.return: JSONObj
focal_class.signature: JSONObj store(JSONObj obj, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.class_method_signature: IO.storeDetails(JSONObj json, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.full_signature: public static JSONObj storeDetails(JSONObj json, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.identifier: storeDetails
focal_class.modifiers: public static
focal_class.parameters: (JSONObj json, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.return: JSONObj
focal_class.signature: JSONObj storeDetails(JSONObj json, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.class_method_signature: IO.layerCount(StoreInfo store, GeoServer geoServer)
focal_class.full_signature: static int layerCount(StoreInfo store, GeoServer geoServer)
focal_class.identifier: layerCount
focal_class.modifiers: static
focal_class.parameters: (StoreInfo store, GeoServer geoServer)
focal_class.return: int
focal_class.signature: int layerCount(StoreInfo store, GeoServer geoServer)
focal_class.class_method_signature: IO.layers(ResourceInfo r, JSONArr list, GeoServer geoServer)
focal_class.full_signature: private static JSONArr layers(ResourceInfo r, JSONArr list, GeoServer geoServer)
focal_class.identifier: layers
focal_class.modifiers: private static
focal_class.parameters: (ResourceInfo r, JSONArr list, GeoServer geoServer)
focal_class.return: JSONArr
focal_class.signature: JSONArr layers(ResourceInfo r, JSONArr list, GeoServer geoServer)
focal_class.class_method_signature: IO.layers(StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.full_signature: private static JSONArr layers(StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.identifier: layers
focal_class.modifiers: private static
focal_class.parameters: (StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.return: JSONArr
focal_class.signature: JSONArr layers(StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.class_method_signature: IO.resources(StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.full_signature: @SuppressWarnings("unchecked") private static JSONArr resources(StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.identifier: resources
focal_class.modifiers: @SuppressWarnings("unchecked") private static
focal_class.parameters: (StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.return: JSONArr
focal_class.signature: JSONArr resources(StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.class_method_signature: IO.resource(JSONObj obj, StoreInfo store, String name, GeoServer geoServer)
focal_class.full_signature: public static JSONObj resource(JSONObj obj, StoreInfo store, String name, GeoServer geoServer)
focal_class.identifier: resource
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, StoreInfo store, String name, GeoServer geoServer)
focal_class.return: JSONObj
focal_class.signature: JSONObj resource(JSONObj obj, StoreInfo store, String name, GeoServer geoServer)
focal_class.class_method_signature: IO.listResources(StoreInfo store)
focal_class.full_signature: private static Iterable<String> listResources(StoreInfo store)
focal_class.identifier: listResources
focal_class.modifiers: private static
focal_class.parameters: (StoreInfo store)
focal_class.return: Iterable<String>
focal_class.signature: Iterable<String> listResources(StoreInfo store)
focal_class.class_method_signature: IO.source(StoreInfo store, GeoServer geoServer)
focal_class.full_signature: private static String source(StoreInfo store, GeoServer geoServer)
focal_class.identifier: source
focal_class.modifiers: private static
focal_class.parameters: (StoreInfo store, GeoServer geoServer)
focal_class.return: String
focal_class.signature: String source(StoreInfo store, GeoServer geoServer)
focal_class.class_method_signature: IO.source(File file, GeoServerDataDirectory dataDir)
focal_class.full_signature: private static String source(File file, GeoServerDataDirectory dataDir)
focal_class.identifier: source
focal_class.modifiers: private static
focal_class.parameters: (File file, GeoServerDataDirectory dataDir)
focal_class.return: String
focal_class.signature: String source(File file, GeoServerDataDirectory dataDir)
focal_class.class_method_signature: IO.source(URL url, GeoServerDataDirectory dataDir)
focal_class.full_signature: private static String source(URL url, GeoServerDataDirectory dataDir)
focal_class.identifier: source
focal_class.modifiers: private static
focal_class.parameters: (URL url, GeoServerDataDirectory dataDir)
focal_class.return: String
focal_class.signature: String source(URL url, GeoServerDataDirectory dataDir)
focal_class.class_method_signature: IO.sourceURL(String url, GeoServerDataDirectory dataDir)
focal_class.full_signature: private static String sourceURL(String url, GeoServerDataDirectory dataDir)
focal_class.identifier: sourceURL
focal_class.modifiers: private static
focal_class.parameters: (String url, GeoServerDataDirectory dataDir)
focal_class.return: String
focal_class.signature: String sourceURL(String url, GeoServerDataDirectory dataDir)
focal_class.class_method_signature: IO.sourceFile(String file, GeoServerDataDirectory dataDir)
focal_class.full_signature: private static String sourceFile(String file, GeoServerDataDirectory dataDir)
focal_class.identifier: sourceFile
focal_class.modifiers: private static
focal_class.parameters: (String file, GeoServerDataDirectory dataDir)
focal_class.return: String
focal_class.signature: String sourceFile(String file, GeoServerDataDirectory dataDir)
focal_class.class_method_signature: IO.date(JSONObj obj, Date date)
focal_class.full_signature: static JSONObj date(JSONObj obj, Date date)
focal_class.identifier: date
focal_class.modifiers: static
focal_class.parameters: (JSONObj obj, Date date)
focal_class.return: JSONObj
focal_class.signature: JSONObj date(JSONObj obj, Date date)
focal_class.class_method_signature: IO.metadata(JSONObj obj, Info i)
focal_class.full_signature: static JSONObj metadata(JSONObj obj, Info i)
focal_class.identifier: metadata
focal_class.modifiers: static
focal_class.parameters: (JSONObj obj, Info i)
focal_class.return: JSONObj
focal_class.signature: JSONObj metadata(JSONObj obj, Info i)
focal_class.class_method_signature: IO.error(JSONObj json, Throwable error)
focal_class.full_signature: public static JSONObj error(JSONObj json, Throwable error)
focal_class.identifier: error
focal_class.modifiers: public static
focal_class.parameters: (JSONObj json, Throwable error)
focal_class.return: JSONObj
focal_class.signature: JSONObj error(JSONObj json, Throwable error)
focal_class.class_method_signature: IO.param(JSONObj json, Parameter<?> p)
focal_class.full_signature: public static JSONObj param(JSONObj json, Parameter<?> p)
focal_class.identifier: param
focal_class.modifiers: public static
focal_class.parameters: (JSONObj json, Parameter<?> p)
focal_class.return: JSONObj
focal_class.signature: JSONObj param(JSONObj json, Parameter<?> p)
focal_class.class_method_signature: IO.param(JSONObj json, Format g)
focal_class.full_signature: public static void param(JSONObj json, Format g)
focal_class.identifier: param
focal_class.modifiers: public static
focal_class.parameters: (JSONObj json, Format g)
focal_class.return: void
focal_class.signature: void param(JSONObj json, Format g)
focal_class.class_method_signature: IO.safeValue(Object value)
focal_class.full_signature: static private Object safeValue(Object value)
focal_class.identifier: safeValue
focal_class.modifiers: static private
focal_class.parameters: (Object value)
focal_class.return: Object
focal_class.signature: Object safeValue(Object value)
focal_class.class_method_signature: IO.url(HttpServletRequest req, String path, Object ... args)
focal_class.full_signature: public static Object url(HttpServletRequest req, String path, Object ... args)
focal_class.identifier: url
focal_class.modifiers: public static
focal_class.parameters: (HttpServletRequest req, String path, Object ... args)
focal_class.return: Object
focal_class.signature: Object url(HttpServletRequest req, String path, Object ... args)
focal_class.class_method_signature: IO.ref(JSONObj obj, Ref ref)
focal_class.full_signature: public static JSONObj ref(JSONObj obj, Ref ref)
focal_class.identifier: ref
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, Ref ref)
focal_class.return: JSONObj
focal_class.signature: JSONObj ref(JSONObj obj, Ref ref)
focal_method.body: public static JSONObj proj(JSONObj obj, CoordinateReferenceSystem crs, String srs) {
          if (srs == null && crs != null) {
              try {
                  srs = CRS.toSRS(crs);
              } catch (Exception e) {
                  LOG.log(Level.WARNING, "Unable to determine srs from crs: " + crs, e);
              }
          }
          
          if (crs != null && crs.getName() != null) {
              ReferenceIdentifier name = crs.getName();
              if (name instanceof GenericName) {
                  obj.put("title", ((GenericName) name).tip().toString());
              } else {
                  obj.put("title", name.toString());
              }
          }
          
          if (srs != null) {
              obj.put("srs", srs);
          }
          else {
              obj.put("srs", "UNKNOWN");
          }
  
          if (crs == null && srs != null) {
              try {
                  crs = CRS.decode(srs);
              } catch (Exception e) {
                  LOG.log(Level.WARNING, "Unable to determine crs from srs: " + srs, e);
              }
          }
  
          if (crs != null) {
              // type
              obj.put("type",
                      crs instanceof ProjectedCRS ? "projected" : crs instanceof GeographicCRS ? "geographic" : "other");
  
              // units
              String units = null;
              try {
                  // try to determine from actual crs
                  String unit = crs.getCoordinateSystem().getAxis(0).getUnit().toString();
                  if ("ft".equals(unit) || "feets".equals(unit))
                      units = "ft";
              } catch (Exception e) {
                  LOG.log(Level.WARNING, "Unable to determine units from crs", e);
              }
              if (units == null) {
                  // fallback: meters for projected, otherwise degrees
                  units = crs instanceof ProjectedCRS ? "m" : "degrees";
              }
              obj.put("unit", units);
              obj.put("wkt", crs.toString());
          }
  
          return obj;
      }
focal_method.class_method_signature: IO.proj(JSONObj obj, CoordinateReferenceSystem crs, String srs)
focal_method.full_signature: public static JSONObj proj(JSONObj obj, CoordinateReferenceSystem crs, String srs)
focal_method.identifier: proj
focal_method.invocations: toSRS log getName getName put toString tip put toString put put decode log put toString getUnit getAxis getCoordinateSystem equals equals log put put toString
focal_method.modifiers: public static
focal_method.parameters: (JSONObj obj, CoordinateReferenceSystem crs, String srs)
focal_method.return: JSONObj
focal_method.signature: JSONObj proj(JSONObj obj, CoordinateReferenceSystem crs, String srs)