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


Java Occurrence.getDecimalLongitude方法代码示例

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


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

示例1: OccurrenceWritable

import org.gbif.api.model.occurrence.Occurrence; //导入方法依赖的package包/类
public OccurrenceWritable(Occurrence occ, Integer cnt) {
  taxonKey = occ.getTaxonKey();
  ClassificationUtils.copyLinneanClassificationKeys(occ, this);
  year = occ.getYear();
  count = cnt;
  pubOrgKey = occ.getPublishingOrgKey();
  datasetKey = occ.getDatasetKey();
  latitude = occ.getDecimalLatitude();
  longitude = occ.getDecimalLongitude();
  country = occ.getCountry();
  publishingCountry = occ.getPublishingCountry();
  basisOfRecord = occ.getBasisOfRecord();
  protocol = occ.getProtocol();
  issues = occ.getIssues();
}
 
开发者ID:gbif,项目名称:metrics,代码行数:16,代码来源:OccurrenceWritable.java

示例2: cubeMutations

import org.gbif.api.model.occurrence.Occurrence; //导入方法依赖的package包/类
/**
 * For the given occurrence, determines the mutations (addresses and operations) that need
 * to be applied.
 * 
 * @param o The denormalized representation
 * @param op That is going to be applied to the cube
 * @return The batch of updates to apply
 */
public static Batch<DensityTile> cubeMutations(Occurrence o, Op op, int zoom, int pixelsPerCluster) {
  Double latitude = o.getDecimalLatitude();
  Double longitude = o.getDecimalLongitude();
  Batch<DensityTile> batch = new Batch<DensityTile>();

  if (!o.hasSpatialIssue() && MercatorProjectionUtil.isPlottable(latitude, longitude)) {
    Set<Integer> taxa =
      Sets.newHashSet(o.getKingdomKey(), o.getPhylumKey(), o.getClassKey(), o.getOrderKey(), o.getFamilyKey(),
        o.getGenusKey(), o.getSpeciesKey(), o.getTaxonKey());

    // locate the tile
    int tileX = MercatorProjectionUtil.toTileX(o.getDecimalLongitude(), zoom);
    int tileY = MercatorProjectionUtil.toTileY(o.getDecimalLatitude(), zoom);


    for (Integer id : taxa) {
      if (id != null) {
        addMutations(batch, TileContentType.TAXON, String.valueOf(id), tileX, tileY, zoom, pixelsPerCluster, op, o);
      }
    }
    if (o.getPublishingOrgKey() != null) {
      addMutations(batch, TileContentType.PUBLISHER, String.valueOf(o.getPublishingOrgKey()), tileX, tileY, zoom,
        pixelsPerCluster, op, o);
    }
    if (o.getDatasetKey() != null) {
      addMutations(batch, TileContentType.DATASET, String.valueOf(o.getDatasetKey()), tileX, tileY, zoom,
        pixelsPerCluster, op, o);
    }
    if (o.getCountry() != null) {
      addMutations(batch, TileContentType.COUNTRY, o.getCountry().getIso2LetterCode(), tileX, tileY, zoom,
        pixelsPerCluster, op, o);
    }
    if (o.getPublishingCountry() != null) {
      addMutations(batch, TileContentType.PUBLISHING_COUNTRY, o.getPublishingCountry().getIso2LetterCode(), tileX,
        tileY, zoom,
        pixelsPerCluster, op, o);
    }
  }
  return batch;
}
 
开发者ID:gbif,项目名称:metrics,代码行数:49,代码来源:DensityCubeUtil.java

示例3: addGeoreferencingDimension

import org.gbif.api.model.occurrence.Occurrence; //导入方法依赖的package包/类
private static WriteBuilder addGeoreferencingDimension(WriteBuilder wb, Occurrence occurrence) {
  return (occurrence.getDecimalLatitude() != null && occurrence.getDecimalLongitude() != null && !occurrence
    .hasSpatialIssue()) ?
    wb.at(IS_GEOREFERENCED, true) : wb.at(IS_GEOREFERENCED, false);
}
 
开发者ID:gbif,项目名称:metrics,代码行数:6,代码来源:OccurrenceAddressUtil.java

示例4: buildOccSolrDocument

import org.gbif.api.model.occurrence.Occurrence; //导入方法依赖的package包/类
/**
 * Populates the Solr document using the occurrence object.
 */
