
org.geomajas.rest.server.GeoToolsConverterServiceImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geomajas-face-rest Show documentation
Show all versions of geomajas-face-rest Show documentation
Geomajas server: REST - Implementation
The newest version!
/*
* This is part of Geomajas, a GIS framework, http://www.geomajas.org/.
*
* Copyright 2008-2016 Geosparc nv, http://www.geosparc.com/, Belgium.
*
* The program is available in open source according to the GNU Affero
* General Public License. All contributions in this program are covered
* by the Geomajas Contributors License Agreement. For full licensing
* details, see LICENSE.txt in the project root.
*/
package org.geomajas.rest.server;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.vividsolutions.jts.geom.LineString;
import com.vividsolutions.jts.geom.MultiLineString;
import com.vividsolutions.jts.geom.MultiPolygon;
import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.geom.Polygon;
import org.geomajas.configuration.AbstractAttributeInfo;
import org.geomajas.configuration.PrimitiveAttributeInfo;
import org.geomajas.configuration.SyntheticAttributeInfo;
import org.geomajas.configuration.VectorLayerInfo;
import org.geomajas.layer.LayerException;
import org.geomajas.layer.feature.Attribute;
import org.geomajas.layer.feature.InternalFeature;
import org.geomajas.service.GeoService;
import org.geotools.feature.simple.SimpleFeatureBuilder;
import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.feature.type.AttributeDescriptor;
import org.opengis.geometry.aggregate.MultiPoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.vividsolutions.jts.geom.Geometry;
/**
* Service to convert from Geomajas to GeoTools objects.
*
* @author Oliver May
* @author Jan De Moerloose
*/
@Component
public class GeoToolsConverterServiceImpl implements GeoToolsConverterService {
private static final String NAMESPACE_URI = "http://www.geomajas.org";
private final Logger log = LoggerFactory.getLogger(GeoToolsConverterServiceImpl.class);
@Autowired
private GeoService geoservice;
@Override
public SimpleFeatureType toSimpleFeatureType(VectorLayerInfo vectorLayerInfo) throws LayerException {
return toSimpleFeatureType(vectorLayerInfo, null);
}
@Override
public SimpleFeature toSimpleFeature(InternalFeature feature, SimpleFeatureType featureType) {
SimpleFeatureBuilder builder = new SimpleFeatureBuilder(featureType);
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy