Examples of CRSAuthorityFactory


Examples of org.opengis.referencing.crs.CRSAuthorityFactory

             
               
              CoordinateReferenceSystem dataCRS = featureSource.getSchema().getCoordinateReferenceSystem();
            
              String code = "EPSG:4326";
              CRSAuthorityFactory crsAuthorityFactory = CRS.getAuthorityFactory(true);
              CoordinateReferenceSystem mapCRS = crsAuthorityFactory.createCoordinateReferenceSystem(code);
               
               
              boolean lenient = true; // allow for some error due to different datums
              MathTransform transform = CRS.findMathTransform(dataCRS, mapCRS, lenient);
             
View Full Code Here

Examples of org.opengis.referencing.crs.CRSAuthorityFactory

     Coordinate refLatLon) {
     //    MathTransformFactory mtFactory = ReferencingFactoryFinder.getMathTransformFactory(null);
     //    ReferencingFactoryContainer factories = new ReferencingFactoryContainer(null);

     try {
       final CRSAuthorityFactory crsAuthorityFactory =
           CRS.getAuthorityFactory(false);
      
      
       final GeographicCRS geoCRS =
           crsAuthorityFactory.createGeographicCRS("EPSG:4326");
//         org.geotools.referencing.crs.DefaultGeographicCRS.WGS84;

       final CoordinateReferenceSystem dataCRS =
           crsAuthorityFactory
               .createCoordinateReferenceSystem("EPSG:"
                   + getEPSGCodefromUTS(refLatLon)); //EPSG:32618

       //      parameters = mtFactory.getDefaultParameters("Transverse_Mercator");
       //
View Full Code Here

Examples of org.opengis.referencing.crs.CRSAuthorityFactory

     Coordinate refLatLon) {
     //    MathTransformFactory mtFactory = ReferencingFactoryFinder.getMathTransformFactory(null);
     //    ReferencingFactoryContainer factories = new ReferencingFactoryContainer(null);

     try {
       final CRSAuthorityFactory crsAuthorityFactory =
           CRS.getAuthorityFactory(false);
      
      
       final GeographicCRS geoCRS =
           crsAuthorityFactory.createGeographicCRS("EPSG:4326");
//         org.geotools.referencing.crs.DefaultGeographicCRS.WGS84;

       final CoordinateReferenceSystem dataCRS =
           crsAuthorityFactory
               .createCoordinateReferenceSystem("EPSG:"
                   + getEPSGCodefromUTS(refLatLon)); //EPSG:32618

       //      parameters = mtFactory.getDefaultParameters("Transverse_Mercator");
       //
View Full Code Here

Examples of org.opengis.referencing.crs.CRSAuthorityFactory

     */
    protected Set<String> filterCRSNames( String[] filter ) {
        crsCodeMap = new HashMap<String, String>();
        Set<String> descriptions = new TreeSet<String>();
        for( Object object : ReferencingFactoryFinder.getCRSAuthorityFactories(null) ) {
            CRSAuthorityFactory factory = (CRSAuthorityFactory) object;
            try {
                Set<String> codes = factory.getAuthorityCodes(CoordinateReferenceSystem.class);
                for( Object codeObj : codes ) {
                    String code = (String) codeObj;
                    String description;
                    try {
                        description = factory.getDescriptionText(code).toString();
                    } catch (Exception e1) {
                        description = Messages.CRSChooser_unnamed;
                    }
                    description += " (" + code + ")"; //$NON-NLS-1$ //$NON-NLS-2$
                    crsCodeMap.put(code, description);
View Full Code Here

Examples of org.opengis.referencing.crs.CRSAuthorityFactory

     */
    protected CoordinateReferenceSystem createCRS( String code ) {
        if (code == null)
            return null;
        for( Object object : ReferencingFactoryFinder.getCRSAuthorityFactories(null) ) {
            CRSAuthorityFactory factory = (CRSAuthorityFactory) object;
            try {
                return (CoordinateReferenceSystem) factory.createObject(code);
            } catch (FactoryException e2) {
                // then we have the wrong factory
                // is there a better way to do this?
            }catch (Exception e) {
                UiPlugin.log("Error creating CRS object, trying more...", e);
View Full Code Here

Examples of org.opengis.referencing.crs.CRSAuthorityFactory

  private static int getTotalCrsCount() {

    int crsCount = 0;
    for (Object object : ReferencingFactoryFinder.getCRSAuthorityFactories(null)) {
      CRSAuthorityFactory factory = (CRSAuthorityFactory) object;
      try {
        Set<String> codes = factory.getAuthorityCodes(CoordinateReferenceSystem.class);
        crsCount = crsCount + codes.size();
      } catch (Exception e) {
        LOGGER.warning("exception" + e.getMessage()); //$NON-NLS-1$
      }
    }
View Full Code Here

Examples of org.opengis.referencing.crs.CRSAuthorityFactory

    int crsCount = 0;
    StringBuilder crsSequence = new StringBuilder();

    for (Object object : ReferencingFactoryFinder.getCRSAuthorityFactories(null)) {
      CRSAuthorityFactory factory = (CRSAuthorityFactory) object;
      try {
        CoordinateReferenceSystem crs;
        Set<String> codes = factory.getAuthorityCodes(CoordinateReferenceSystem.class);
        for (String code : codes) {

          crsCount++;
          try {
            crs = factory.createCoordinateReferenceSystem(code);
            Unit<?> unit = GeoToolsUtils.getDefaultCRSUnit(crs);
            if (!LENGTH_UNITS.containsKey(unit)) {
              LENGTH_UNITS.put(unit, unit.toString());

              Unit<?> baseUnit = unit.getStandardUnit();
View Full Code Here

Examples of org.opengis.referencing.crs.CRSAuthorityFactory

  private Element get(String crsId) {
    Element crsList = new Element("crsList");

    for (Object object : ReferencingFactoryFinder
        .getCRSAuthorityFactories(null)) {
      CRSAuthorityFactory factory = (CRSAuthorityFactory) object;

      try {
        Set<String> codes = factory
            .getAuthorityCodes(CoordinateReferenceSystem.class);
        for (Object codeObj : codes) {
          String code = (String) codeObj;

          if (code.equals(crsId)) {

            String authorityTitle = (factory.getAuthority()
                .getTitle() == null ? "" : factory
                .getAuthority().getTitle().toString());
            String authorityEdition = (factory.getAuthority()
                .getEdition() == null ? "" : factory
                .getAuthority().getEdition().toString());

            String authorityCodeSpace = "";
            Collection<? extends Identifier> ids = factory
                .getAuthority().getIdentifiers();
            for (Identifier id : ids) {
              authorityCodeSpace = id.getCode();
            }

            String description;
            try {
              description = factory.getDescriptionText(code)
                  .toString();
            } catch (Exception e1) {
              description = "-";
            }
            description += " (" + authorityCodeSpace + ":" + code
View Full Code Here

Examples of org.opengis.referencing.crs.CRSAuthorityFactory

    Element crsList = new Element("crsList");
    int i = 0;

    for (Object object : ReferencingFactoryFinder
        .getCRSAuthorityFactories(null)) {
      CRSAuthorityFactory factory = (CRSAuthorityFactory) object;

      String authorityTitle = (factory.getAuthority().getTitle() == null ? ""
          : factory.getAuthority().getTitle().toString());
      String authorityEdition = (factory.getAuthority().getEdition() == null ? ""
          : factory.getAuthority().getEdition().toString());

      String authorityCodeSpace = "";
      Collection<? extends Identifier> ids = factory.getAuthority()
          .getIdentifiers();
      for (Identifier id : ids) {
        authorityCodeSpace = id.getCode();
        // FIXME : Which one to choose when many ?
      }

      try {
        Set<String> codes = factory.getAuthorityCodes(crsTypeClass);
        for (Object codeObj : codes) {
          String code = (String) codeObj;

          String description;
          try {
            description = factory.getDescriptionText(code)
                .toString();
          } catch (Exception e1) {
            description = "-";
          }
          description += " (" + authorityCodeSpace + ":" + code + ")";
View Full Code Here

Examples of org.opengis.referencing.crs.CRSAuthorityFactory

            FeatureSource<SimpleFeatureType, SimpleFeature> featureSource = _featureSourceFactory
                    .getFeatureSource();
            CoordinateReferenceSystem sourceCRS = featureSource.getInfo().getCRS();

            Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);
            CRSAuthorityFactory factory = ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG",
                    hints);
            CoordinateReferenceSystem worldCRS = factory
                    .createCoordinateReferenceSystem("EPSG:4326");

            Query query = new Query();
            query.setCoordinateSystem(sourceCRS);
            query.setCoordinateSystemReproject(worldCRS);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.