private static SolrInputDocument buildOccSolrDocument(Occurrence occurrence) {
  SolrInputDocument doc = new SolrInputDocument();
  Double latitude = occurrence.getDecimalLatitude();
  Double longitude = occurrence.getDecimalLongitude();

  doc.setField(KEY.getFieldName(), occurrence.getKey());
  doc.setField(YEAR.getFieldName(), occurrence.getYear());
  doc.setField(MONTH.getFieldName(), occurrence.getMonth());
  doc.setField(BASIS_OF_RECORD.getFieldName(),
               occurrence.getBasisOfRecord() == null ? null : occurrence.getBasisOfRecord().name());
  doc.setField(CATALOG_NUMBER.getFieldName(), occurrence.getVerbatimField(DwcTerm.catalogNumber));
  doc.setField(RECORDED_BY.getFieldName(), occurrence.getVerbatimField(DwcTerm.recordedBy));
  doc.setField(TYPE_STATUS.getFieldName(),
               occurrence.getTypeStatus() == null ? null : occurrence.getTypeStatus().name());
  doc.setField(RECORD_NUMBER.getFieldName(), occurrence.getVerbatimField(DwcTerm.recordNumber));
  doc.setField(COUNTRY.getFieldName(),
               occurrence.getCountry() == null ? null : occurrence.getCountry().getIso2LetterCode());
  doc.setField(PUBLISHING_COUNTRY.getFieldName(),
               occurrence.getPublishingCountry() == null
                 ? null
                 : occurrence.getPublishingCountry().getIso2LetterCode());
  doc.setField(CONTINENT.getFieldName(), occurrence.getContinent() == null ? null : occurrence.getContinent().name());
  doc.setField(DATASET_KEY.getFieldName(), occurrence.getDatasetKey().toString());
  Set<Integer> taxonKey = buildTaxonKey(occurrence);
  if (!taxonKey.isEmpty()) {
    doc.setField(TAXON_KEY.getFieldName(), taxonKey);
  } else {
    doc.setField(TAXON_KEY.getFieldName(), null);
  }
  doc.setField(KINGDOM_KEY.getFieldName(), occurrence.getKingdomKey());
  doc.setField(PHYLUM_KEY.getFieldName(), occurrence.getPhylumKey());
  doc.setField(CLASS_KEY.getFieldName(), occurrence.getClassKey());
  doc.setField(ORDER_KEY.getFieldName(), occurrence.getOrderKey());
  doc.setField(FAMILY_KEY.getFieldName(), occurrence.getFamilyKey());
  doc.setField(GENUS_KEY.getFieldName(), occurrence.getGenusKey());
  doc.setField(SUBGENUS_KEY.getFieldName(), occurrence.getSubgenusKey());
  doc.setField(SPECIES_KEY.getFieldName(), occurrence.getSpeciesKey());
  doc.setField(ELEVATION.getFieldName(), occurrence.getElevation());
  doc.setField(DEPTH.getFieldName(), occurrence.getDepth());
  doc.setField(INSTITUTION_CODE.getFieldName(), occurrence.getVerbatimField(DwcTerm.institutionCode));
  doc.setField(COLLECTION_CODE.getFieldName(), occurrence.getVerbatimField(DwcTerm.collectionCode));
  doc.setField(SPATIAL_ISSUES.getFieldName(), occurrence.hasSpatialIssue());
  doc.setField(LATITUDE.getFieldName(), latitude);
  doc.setField(LONGITUDE.getFieldName(), longitude);
  doc.setField(HAS_COORDINATE.getFieldName(), latitude != null && longitude != null);
  doc.setField(EVENT_DATE.getFieldName(),
               occurrence.getEventDate() != null ? toDateQueryFormat(occurrence.getEventDate()) : null);
  doc.setField(LAST_INTERPRETED.getFieldName(),
               occurrence.getLastInterpreted() != null ? toDateQueryFormat(occurrence.getLastInterpreted()) : null);
  if (isValidCoordinate(latitude, longitude)) {
    doc.setField(COORDINATE.getFieldName(), COORD_JOINER.join(latitude, longitude));
  } else {
    doc.setField(COORDINATE.getFieldName(), null);
  }
  doc.setField(MEDIA_TYPE.getFieldName(), buildMediaType(occurrence));
  doc.setField(ISSUE.getFieldName(), buildIssue(occurrence.getIssues()));
  doc.setField(ESTABLISHMENT_MEANS.getFieldName(),
               occurrence.getEstablishmentMeans() == null ? null : occurrence.getEstablishmentMeans().name());
  doc.setField(OCCURRENCE_ID.getFieldName(), occurrence.getVerbatimField(DwcTerm.occurrenceID));
  doc.setField(FULL_TEXT.getFieldName(), FullTextFieldBuilder.buildFullTextField(occurrence));
  doc.setField(REPATRIATED.getFieldName(),isRepatriated(occurrence).orNull());
  doc.setField(ORGANISM_ID.getFieldName(), occurrence.getVerbatimField(DwcTerm.organismID));
  doc.setField(STATE_PROVINCE.getFieldName(), occurrence.getStateProvince());
  doc.setField(WATER_BODY.getFieldName(), occurrence.getWaterBody());
  doc.setField(LOCALITY.getFieldName(), occurrence.getVerbatimField(DwcTerm.locality));
  doc.setField(PROTOCOL.getFieldName(), occurrence.getProtocol() == null ? null : occurrence.getProtocol().name());
  doc.setField(CRAWL_ID.getFieldName(), occurrence.getCrawlId() == null ? null : occurrence.getCrawlId());
  doc.setField(PUBLISHING_ORGANIZATION_KEY.getFieldName(),
               occurrence.getPublishingOrgKey() == null ? null : occurrence.getPublishingOrgKey().toString());
  doc.setField(LICENSE.getFieldName(), occurrence.getLicense() == null ? null : occurrence.getLicense().name());

  return doc;
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:77,代码来源:SolrOccurrenceWriter.java


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