• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Identifier类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: isInCodeMap

import org.opengis.metadata.Identifier; //导入依赖的package包/类
private boolean isInCodeMap(final Identifier identifier, final String item) {

		final String name = crsCodeMap.get(identifier.getCode());
		if (name == null)
			return false;
		return name.equals(item);
	}
 
开发者ID:gama-platform,项目名称:gama,代码行数:8,代码来源:CRSChooser.java


示例2: printIdentifierStuff

import org.opengis.metadata.Identifier; //导入依赖的package包/类
/**
 * Print out information about an identified object
 */
// START SNIPPET: identifiedObject
void printIdentifierStuff(IdentifiedObject identObj) {
    System.out.println("  getName().getCode() - " + identObj.getName().getCode());
    System.out.println("  getName().getAuthority() - " + identObj.getName().getAuthority());
    System.out.println("  getRemarks() - " + identObj.getRemarks());
    System.out.println("  getAliases():");
    Iterator<GenericName> aliases = identObj.getAlias().iterator();
    if (!aliases.hasNext()) {
        System.out.println("    no aliases");
    } else {
        for (int i = 0; aliases.hasNext(); i++) {
            System.out.println("    alias(" + i + "): " + (GenericName) aliases.next());
        }
    }
    
    System.out.println("  getIdentifiers():");
    // Identifier[]
    Iterator<? extends Identifier> idents = identObj.getIdentifiers().iterator();
    if (!idents.hasNext()) {
        System.out.println("    no extra identifiers");
    } else {
        for (int i = 0; idents.hasNext(); i++) {
            Identifier ident = idents.next();
            System.out.println("    identifier(" + i + ").getCode() - " + ident.getCode());
            System.out
                    .println("    identifier(" + i + ").getAuthority() - " + ident.getAuthority());
        }
    }
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:33,代码来源:ReferencingExamples.java


示例3: getName

import org.opengis.metadata.Identifier; //导入依赖的package包/类
public Identifier getName() {
    throw new UnsupportedOperationException();
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:4,代码来源:GeographicCRS.java


示例4: getName

import org.opengis.metadata.Identifier; //导入依赖的package包/类
public final Identifier getName() {
    return _name;
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:4,代码来源:CoordinateReferenceSystem.java


示例5: gotoCRS

import org.opengis.metadata.Identifier; //导入依赖的package包/类
/**
 * Takes in a CRS, finds it in the list and highlights it
 * 
 * @param crs
 */
@SuppressWarnings("unchecked")
public void gotoCRS(final CoordinateReferenceSystem crs) {
	if (crs != null) {
		final List list = codesList.getList();
		final Set<Identifier> identifiers = new HashSet<Identifier>(crs.getIdentifiers());

		final Set<Integer> candidates = new HashSet<Integer>();

		for (int i = 0; i < list.getItemCount(); i++) {
			for (final Identifier identifier : identifiers) {
				final String item = list.getItem(i);
				if (sameEPSG(crs, identifier, item) || exactMatch(crs, identifier, item)) {
					codesList.setSelection(new StructuredSelection(item), false);
					list.setTopIndex(i);
					return;
				}
				if (isMatch(crs, identifier, item)) {
					candidates.add(i);
				}
			}
		}
		if (candidates.isEmpty()) {
			final java.util.List<String> input = (java.util.List<String>) codesList.getInput();
			final String sourceCRSName = crs.getName().toString();
			sourceCRS = crs;
			input.add(0, sourceCRSName);
			codesList.setInput(input);
			codesList.setSelection(new StructuredSelection(sourceCRSName), false);
			list.setTopIndex(0);
			try {
				final String toWKT = crs.toWKT();
				wktText.setText(toWKT);
			} catch (final RuntimeException e) {
				ExceptionMonitor.show(wktText.getShell(), e, crs.toString() + " cannot be formatted as WKT"); //$NON-NLS-1$
				wktText.setText("Unknown/Illegal WKT");
			}
		} else {
			final Integer next = candidates.iterator().next();
			codesList.setSelection(new StructuredSelection(list.getItem(next)), false);
			list.setTopIndex(next);

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


示例6: exactMatch

import org.opengis.metadata.Identifier; //导入依赖的package包/类
private boolean exactMatch(final CoordinateReferenceSystem crs, final Identifier identifier, final String item) {
	return crs == DefaultGeographicCRS.WGS84 && item.equals("WGS 84 (4326)") || //$NON-NLS-1$
			item.equalsIgnoreCase(identifier.toString()) || isInCodeMap(identifier, item);
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:5,代码来源:CRSChooser.java


示例7: sameEPSG

import org.opengis.metadata.Identifier; //导入依赖的package包/类
private boolean sameEPSG(final CoordinateReferenceSystem crs, final Identifier identifier, final String item) {
	final String toString = identifier.toString();
	return toString.contains("EPSG:") && item.contains(toString); //$NON-NLS-1$
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:5,代码来源:CRSChooser.java


示例8: isMatch

import org.opengis.metadata.Identifier; //导入依赖的package包/类
private boolean isMatch(final CoordinateReferenceSystem crs, final Identifier identifier, final String item) {
	return crs == DefaultGeographicCRS.WGS84 && item.contains("4326") || item.contains(identifier.toString()); //$NON-NLS-1$
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:4,代码来源:CRSChooser.java


示例9: getCRS

import org.opengis.metadata.Identifier; //导入依赖的package包/类
/**
 * returns the selected CRS
 * 
 * @return selected CRS
 */
public CoordinateReferenceSystem getCRS() {
	if (folder == null)
		return selectedCRS;
	if (folder.getSelectionIndex() == 1) {
		try {
			final String text = wktText.getText();
			final CoordinateReferenceSystem createdCRS = ReferencingFactoryFinder.getCRSFactory(null)
					.createFromWKT(text);

			if (keywordsText.getText().trim().length() > 0) {
				final Preferences node = findNode(createdCRS.getName().getCode());
				if (node != null) {
					final Preferences kn = node.node(ALIASES_ID);
					final String[] keywords = keywordsText.getText().split(","); //$NON-NLS-1$
					kn.clear();
					for (String string : keywords) {
						string = string.trim().toUpperCase();
						if (string.length() > 0)
							kn.put(string, string);
					}
					kn.flush();
				} else {
					CoordinateReferenceSystem found = createCRS(createdCRS.getName().getCode());
					if (found != null && CRS.findMathTransform(found, createdCRS, true).isIdentity()) {
						saveKeywords(found);
						return found;
					}

					final Set<Identifier> identifiers = new HashSet<Identifier>(createdCRS.getIdentifiers());
					for (final Identifier identifier : identifiers) {
						found = createCRS(identifier.toString());
						if (found != null && CRS.findMathTransform(found, createdCRS, true).isIdentity()) {
							saveKeywords(found);
							return found;
						}
					}
					return saveCustomizedCRS(text, true, createdCRS);
				}
			}

			return createdCRS;
		} catch (final Exception e) {
			ExceptionMonitor.show(wktText.getShell(), e);
		}
	}
	if (selectedCRS == null) {
		final String crsCode = (String) ((IStructuredSelection) codesList.getSelection()).getFirstElement();
		if (sourceCRS != null && crsCode.equals(sourceCRS.getName().toString())) {
			// System.out.println("source crs: " +
			// sourceCRS.getName().toString());
			return sourceCRS;
		}
		return createCRS(searchText.getText());
	}
	return selectedCRS;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:62,代码来源:CRSChooser.java


示例10: saveCustomizedCRS

import org.opengis.metadata.Identifier; //导入依赖的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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JobEntryXMLWellFormed类代码示例发布时间:2022-05-22
下一篇:
Java JpsModulePropertiesSerializer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap