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


Java Occurrence.setDecimalLongitude方法代码示例

本文整理汇总了Java中org.gbif.api.model.occurrence.Occurrence.setDecimalLongitude方法的典型用法代码示例。如果您正苦于以下问题:Java Occurrence.setDecimalLongitude方法的具体用法?Java Occurrence.setDecimalLongitude怎么用?Java Occurrence.setDecimalLongitude使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.gbif.api.model.occurrence.Occurrence的用法示例。


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

示例1: buildOccurrence

import org.gbif.api.model.occurrence.Occurrence; //导入方法依赖的package包/类
private static Occurrence buildOccurrence(UUID datasetKey, UUID ook) {
  Occurrence occ1 = new Occurrence();
  occ1.setKey(1);
  occ1.setDatasetKey(datasetKey);
  occ1.setPublishingOrgKey(ook);
  occ1.setBasisOfRecord(BasisOfRecord.FOSSIL_SPECIMEN);
  occ1.setKingdomKey(1);
  occ1.setPhylumKey(1);
  occ1.setClassKey(1);
  occ1.setOrderKey(1);
  occ1.setFamilyKey(1);
  occ1.setGenusKey(1);
  occ1.setSpeciesKey(1);
  occ1.setScientificName("Ursus horribilis");
  occ1.addIssue(OccurrenceIssue.COUNTRY_COORDINATE_MISMATCH);
  occ1.setDecimalLatitude(1.234);
  occ1.setDecimalLongitude(4.567);
  occ1.setCountry(Country.AFGHANISTAN);
  occ1.setPublishingCountry(Country.CANADA);
  occ1.setProtocol(EndpointType.BIOCASE);

  return occ1;
}
 
开发者ID:gbif,项目名称:metrics,代码行数:24,代码来源:OccurrenceComparisonUtilTest.java

示例2: occurrenceOf

import org.gbif.api.model.occurrence.Occurrence; //导入方法依赖的package包/类
private Occurrence occurrenceOf(
  Integer key, Integer kingdom, Integer phylum, Integer classs, Integer order, Integer family, Integer genus,
  Integer species, Integer nub,
  UUID dataset, BasisOfRecord bor, Country country, Integer year, Double latitude, Double longitude,
  EndpointType protocol) {
  Occurrence occ = new Occurrence();
  occ.setKey(key);
  occ.setKingdomKey(kingdom);
  occ.setPhylumKey(phylum);
  occ.setClassKey(classs);
  occ.setOrderKey(order);
  occ.setFamilyKey(family);
  occ.setGenusKey(genus);
  occ.setSpeciesKey(species);
  occ.setTaxonKey(nub);
  occ.setDatasetKey(dataset);
  occ.setBasisOfRecord(bor);
  occ.setCountry(country);
  occ.setYear(year);
  occ.setDecimalLatitude(latitude);
  occ.setDecimalLongitude(longitude);
  occ.setProtocol(protocol);

  return occ;
}
 
开发者ID:gbif,项目名称:metrics,代码行数:26,代码来源:OccurrenceCubeTest.java

示例3: interpretCoordinates

