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


Java FeatureCollection.setFeatures方法代码示例

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


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

示例1: execute

import org.geojson.FeatureCollection; //导入方法依赖的package包/类
@Nonnull
public FeatureCollection execute(final Set<Long> zoneIds, final GISUtils.SRID srid, final double simplifyAmount) {
    final FeatureCollection featureCollection = new FeatureCollection();
    featureCollection.setCrs(srid.getGeoJsonCrs());

    if (zoneIds.isEmpty()) {
        return featureCollection;
    }

    final MapSqlParameterSource params = new MapSqlParameterSource()
            .addValue("zoneIds", zoneIds)
            .addValue("crs", srid.getValue())
            .addValue("simplify", simplifyAmount);

    final List<Feature> features = jdbcOperations.query(SQL, params, (rs, i) -> mapResultToFeature(rs));

    if (features != null) {
        featureCollection.setFeatures(features);
    }

    return featureCollection;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:23,代码来源:GetCombinedFeatureCollectionQuery.java

示例2: execute

import org.geojson.FeatureCollection; //导入方法依赖的package包/类
public FeatureCollection execute(final long zoneId, final GISUtils.SRID srid) {
    final MapSqlParameterSource params = new MapSqlParameterSource()
            .addValue("zoneId", zoneId)
            .addValue("crs", srid.getValue());

    final List<Feature> features = jdbcOperations.query(SQL, params, (resultSet, i) -> {
        final Feature feature = new Feature();
        feature.setId(Long.toString(zoneId));
        feature.setProperty(GeoJSONConstants.PROPERTY_NUMBER, resultSet.getString("property_identifier"));
        feature.setGeometry(GISUtils.parseGeoJSONGeometry(objectMapper, resultSet.getString("geom")));

        return feature;
    });

    final FeatureCollection featureCollection = new FeatureCollection();

    if (features != null) {
        featureCollection.setFeatures(features);
    }

    return featureCollection;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:23,代码来源:GetExternalFeatureCollectionQuery.java

示例3: report

import org.geojson.FeatureCollection; //导入方法依赖的package包/类
@Transactional(readOnly = true)
public FeatureCollection report(int year) {
    if (year < MIN_YEAR || year > MAX_YEAR) {
        throw new IllegalArgumentException("Year must be between" + MIN_YEAR + " and " + MAX_YEAR);
    }

    List<Feature> features = jdbcTemplate.query(SQL, getSqlParameterSource(year, "209"), new RowMapper<Feature>() {
        private final ObjectMapper objectMapper = new ObjectMapper();

        @Override
        public Feature mapRow(ResultSet rs, int rowNum) throws SQLException {
            Feature feature = new Feature();
            feature.getProperties().put("day", rs.getString("day"));
            feature.getProperties().put("gender", rs.getString("gender"));
            feature.getProperties().put("age", rs.getString("age"));
            feature.getProperties().put("luke_status", rs.getString("luke_status"));
            feature.getProperties().put("rhy_code", rs.getString("rhy_code"));
            feature.getProperties().put("rhy_fi", rs.getString("rhy_fi"));
            feature.getProperties().put("rhy_sv", rs.getString("rhy_sv"));
            try {
                feature.setGeometry(objectMapper.readValue(rs.getString("geom"), GeoJsonObject.class));
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return feature;
        }
    });

    FeatureCollection featureCollection = new FeatureCollection();
    featureCollection.setFeatures(features);

    Crs crs = new Crs();
    crs.getProperties().put("name", "urn:ogc:def:crs:EPSG::3067");

    featureCollection.setCrs(crs);

    return featureCollection;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:39,代码来源:PublicWolfReportFeature.java

示例4: exportClubAreaFeatures

import org.geojson.FeatureCollection; //导入方法依赖的package包/类
private FeatureCollection exportClubAreaFeatures(Locale locale, GISZone zone, LocalisedString areaName, LocalisedString clubName, Date modificationTime) {
    final LocalDateTime saveDateTime = DateUtil.toLocalDateTimeNullSafe(modificationTime);
    final String saveDate = DTF.print(saveDateTime);

    final double[] bbox = gisZoneRepository.getBounds(zone.getId(), GISUtils.SRID.ETRS_TM35FIN);

    final GeometryAndSize geometryAndSize = getZoneFeature(zone.getId());

    final Feature feature = new Feature();
    feature.setGeometry(geometryAndSize.geom);
    feature.setProperty("clubName", clubName.getAnyTranslation(locale));
    feature.setProperty("saveDate", i18n("saveDate", locale) + " " + saveDate);
    feature.setProperty("areaName", i18n("areaName", locale) + " " + areaName.getAnyTranslation(locale));
    feature.setProperty("areaSize", formatAreaSize(locale, "totalAreaSize", geometryAndSize.totalAreaSize) + " " +
            formatAreaSize(locale, "landAreaSize", geometryAndSize.landAreaSize) + " " +
            formatAreaSize(locale, "waterAreaSize", geometryAndSize.waterAreaSize));
    feature.setProperty("fill", "rgb(0, 192, 60)");
    feature.setProperty("fill-opacity", 0.3);
    feature.setProperty("stroke-width", 3.0);
    feature.setProperty("stroke", "rgb(0,0,0)");

    final FeatureCollection featureCollection = new FeatureCollection();
    featureCollection.setCrs(GISUtils.SRID.ETRS_TM35FIN.getGeoJsonCrs());
    featureCollection.setBbox(bbox);
    featureCollection.setFeatures(ImmutableList.of(feature));

    return featureCollection;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:29,代码来源:AreaPrintFeature.java

示例5: query

import org.geojson.FeatureCollection; //导入方法依赖的package包/类
private FeatureCollection query(final String sql, MapSqlParameterSource parameterSource) {
    final FeatureCollection featureCollection = new FeatureCollection();

    featureCollection.setFeatures(jdbcTemplate.query(sql, parameterSource, ROW_MAPPER));

    final Crs crs = new Crs();
    crs.getProperties().put("name", "urn:ogc:def:crs:EPSG::4326");
    featureCollection.setCrs(crs);

    return featureCollection;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:12,代码来源:GISPropertyGeometryRepository.java

示例6: execute

import org.geojson.FeatureCollection; //导入方法依赖的package包/类
public FeatureCollection execute(final Long zoneId, final GISUtils.SRID srid) {
    final MapSqlParameterSource params = new MapSqlParameterSource()
            .addValue("zoneId", zoneId)
            .addValue("crs", srid.getValue());

    final List<Feature> features = jdbcOperations.query(SQL, params, (rs, i) -> mapResultToFeature(rs));
    final FeatureCollection featureCollection = new FeatureCollection();

    if (features != null) {
        featureCollection.setFeatures(features);
    }

    return featureCollection;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:15,代码来源:GetPalstaFeatureCollectionQuery.java


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