Package org.opengis.feature

Examples of org.opengis.feature.GeometryAttribute


  {
    Feature feature = limb.getFeature();
    if (feature == null)
      throw new MissingGeometryException( "Limb has no feature." );
   
    GeometryAttribute geomAttribute = feature.getDefaultGeometryProperty();
    if (geomAttribute == null)
      throw new IllegalStateException( "The feature has had the geometry attribute reset/removed." );
   
    Object geometry = geomAttribute.getValue();
    if (geomAttribute == null)
      throw new IllegalStateException( "The feature has had the geometry value reset/removed." );
   
    // NB: The intersection processor should have already successfully converted
    // the geometry value to a Geometry object.
View Full Code Here


    Geometry view = this.geometryFactory.createLinearRing( Utils.createBoxCoords( 0, 1000, 0, 1000 ) );
    LinearRing featureBounds = this.geometryFactory.createLinearRing( Utils.createBoxCoords( 250, 750, 900, 1900 ) );
    Polygon featurePolygon = this.geometryFactory.createPolygon( featureBounds, null );
   
    // Set the feature geometry into the first polygon.
    GeometryAttribute featureGeometry = Utils.createGeometryAttribute( this.polygonGeomDescriptor, featurePolygon );
    this.feature1.setDefaultGeometryProperty( featureGeometry );
   
    LimbGenerator testObj = new LimbGenerator();
    testObj.setIntersectionGeneratorClass( SimpleIntersectionGenerator.class );
    testObj.setIntersectionProcessors( new ArrayList<IIntersectionProcessor>() );
View Full Code Here

    expectedIntersections.add( this.geometryFactory.createLineString( Utils.createCoords( "500 1000, 900 1000" ) ) );
    // TODO We also erroneously get a second line string from the 3-linestring intersection. This is a problem in the SimpleIntersectionGenerator class.
    expectedIntersections.add( this.geometryFactory.createLineString( Utils.createCoords( "233.33333333333334 0, 0 0" ) ) );
   
    // Set the feature geometry and a label into the first polygon.
    GeometryAttribute featureGeometry = Utils.createGeometryAttribute( this.polygonGeomDescriptor, featurePolygon );
    this.feature1.setDefaultGeometryProperty( featureGeometry );
    this.feature1.setAttribute( NAME_ATTRIBUTE_NAME, featureName );
   
    Options options = new Options();
    options.setNegligibleDistance( 20.0 );
View Full Code Here

        arrayTemp = new JSONArray();
        for (Iterator<FeatureResult> it = featureResults.iterator(); it
            .hasNext();) {
          FeatureResult featureResult = it.next();
          Feature feature = featureResult.getFeature();
          GeometryAttribute geoAttr = feature
              .getDefaultGeometryProperty();
          Geometry geo = (Geometry) geoAttr.getValue();
          if (geo != null) {
            geo = GeometryToolkit.project(geo, mapSR, outSR);
            geoAttr.setValue(geo);
            feature.setDefaultGeometryProperty(geoAttr);
          }
          objTemp = EsriJsonUtil.feature2JSON(feature,
              isReturnGeometry);
          objTemp.put("layerId", featureResult.getLayerId());
View Full Code Here

              .hasNext()
              && printCount < 10;) {
            FeatureResult featureResult = it.next();
            sb.append("<div>");
            Feature feature = featureResult.getFeature();
            GeometryAttribute geoAttr = feature
                .getDefaultGeometryProperty();
            Geometry geo = (Geometry) geoAttr.getValue();
            if (geo != null) {
              geo = GeometryToolkit.project(geo, mapSR, sr);
              geoAttr.setValue(geo);
              feature.setDefaultGeometryProperty(geoAttr);
              String json = EsriJsonUtil.geometry2JSON(geo)
                  .toString();
              if (json.length() > 100) {
                sb.append(json.substring(0, 99) + "...");
View Full Code Here

 
 
  /** {@inheritDoc} */
  public Geometry generateIntersections( Feature feature )
  {
    GeometryAttribute featureGeometryAttribute = feature.getDefaultGeometryProperty();
    if (featureGeometryAttribute == null)
    {
      return FEATURE_HAS_NO_GEOMETRY;
    }
   
    Object featureGeometry = featureGeometryAttribute.getValue();
    if (!(featureGeometry instanceof Geometry))
    {
      return FEATURE_HAS_NO_GEOMETRY;
    }
   
View Full Code Here

        return feature.getIdentifier().toString();
    }
   
    @JSGetter
    public String getGeometryName() {
        GeometryAttribute geomProp = feature.getDefaultGeometryProperty();
        String name = null;
        if (geomProp != null) {
            name = geomProp.getName().toString();
        }
        return name;
    }
View Full Code Here

    }

    private boolean hasCompatibleGeometryType(Feature feature) {
        getFeatureType();
        GeomRestriction restriction = getGeomRestriction();
        GeometryAttribute property = feature.getDefaultGeometryProperty();
        Geometry geom = (Geometry) property.getValue();
        if (geom.getClass().equals(Point.class)) {
            return geometryType == Point.class;
        } else {
            if (geometryType.equals(Point.class)) {
                return false;
View Full Code Here

    }

    @Override
    public GeometryAttribute getDefaultGeometryProperty() {
        GeometryDescriptor geometryDescriptor = featureType.getGeometryDescriptor();
        GeometryAttribute geometryAttribute = null;
        if (geometryDescriptor != null) {
            Object defaultGeometry = getDefaultGeometry();
            geometryAttribute = new GeometryAttributeImpl(defaultGeometry, geometryDescriptor, null);
        }
        return geometryAttribute;
View Full Code Here

            SimpleFeature f = r.next();
            assertNotNull(f);
            assertNotNull(f.getFeatureType());
            assertNotNull(f.getBounds());

            GeometryAttribute defaultGeom = f.getDefaultGeometryProperty();
            assertNotNull("expected non null GeometryAttribute", defaultGeom);

            return true;
        }
View Full Code Here

TOP

Related Classes of org.opengis.feature.GeometryAttribute

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.