import org.gbif.api.model.occurrence.Occurrence; //导入方法依赖的package包/类
private void interpretCoordinates(VerbatimOccurrence verbatim, Occurrence occ, Country country) {
  OccurrenceParseResult<CoordinateResult> parsedCoord = coordinateInterpreter.interpretCoordinate(
          verbatim.getVerbatimField(DwcTerm.decimalLatitude), verbatim.getVerbatimField(DwcTerm.decimalLongitude),
          verbatim.getVerbatimField(DwcTerm.geodeticDatum), country);

  if (!parsedCoord.isSuccessful() && verbatim.hasVerbatimField(DwcTerm.verbatimLatitude)
      && verbatim.hasVerbatimField(DwcTerm.verbatimLongitude)) {
    LOG.debug("Decimal coord interpretation, trying verbatim lat/lon");
    // try again with verbatim lat/lon
    parsedCoord = coordinateInterpreter.interpretCoordinate(verbatim.getVerbatimField(DwcTerm.verbatimLatitude),
                                                            verbatim.getVerbatimField(DwcTerm.verbatimLongitude),
                                                            verbatim.getVerbatimField(DwcTerm.geodeticDatum),country);
  }

  if (!parsedCoord.isSuccessful() && verbatim.hasVerbatimField(DwcTerm.verbatimCoordinates)) {
    LOG.debug("Verbatim lat/lon interpretation, trying single verbatimCoordinates");
    // try again with verbatim coordinates
    parsedCoord = coordinateInterpreter.interpretCoordinate(verbatim.getVerbatimField(DwcTerm.verbatimCoordinates),
                                                            verbatim.getVerbatimField(DwcTerm.geodeticDatum),country);
  }

  if (parsedCoord.isSuccessful() && parsedCoord.getPayload() != null) {
    occ.setDecimalLatitude(parsedCoord.getPayload().getLatitude());
    occ.setDecimalLongitude(parsedCoord.getPayload().getLongitude());

    // If the country returned by the co-ordinate interpreter is different, then it's an acceptable
    // swap (e.g. Réunion→France).
    if (country == null || (country != parsedCoord.getPayload().getCountry())) {
      LOG.debug("Swapping provided {} for georeferenced {}", country, parsedCoord.getPayload().getCountry());
      occ.setCountry(parsedCoord.getPayload().getCountry());
    }

    // interpret coordinateUncertaintyInMeters and coordinatePrecision
    interpretCoordinateUncertaintyAndPrecision(occ, verbatim);
  }

  LOG.debug("Adding coord issues to occ [{}]", parsedCoord.getIssues());
  occ.getIssues().addAll(parsedCoord.getIssues());
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:40,代码来源:LocationInterpreter.java

示例4: buildTestOccurrence

import org.gbif.api.model.occurrence.Occurrence; //导入方法依赖的package包/类
private Occurrence buildTestOccurrence(){
  Date now = new Date();
  Occurrence occurrence = new Occurrence();
  occurrence.setKey(1227769253);
  occurrence.setDatasetKey(UUID.fromString("50c9509d-22c7-4a22-a47d-8c48425ef4a7"));

  occurrence.setPublishingOrgKey(UUID.fromString("28eb1a3f-1c15-4a95-931a-4af90ecb574d"));
  occurrence.setPublishingCountry(Country.UNITED_STATES);
  occurrence.setProtocol(EndpointType.DWC_ARCHIVE);
  occurrence.setLastCrawled(now);
  occurrence.setLastParsed(now);
  occurrence.setBasisOfRecord(BasisOfRecord.HUMAN_OBSERVATION);
  occurrence.setTaxonKey(6505602);
  occurrence.setKingdomKey(1);
  occurrence.setPhylumKey(52);
  occurrence.setClassKey(225);
  occurrence.setOrderKey(982);
  occurrence.setFamilyKey(2693);
  occurrence.setGenusKey(2305748);
  occurrence.setSpeciesKey(6505602);
  occurrence.setScientificName("Columbella fuscata G.B. Sowerby I, 1832");
  occurrence.setKingdom("Animalia");
  occurrence.setPhylum("Mollusca");
  occurrence.setOrder("Neogastropoda");
  occurrence.setFamily("Columbellidae");
  occurrence.setGenus("Columbella");
  occurrence.setSpecies("Columbella fuscata");
  occurrence.setGenericName("Columbella");
  occurrence.setSpecificEpithet("fuscata");
  occurrence.setTaxonRank(Rank.SPECIES);
  occurrence.setDateIdentified(now);
  occurrence.setDecimalLongitude(-110.32959d);
  occurrence.setDecimalLatitude(24.32329d);
  occurrence.setYear(2016);
  occurrence.setMonth(1);
  occurrence.setDay(2);
  Map<Term,String> verbatimFields = new HashMap<>();
  verbatimFields.put(DwcTerm.geodeticDatum,"WGS84");
  verbatimFields.put(DwcTerm.class_,"Gastropoda");
  verbatimFields.put(DwcTerm.countryCode,"MX");
  verbatimFields.put(DwcTerm.country, "Mexico");
  verbatimFields.put(DcTerm.rightsHolder, "Alison Young");
  verbatimFields.put(DcTerm.identifier, "2544088");
  verbatimFields.put(DwcTerm.verbatimEventDate, "2016-01-01 15:28:43");
  verbatimFields.put(DwcTerm.datasetName, "iNaturalist research-grade observations");
  verbatimFields.put(GbifTerm.gbifID, "1227769253");
  verbatimFields.put(DwcTerm.verbatimLocality, "La Paz, Baja California Sur, México");
  verbatimFields.put(DwcTerm.collectionCode, "Observations");
  verbatimFields.put(DwcTerm.occurrenceID, "http://www.inaturalist.org/observations/2544088");
  verbatimFields.put(DwcTerm.taxonID, "328630");
  verbatimFields.put(DwcTerm.recordedBy, "Alison Young");
  verbatimFields.put(DwcTerm.catalogNumber, "2544088");
  verbatimFields.put(DwcTerm.institutionCode, "iNaturalist");
  verbatimFields.put(DcTerm.rights, "Copyright Alison Young, licensed under a Creative Commons cc_by_nc_sa_name license: http://creativecommons.org/licenses/by-nc-sa/3.0/");
  verbatimFields.put(DwcTerm.eventTime, "23:28:43Z");
  verbatimFields.put(DwcTerm.identificationID, "4737209");
  occurrence.setVerbatimFields(verbatimFields);
  return occurrence;
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:60,代码来源:FullTextFieldBuilderTest.java


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