Package org.opengis.feature.type

Examples of org.opengis.feature.type.GeometryType


             
              while (featureIterator.hasNext())
              {
                SimpleFeature feature = featureIterator.next();
   
                GeometryType geomType = feature.getFeatureType().getGeometryDescriptor().getType();
               
                // handle appropriate shape/upload type
                if(gisUpload.type == GisUploadType.ROUTES)
                { 
                  if(geomType.getBinding() != MultiLineString.class)
                  {
                    Logger.error("Unexpected geometry type: ", geomType);
                    continue;
                  }
               
                  MultiLineString multiLineString = (MultiLineString)JTS.transform((Geometry)feature.getDefaultGeometry(), transform);
                 
               
                  GisRoute route = new GisRoute();
                   
                    route.gisUpload = gisUpload;
                    route.agency = gisUpload.agency;
                    route.oid = feature.getID();
                    route.originalShape = multiLineString;
                    route.originalShape.setSRID(4326);
                   
                    if(gisUpload.fieldName != null)
                  {
                    FeatureAttributeFormatter attribFormatter = new FeatureAttributeFormatter(gisUpload.fieldName);
                    route.routeName =  attribFormatter.format(feature);
                   
                  }
                  if(gisUpload.fieldId != null)
                {
                  FeatureAttributeFormatter attribFormatter = new FeatureAttributeFormatter(gisUpload.fieldId);
                  route.routeId =  attribFormatter.format(feature);
                }
                if(gisUpload.fieldDescription != null)
                {
                  FeatureAttributeFormatter attribFormatter = new FeatureAttributeFormatter(gisUpload.fieldDescription);
                  route.description =  attribFormatter.format(feature);
                }
                 
                  route.save();
                 
                  route.processSegments();
                 
                   }
                else if(gisUpload.type == GisUploadType.STOPS)
                {
                  if(geomType.getBinding() != Point.class)
                  {
                    Logger.error("Unexpected geometry type: ", geomType);
                    continue;
                  }
               
View Full Code Here


          build.setName(geomTypeName);
          build.setBinding(targetGeomType);
          build.setNillable(true);
          build.setCRS(crs);

          GeometryType type = build.buildGeometryType();
          att = build.buildDescriptor(geomTypeName, type);

        }
        builder.add(att);
        builder.setDefaultGeometry(att.getLocalName());
View Full Code Here

    build.setName(defaultGeomAttr.getLocalName());
    build.setNillable(true);
    build.setBinding(geometryClass);
    build.setCRS(crs);

    GeometryType type = build.buildGeometryType();

    builder.setDefaultGeometry(build.buildDescriptor(defaultGeomAttr.getLocalName(), type).getLocalName());

    builder.add(defaultGeomAttr.getLocalName(), geometryClass, crs);
View Full Code Here

     * Returns true if the schema has just one geometry and the geom type is known
     * @param schema
     * @return
     */
    private boolean isShapefileCompatible(SimpleFeatureType schema) {
        GeometryType gt = null;
        for (AttributeDescriptor at : schema.getAttributeDescriptors()) {
            if(at instanceof GeometryDescriptor) {
                if(gt == null)
                    gt = ((GeometryDescriptor) at).getType();
                else
                    // more than one geometry
                    return false;
            }
        }
       
        return gt != null && SHAPEFILE_GEOM_TYPES.contains(gt.getBinding());
    }
View Full Code Here

    build.setBinding(this.geometryClass);
    build.setNillable(true);
    build.setLength(100);
    build.setCRS(crs);

    GeometryType type = build.buildGeometryType();
    geoAttrType = build.buildDescriptor(this.geometryName, type);

    this.unionGeometryAttr = geoAttrType;

    return this;
View Full Code Here

    super.setUp();
   
    this.geometryFactory = new GeometryFactory( new PrecisionModel( PrecisionModel.FLOATING ), 27700 );
   
    // TODO Try using the SimpleFeatureBuilder class.
    GeometryType geometryType = LimbGeneratorTest.Utils.createGeometryType( LineString.class );
    GeometryDescriptor geometryDescriptor = LimbGeneratorTest.Utils.createGeometryDescriptor( geometryType );
    List<AttributeDescriptor> attributeDescriptors = new ArrayList<AttributeDescriptor>();
    attributeDescriptors.add( geometryDescriptor );
    SimpleFeatureType featureType = new SimpleFeatureTypeImpl( new NameImpl( "test" ), attributeDescriptors, geometryDescriptor, false, null, null, null );
    List<Object> attributeValues = new ArrayList<Object>();
View Full Code Here

    super.setUp();
   
    this.geometryFactory = new GeometryFactory( new PrecisionModel( PrecisionModel.FLOATING ), 27700 );
   
    // TODO Try using the SimpleFeatureBuilder class.
    GeometryType geometryType = LimbGeneratorTest.Utils.createGeometryType( LineString.class );
    GeometryDescriptor geometryDescriptor = LimbGeneratorTest.Utils.createGeometryDescriptor( geometryType );
    List<AttributeDescriptor> attributeDescriptors = new ArrayList<AttributeDescriptor>();
    attributeDescriptors.add( geometryDescriptor );
    SimpleFeatureType featureType = new SimpleFeatureTypeImpl( new NameImpl( "test" ), attributeDescriptors, geometryDescriptor, false, null, null, null );
    List<Object> attributeValues = new ArrayList<Object>();
View Full Code Here

          } else {
            objSR = new JSONObject();
            objSR.put("wkid", outSR);
            obj.put("spatialReference", objSR);

            GeometryType geometryType = featureCollection
                .getSchema().getGeometryDescriptor().getType();
            obj
                .put("geometryType", EsriJsonUtil
                    .geometryType2String(geometryType
                        .getBinding()));
            String geometryField = featureCollection.getSchema()
                .getGeometryDescriptor().getLocalName();

            ArrayList<String> fields = new ArrayList<String>();
View Full Code Here

      obj.put("GIServerVersion", VersionUtil.getCurrentversion());
      if (featureCollection == null && featureId >= 0) {
        ArrayList<String> details = new ArrayList<String>();
        details.add("Feature got is NULL.");
      } else {
        GeometryType geometryType = featureCollection.getSchema()
            .getGeometryDescriptor().getType();
        obj.put("geometryType", EsriJsonUtil
            .geometryType2String(geometryType.getBinding()));
        String geometryField = featureCollection.getSchema()
            .getGeometryDescriptor().getLocalName();

        ArrayList<String> fields = new ArrayList<String>();
        Collection<PropertyDescriptor> propertyDescriptors = featureCollection
View Full Code Here

      obj.put("GIServerVersion", VersionUtil.getCurrentversion());
      if (featureCollection == null && !(featureId >= 0)) {
        ArrayList<String> details = new ArrayList<String>();
        details.add("Feature got is NULL.");
      } else {
        GeometryType geometryType = featureCollection.getSchema()
            .getGeometryDescriptor().getType();
        obj.put("geometryType", EsriJsonUtil
            .geometryType2String(geometryType.getBinding()));
        String geometryField = featureCollection.getSchema()
            .getGeometryDescriptor().getLocalName();

        ArrayList<String> fields = new ArrayList<String>();
        Collection<PropertyDescriptor> propertyDescriptors = featureCollection
View Full Code Here

TOP

Related Classes of org.opengis.feature.type.GeometryType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.