returns the feature's geometry type
519780
def geometryType(self):
        
        if self._geomType is None:
            if self.geometry is not None:
                self._geomType = self.geometry.type
            else:
                self._geomType = "Table"
        return self._geomType
237087
def _get_type(points, soma_class):
    '''
    '''
    assert soma_class in (SOMA_CONTOUR, SOMA_CYLINDER)

    npoints = len(points)
    if soma_class == SOMA_CONTOUR:
        return {0: None,
                1: SomaSinglePoint,
                2: None}.get(npoints, SomaSimpleContour)

    if(npoints == 3 and
       points[0][COLS.P] == -1 and
       points[1][COLS.P] == 1 and
       points[2][COLS.P] == 1):
        L.warning('Using neuromorpho 3-Point soma')
        # NeuroMorpho is the main provider of morphologies, but they
        # with SWC as their default file format: they convert all
        # uploads to SWC.  In the process of conversion, they turn all
        # somas into their custom 'Three-point soma representation':
        #  http://neuromorpho.org/SomaFormat.html

        return SomaNeuromorphoThreePointCylinders

    return {0: None,
            1: SomaSinglePoint}.get(npoints, SomaCylinders)
1293156
def get_type(data):
    
    import six
    from ..datageometry import DataGeometry

    if isinstance(data, list):
        if isinstance(data[0], (six.string_types, six.text_type, six.binary_type)):
            return 'list_str'
        elif isinstance(data[0], (int, float)):
            return 'list_num'
        elif isinstance(data[0], np.ndarray):
            return 'list_arr'
        else:
            raise TypeError('Unsupported data type passed. Supported types: '
                            'Numpy Array, Pandas DataFrame, String, List of strings'
                            ', List of numbers')
    elif isinstance(data, np.ndarray):
        if isinstance(data[0][0], (six.string_types, six.text_type, six.binary_type)):
            return 'arr_str'
        else:
            return 'arr_num'
    elif isinstance(data, pd.DataFrame):
        return 'df'
    elif isinstance(data, (six.string_types, six.text_type, six.binary_type)):
        return 'str'
    elif isinstance(data, DataGeometry):
        return 'geo'
    else:
        raise TypeError('Unsupported data type passed. Supported types: '
                        'Numpy Array, Pandas DataFrame, String, List of strings'
                        ', List of numbers')
967955
def geom(self):
        
        return numpy.array([(p.x, p.y, p.z) for p in self.mesh],
                           numpy.float32)
500480
def point_type(name, fields, srid_map):
    

    def srid(self):
        try:
            return srid_map[len(self)]
        except KeyError:
            return None

    attributes = {"srid": property(srid)}

    for index, subclass_field in enumerate(fields):

        def accessor(self, i=index, f=subclass_field):
            try:
                return self[i]
            except IndexError:
                raise AttributeError(f)

        for field_alias in {subclass_field, "xyz"[index]}:
            attributes[field_alias] = property(accessor)

    cls = type(name, (Point,), attributes)

    with __srid_table_lock:
        for dim, srid in srid_map.items():
            __srid_table[srid] = (cls, dim)

    return cls
1259888
@Override
	public String getTypeName() {
		String type;
		if (isGeometry()) {
			type = geometryType.name();
		} else {
			type = super.getTypeName();
		}
		return type;
	}
465579
def shape_type(self):
        
        if self.has_chart:
            return MSO_SHAPE_TYPE.CHART
        elif self.has_table:
            return MSO_SHAPE_TYPE.TABLE
        else:
            return None
253801
protected static DefaultProcessDiagramCanvas.SHAPE_TYPE getShapeType(BaseElement baseElement) {
        if (baseElement instanceof Task || baseElement instanceof Activity || baseElement instanceof TextAnnotation) {
            return DefaultProcessDiagramCanvas.SHAPE_TYPE.Rectangle;
        } else if (baseElement instanceof Gateway) {
            return DefaultProcessDiagramCanvas.SHAPE_TYPE.Rhombus;
        } else if (baseElement instanceof Event) {
            return DefaultProcessDiagramCanvas.SHAPE_TYPE.Ellipse;
        }
        // unknown source element, just do not correct coordinates
        return null;
    }
305939
def faces(self):
        

        if self._faces is None:
            if self._vertices is None:
                return None
            self.triangulate()
        return self._faces
1107749
@Transient
    private Feature getLocation() {
        if (geometry == null) {
            return null;
        }
        final List<Feature> features = geometry.getFeatures();
        if (features == null || features.isEmpty()) {
            return null;
        }
        return features.get(0);
    }
