当前位置: 首页>>代码示例>>Java>>正文


Java ReferenceIdentifier类代码示例

本文整理汇总了Java中org.opengis.referencing.ReferenceIdentifier的典型用法代码示例。如果您正苦于以下问题:Java ReferenceIdentifier类的具体用法?Java ReferenceIdentifier怎么用?Java ReferenceIdentifier使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ReferenceIdentifier类属于org.opengis.referencing包,在下文中一共展示了ReferenceIdentifier类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCRSCode

import org.opengis.referencing.ReferenceIdentifier; //导入依赖的package包/类
/**
 * Gets the CRS code.
 *
 * @param coordinateReferenceSystem the coordinate reference system
 * @return the CRS code
 */
public String getCRSCode(CoordinateReferenceSystem coordinateReferenceSystem) {
    ReferenceIdentifier identifier = null;
    if (coordinateReferenceSystem != null) {
        Set<ReferenceIdentifier> indentifierList = coordinateReferenceSystem.getIdentifiers();

        if (indentifierList != null) {
            if (indentifierList.iterator().hasNext()) {
                identifier = indentifierList.iterator().next();
            }
        }
    }

    String code = NOT_SET_CRS;

    if (identifier != null) {
        ValueComboBoxData data = crsMap.get(identifier.toString());
        if (data != null) {
            code = data.getKey();
        }
    }
    return code;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:29,代码来源:CoordManager.java

示例2: haveCommonReferenceIdentifiers

import org.opengis.referencing.ReferenceIdentifier; //导入依赖的package包/类
private static boolean haveCommonReferenceIdentifiers(CoordinateReferenceSystem crs1, CoordinateReferenceSystem crs2) {
    Set<ReferenceIdentifier> identifiers1 = crs1.getIdentifiers();
    Set<ReferenceIdentifier> identifiers2 = crs2.getIdentifiers();
    // If a CRS does not have identifiers or if they have different number of identifiers
    // they cannot be equal.
    if (identifiers1 == null || identifiers1.isEmpty()
            || identifiers2 == null || identifiers2.isEmpty()
            || identifiers1.size() != identifiers2.size()) {
        return false;
    }
    // The two CRSs can only be equal if they have the same number of identifiers
    // and all of them are common to both.
    int eqCount = 0;
    for (ReferenceIdentifier refId1 : identifiers1) {
        for (ReferenceIdentifier refId2 : identifiers2) {
            if (compareRefIds(refId1, refId2)) {
                eqCount++;
                break;
            }
        }
    }
    return eqCount == identifiers1.size();
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:24,代码来源:ProductLayerAssistantPage.java

示例3: determineSourceEpsg

import org.opengis.referencing.ReferenceIdentifier; //导入依赖的package包/类
private int determineSourceEpsg(
		FeatureSource<SimpleFeatureType, SimpleFeature> source) {
	if (source != null) {
		try {
			Set<ReferenceIdentifier> identifiers = source.getSchema()
					.getCoordinateReferenceSystem().getIdentifiers();
			if (identifiers.size() > 0) {
				String code = identifiers.iterator().next().getCode();
				return Integer.valueOf(code);
			}

		} catch (RuntimeException e) {
			LOGGER.warn("Could not determine EPSG code from WFS DataSource.");
		}
	}
	return targetEpsg;
}
 
开发者ID:Geodan,项目名称:solr-dataimporthandler-wfs,代码行数:18,代码来源:WFSDataSource.java

示例4: getCRSIdentifier

import org.opengis.referencing.ReferenceIdentifier; //导入依赖的package包/类
private String getCRSIdentifier(CoordinateReferenceSystem coordinateReferenceSystem) {
    String name = "";
    if (coordinateReferenceSystem.getIdentifiers() == null) {
        name = coordinateReferenceSystem.getName().toString();
    } else {
        for (ReferenceIdentifier identifier : coordinateReferenceSystem.getIdentifiers()) {
            name = identifier.toString();
            break;
        }
    }
    return name;
}
 
开发者ID:stefan0722,项目名称:gs-mvt,代码行数:13,代码来源:SlippyTilesController.java

示例5: getProperties

import org.opengis.referencing.ReferenceIdentifier; //导入依赖的package包/类
/**
 * Fills a {@link SRSInit} object with the correct initialization values
 * needed by constructors (authority, description, srid).
 * 
 * Note: The method tries to retrieve as much information from the
 * {@link CoordinateReferenceSystem} <code>crs</code> as possible.
 * 
 * @param init Pass the {@link SRSInit} object to allow multiple return-values.
 * @param crs The {@link CoordinateReferenceSystem} where the information
 *            are retrieved from.
 */
private void getProperties(SRSInit init, CoordinateReferenceSystem crs) {
	// Try to find srid, authority and description from the CRS.
	// Abort if the correct EPSG identifiers were found.
	Set<ReferenceIdentifier> identifiers = crs.getIdentifiers();
	if (!identifiers.isEmpty()) {
		for (ReferenceIdentifier id : identifiers) {
			init.auth = Citations.getIdentifier(id.getAuthority());
			init.srid = id.getCode();
			try {					
				CRSAuthorityFactory factory = ReferencingFactoryFinder.getCRSAuthorityFactory(init.auth, HINTS);
				init.desc = factory.getDescriptionText(init.srid).toString();
				this.is_custom = false;
				break;
			} catch (Exception e) {
				this.is_custom = true;
			}
		}
	} else 
		this.is_custom = true;		

	// If this is not an EPSG spatial reference system, use WKT to describe it but get
	// as much information as possible about the SRS from the WKT.
	if (this.is_custom) {
		init.srid = Const.NVL(init.srid, Integer.toString(UNKNOWN_SRID));
		init.auth = Const.NVL(init.auth, "Custom Authority");
		init.desc = Const.NVL(init.desc, "Custom SRS from WKT");
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:40,代码来源:SRS.java

示例6: getSRID

import org.opengis.referencing.ReferenceIdentifier; //导入依赖的package包/类
protected static int getSRID(
		final SimpleFeature geometryFeature ) {
	final CoordinateReferenceSystem crs = geometryFeature
			.getDefaultGeometryProperty()
			.getDescriptor()
			.getCoordinateReferenceSystem();
	if (crs == null) {
		return 4326;
	}
	final ReferenceIdentifier id = getFirst(crs.getIdentifiers());
	if (id == null) {
		return 4326;
	}
	return Integer.parseInt(id.getCode());
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:16,代码来源:SimpleFeatureGeometryExtractor.java

示例7: getFirst

import org.opengis.referencing.ReferenceIdentifier; //导入依赖的package包/类
protected static final <T> ReferenceIdentifier getFirst(
		final Iterable<ReferenceIdentifier> iterable ) {
	if (iterable == null) {
		return null;
	}
	final Iterator<ReferenceIdentifier> it = iterable.iterator();
	if (it.hasNext()) {
		final ReferenceIdentifier id = it.next();
		if ("EPSG".equals(id.getCodeSpace())) {
			return id;
		}
	}
	return null;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:15,代码来源:SimpleFeatureGeometryExtractor.java

示例8: saveCustomizedCRS

import org.opengis.referencing.ReferenceIdentifier; //导入依赖的package包/类
/**
 * @param text
 * @param createdCRS
 * @throws CoreException
 * @throws IOException
 * @throws BackingStoreException
 */
private CoordinateReferenceSystem saveCustomizedCRS(final String text, final boolean processWKT,
		final CoordinateReferenceSystem createdCRS) throws CoreException, IOException, BackingStoreException {
	final Preferences root = Preferences.userRoot();
	final Preferences node = root.node(CUSTOM_ID);
	int lastID;
	String code;
	String name;
	String newWKT;
	if (processWKT) {
		lastID = Integer.parseInt(node.get(LAST_ID, "0")); //$NON-NLS-1$
		code = "UDIG:" + lastID; //$NON-NLS-1$
		name = createdCRS.getName().toString() + "(" + code + ")";//$NON-NLS-1$ //$NON-NLS-2$
		lastID++;
		node.putInt(LAST_ID, lastID);
		newWKT = processingWKT(text, lastID);
	} else {
		final Set<ReferenceIdentifier> ids = createdCRS.getIdentifiers();
		if (!ids.isEmpty()) {
			final Identifier id = ids.iterator().next();
			code = id.toString();
			name = createdCRS.getName().getCode() + " (" + code + ")"; //$NON-NLS-1$ //$NON-NLS-2$
		} else {
			name = code = createdCRS.getName().getCode();
		}

		newWKT = text;
	}

	final Preferences child = node.node(code);
	child.put(NAME_ID, name);
	child.put(WKT_ID, newWKT);
	final String[] keywords = keywordsText.getText().split(","); //$NON-NLS-1$
	if (keywords.length > 0) {
		final Preferences keyworkNode = child.node(ALIASES_ID);
		for (String string : keywords) {
			string = string.trim().toUpperCase();
			keyworkNode.put(string, string);
		}
	}
	node.flush();

	return createdCRS;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:51,代码来源:CRSChooser.java

示例9: compareRefIds

import org.opengis.referencing.ReferenceIdentifier; //导入依赖的package包/类
private static boolean compareRefIds(ReferenceIdentifier refId1, ReferenceIdentifier refId2) {
    return ObjectUtils.equalObjects(refId1.getCodeSpace(), refId2.getCodeSpace())
            && ObjectUtils.equalObjects(refId1.getCode(), refId2.getCode())
            && compareVersions(refId1.getVersion(), refId2.getVersion());
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:6,代码来源:ProductLayerAssistantPage.java

示例10: getName

import org.opengis.referencing.ReferenceIdentifier; //导入依赖的package包/类
@Override
public ReferenceIdentifier getName() {
	return identifier;
}
 
开发者ID:opengeospatial,项目名称:Java-OpenMobility,代码行数:5,代码来源:CoordinateReferenceSystemImpl.java

示例11: getIdentifiers

import org.opengis.referencing.ReferenceIdentifier; //导入依赖的package包/类
@Override
public Set<ReferenceIdentifier> getIdentifiers() {
	// TODO Auto-generated method stub
	return null;
}
 
开发者ID:opengeospatial,项目名称:Java-OpenMobility,代码行数:6,代码来源:CoordinateReferenceSystemImpl.java

示例12: getName

import org.opengis.referencing.ReferenceIdentifier; //导入依赖的package包/类
public ReferenceIdentifier getName() {
	return base.getName();
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:4,代码来源:GeneralDerivedCrsImpl.java

示例13: getIdentifiers

import org.opengis.referencing.ReferenceIdentifier; //导入依赖的package包/类
public Set<ReferenceIdentifier> getIdentifiers() {
	return base.getIdentifiers();
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:4,代码来源:GeneralDerivedCrsImpl.java

示例14: CoordinateReferenceSystemImpl

import org.opengis.referencing.ReferenceIdentifier; //导入依赖的package包/类
/** Construct a new CoordinateReferenceSystem with a ReferenceIdentifier<p>
 * Note this implementation is only really a place holder to allow for codes to 
 * be specified when building {@linkplain GeometryTypeImpl} - Only the {@link #getName()}
 * method returns other than {@code null}
 * 
 * @param identifier If {@code null} then a new ReferenceIdentifier set to
 * EPSG:4326 is created.
 */
public CoordinateReferenceSystemImpl(ReferenceIdentifier identifier) {
	if (identifier==null) {
		identifier = new ReferenceIdentifierImpl("4326", "EPSG", "1");
	}
	this.identifier = identifier;
}
 
开发者ID:opengeospatial,项目名称:Java-OpenMobility,代码行数:15,代码来源:CoordinateReferenceSystemImpl.java


注:本文中的org.opengis.referencing.ReferenceIdentifier类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。