916956
Geometry getBoundingGeometry() {
		// Extracts the convex hull from the tree. Reading the tree in order from first to last is the resulting convex hull.
		Point point = new Point();
		int first = m_tree_hull.getFirst(-1);
		Polygon hull = new Polygon(m_shape.getVertexDescription());
		if (m_tree_hull.size(-1) == 0)
			return hull;
		
		m_shape.queryPoint(m_tree_hull.getElement(first), point);
		hull.startPath(point);

		for (int i = m_tree_hull.getNext(first); i != -1; i = m_tree_hull.getNext(i)) {
			m_shape.queryPoint(m_tree_hull.getElement(i), point);
			hull.lineTo(point);
		}

		return hull;
	}
1321175
private ShapeStyle createStyleForFeature(Feature feature) {
		ShapeStyle style = null;
		if (null != feature) {
			FeatureStyleInfo styleInfo = null;
			if (feature.getStyleId() != null) {
				String check = feature.getStyleId();
				if (null != check) {
					for (FeatureStyleInfo fsi :
							feature.getLayer().getLayerInfo().getNamedStyleInfo().getFeatureStyles()) {
						if (check.equals(fsi.getStyleId())) {
							styleInfo = fsi;
							break;
						}
					}
				}
			}
			style = new ShapeStyle(styleInfo);
	
			Geometry geometry = feature.getGeometry();
			if (null != geometry) {
				switch (geometry.getLayerType()) {
					case LINESTRING:
					case MULTILINESTRING:
						style.merge(lineSelectStyle);
						break;
					case POLYGON:
					case MULTIPOLYGON:
						style.merge(polygonSelectStyle);
						break;
					case POINT:
					case MULTIPOINT:
						style.merge(pointSelectStyle);
						break;
					default:
						throw new IllegalStateException("Cannot create style for feature with Geometry type " +
								geometry.getLayerType());
				}
			}
		}
		return style;
	}
344125
def get_feature_type_info(self):
        
        caps = self.get_capabilities()
        if caps is None:
            return None

        el = caps.find('{http://www.opengis.net/wfs}FeatureTypeList')
        for e in el.findall('{http://www.opengis.net/wfs}FeatureType'):
            if e.find('{http://www.opengis.net/wfs}Name').text == self._feature_name:
                # transform into python dict
                # <Name>sample</Name>
                # <Abstract/>
                # <LatLongBoundingBox maxx="1" maxy="5" ... />
                #
                # becomes:
                #
                # {'Name'               :'sample',
                #  'Abtract'            : None,
                #  'LatLongBoundingBox' : {'maxx':1, 'maxy':5 ... }}
                #
                d = {sube.tag[28:]:sube.text or sube.attrib or None for sube in e.getchildren()}

                # transform LatLongBoundingBox into a Shapely box
                llbb = {k:round(float(v), 4) for k,v in d['LatLongBoundingBox'].iteritems()}
                d['LatLongBoundingBox'] = box(llbb['minx'], llbb['miny'], llbb['maxx'], llbb['maxy'])
                return d

        return None
963675
public EGeometryType getType() {
        SymbolizerWrapper geometrySymbolizersWrapper = getGeometrySymbolizersWrapper();
        if (geometrySymbolizersWrapper == null) {
            return null;
        }
        Symbolizer symbolizer = geometrySymbolizersWrapper.getSymbolizer();
        if (symbolizer instanceof PointSymbolizer) {
            return EGeometryType.POINT;
        } else if (symbolizer instanceof LineSymbolizer) {
            return EGeometryType.LINESTRING;
        } else if (symbolizer instanceof PolygonSymbolizer) {
            return EGeometryType.POLYGON;
        } else if (symbolizer instanceof RasterSymbolizer) {
            throw new RuntimeException("Not implemented yet!");
        }
        return null;
    }
666910
function getter_THREE_Geometry(inst) {
	return [
		inst.vertices,
		inst.faces,
		inst.faceVertexUvs,
		inst.morphTargets,
		inst.morphNormals,
		inst.morphColors,
		inst.animations,
		inst.boundingSphere,
		inst.boundingBox,
		inst.name];
}
227913
def getFeatureID(self, location):
    
    if not self.contains(location):
      return self.EMPTY_FEATURE

    if self.almostEqual(abs(location[2]), self.height / 2.):
      if self.almostEqual(location[0] ** 2 + location[1] ** 2,
                          self.radius ** 2):
        return self.CYLINDER_EDGE
      else:
        return self.FLAT
    else:
      return self.CYLINDER_SURFACE
187793
public Geometry getGeometry(FeatureTransaction featureTransaction) {
		if (featureIndex >= 0 && featureTransaction.getNewFeatures() != null
				&& featureTransaction.getNewFeatures().length > featureIndex) {
			return featureTransaction.getNewFeatures()[featureIndex].getGeometry();
		}
		return null;
	}