Builds a point feature from a dwg text.
978165
public SimpleFeature convertDwgText( String typeName, String layerName, DwgText text, int id ) {
        Point2D pto = text.getInsertionPoint();
        Coordinate coord = new Coordinate(pto.getX(), pto.getY(), 0.0);
        String textString = text.getText();

        return createPointTextFeature(typeName, layerName, id, coord, textString);
    }
813896
def _addPolylineToElements(self):
        
        if (len(self._pointsOfPolyline) > 1):
            s = ''
            for point in self._pointsOfPolyline:
                s += str(point) + ' '#str(point.x) + ',' + str(point.y) + ' '
            p = Polyline(s)
            p.set_style('fill:' + self.fill + '; stroke:' + self.stroke + '; stroke-width:' + self.strokeWidth) 
            self._svgElements.append(p)
        self._pointsOfPolyline = []
        self._pointsOfPolyline.append(Vector(self._position.x, self._position.y))
1192062
private boolean drawPoint(BoundingBox boundingBox,
			ProjectionTransform transform, FeatureTileGraphics graphics,
			Point point, FeatureStyle featureStyle) {

		boolean drawn = false;

		Point projectedPoint = transform.transform(point);

		float x = TileBoundingBoxUtils.getXPixel(tileWidth, boundingBox,
				projectedPoint.getX());
		float y = TileBoundingBoxUtils.getYPixel(tileHeight, boundingBox,
				projectedPoint.getY());

		if (featureStyle != null && featureStyle.hasIcon()) {

			IconRow iconRow = featureStyle.getIcon();
			BufferedImage icon = getIcon(iconRow);

			int width = icon.getWidth();
			int height = icon.getHeight();

			if (x >= 0 - width && x <= tileWidth + width && y >= 0 - height
					&& y <= tileHeight + height) {

				float anchorU = (float) iconRow.getAnchorUOrDefault();
				float anchorV = (float) iconRow.getAnchorVOrDefault();

				int iconX = Math.round(x - (anchorU * width));
				int iconY = Math.round(y - (anchorV * height));

				Graphics2D iconGraphics = graphics.getIconGraphics();
				iconGraphics.drawImage(icon, iconX, iconY, null);
				drawn = true;
			}

		} else if (pointIcon != null) {

			int width = Math.round(this.scale * pointIcon.getWidth());
			int height = Math.round(this.scale * pointIcon.getHeight());
			if (x >= 0 - width && x <= tileWidth + width && y >= 0 - height
					&& y <= tileHeight + height) {
				int iconX = Math.round(x - this.scale * pointIcon.getXOffset());
				int iconY = Math.round(y - this.scale * pointIcon.getYOffset());
				Graphics2D iconGraphics = graphics.getIconGraphics();
				iconGraphics.drawImage(pointIcon.getIcon(), iconX, iconY,
						width, height, null);
				drawn = true;
			}

		} else {

			Float radius = null;
			if (featureStyle != null) {
				StyleRow styleRow = featureStyle.getStyle();
				if (styleRow != null) {
					radius = this.scale
							* (float) (styleRow.getWidthOrDefault() / 2.0f);
				}
			}
			if (radius == null) {
				radius = this.scale * pointRadius;
			}
			if (x >= 0 - radius && x <= tileWidth + radius && y >= 0 - radius
					&& y <= tileHeight + radius) {

				Graphics2D pointGraphics = graphics.getPointGraphics();
				Paint pointPaint = getPointPaint(featureStyle);
				pointGraphics.setColor(pointPaint.getColor());

				int circleX = Math.round(x - radius);
				int circleY = Math.round(y - radius);
				int diameter = Math.round(radius * 2);
				pointGraphics.fillOval(circleX, circleY, diameter, diameter);
				drawn = true;
			}

		}

		return drawn;
	}
1045906
def _to_point(dims):
  """"""
  assert dims

  if isinstance(dims, (tuple, list)):
    if len(dims) != 2:
      raise ValueError(
          "A two element tuple or list is expected here, got {}.".format(dims))
    else:
      width = int(dims[0])
      height = int(dims[1])
      if width <= 0 or height <= 0:
        raise ValueError("Must specify +ve dims, got {}.".format(dims))
      else:
        return point.Point(width, height)
  else:
    size = int(dims)
    if size <= 0:
      raise ValueError(
          "Must specify a +ve value for size, got {}.".format(dims))
    else:
      return point.Point(size, size)
906350
def line2pts(geom, dl=None):
    
    #Extract list of (x,y) tuples at nodes
    nodes = geom.GetPoints()
    #print "%i nodes" % len(nodes)
   
    #Point spacing in map units
    if dl is None:
        nsteps=1000
        dl = geom.Length()/nsteps

    #This only works for equidistant projection!
    #l = np.arange(0, geom.Length(), dl)

    #Initialize empty lists
    l = []
    mX = []
    mY = []

    #Add first point to output lists
    l += [0]
    x = nodes[0][0]
    y = nodes[0][1]
    mX += [x]
    mY += [y]

    #Remainder
    rem_l = 0
    #Previous length (initially 0)
    last_l = l[-1]
    
    #Loop through each line segment in the feature
    for i in range(0,len(nodes)-1):
        x1, y1 = nodes[i]
        x2, y2 = nodes[i+1]
      
        #Total length of segment
        tl = np.sqrt((x2-x1)**2 + (y2-y1)**2)

        #Number of dl steps we can fit in this segment
        #This returns floor 
        steps = int((tl+rem_l)/dl)

        if steps > 0:
            dx = ((x2-x1)/tl)*dl
            dy = ((y2-y1)/tl)*dl
            rem_x = rem_l*(dx/dl)
            rem_y = rem_l*(dy/dl)
            
            #Loop through each step and append to lists
            for n in range(1, steps+1):
                l += [last_l + (dl*n)]
                #Remove the existing remainder
                x = x1 + (dx*n) - rem_x
                y = y1 + (dy*n) - rem_y
                mX += [x]
                mY += [y]

            #Note: could just build up arrays of pX, pY for entire line, then do single z extraction
            #Update the remainder
            rem_l += tl - (steps * dl)
            last_l = l[-1]
        else:
            rem_l += tl 

    return l, mX, mY
1342620
def _convert_point(cls, feature):
        """"""
        lon, lat = feature['geometry']['coordinates']
        popup = feature['properties'].get('name', '')
        return cls(lat, lon)
1366520
def _geom_points(geom):
    
    if geom['type'] == 'Point':
        yield tuple(geom['coordinates'])
    elif geom['type'] in ('MultiPoint', 'LineString'):
        for position in geom['coordinates']:
            yield tuple(position)
    else:
        raise InvalidFeatureError(
            "Unsupported geometry type:{0}".format(geom['type']))
618682
public SimpleFeature convertDwgCircle( String typeName, String layerName, DwgCircle circle,
            int id ) {
        double[] center = circle.getCenter();
        double radius = circle.getRadius();
        Point2D[] ptos = GisModelCurveCalculator.calculateGisModelCircle(new Point2D.Double(
                center[0], center[1]), radius);
        CoordinateList coordList = new CoordinateList();
        for( int j = 0; j < ptos.length; j++ ) {
            Coordinate coord = new Coordinate(ptos[j].getX(), ptos[j].getY(), 0.0);
            coordList.add(coord);
        }
        // close to create a polygon
        if ((ptos[ptos.length - 1].getX() != ptos[0].getX())
                || (ptos[ptos.length - 1].getY() != ptos[0].getY())) {
            Coordinate coord = new Coordinate(ptos[0].getX(), ptos[0].getY(), 0.0);
            coordList.add(coord);
        }

        SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
        b.setName(typeName);
        b.setCRS(crs);
        b.add(THE_GEOM, Polygon.class);
        b.add(LAYER, String.class);
        SimpleFeatureType type = b.buildFeatureType();
        SimpleFeatureBuilder builder = new SimpleFeatureBuilder(type);
        LinearRing linearRing = gF.createLinearRing(coordList.toCoordinateArray());
        Geometry polygon = gF.createPolygon(linearRing, null);
        Object[] values = new Object[]{polygon, layerName};
        builder.addAll(values);
        return builder.buildFeature(typeName + "." + id);
    }
758857
def point_cloud(df, columns=[0, 1, 2]):
    """"""
    df = df if isinstance(df, pd.DataFrame) else pd.DataFrame(df)
    if not all(c in df.columns for c in columns):
        columns = list(df.columns)[:3]

    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')  # noqa
    Axes3D.scatter(*[df[columns[i]] for i in range(3)], zdir='z', s=20, c=None, depthshade=True)
    return ax
796730
function readPointGeometry_(text) {
  console.assert(text.substring(0, 2) === 'p(');
  console.assert(text[text.length - 1] == ')');
  text = text.substring(2, text.length - 1);
  const flatCoordinates = this.decodeCoordinates_(text);
  console.assert(flatCoordinates.length === 2);
  return new olGeomPoint(flatCoordinates, olGeomGeometryLayout.XY);
}
17545
def text(self, x, y, text, attr=None):
        '''
        self.pos(x, y)
        self.write_color(text, attr)
224505
def as_point(row):
    ''''''
    return Point(row[COLS.X], row[COLS.Y], row[COLS.Z],
                 row[COLS.R], int(row[COLS.TYPE]))
458870
def point(self, x=None, y=None, z=None, m=None, shape=None, part=None, point=None, addr=None):
        """"""
        # shape, part, point
        if shape and part and point:
            try: self._shapes[shape]
            except IndexError: self._shapes.append([])
            try: self._shapes[shape][part]
            except IndexError: self._shapes[shape].append([])
            try: self._shapes[shape][part][point]
            except IndexError: self._shapes[shape][part].append([])
            p = self._shapes[shape][part][point]
            if x: p[0] = x
            if y: p[1] = y
            if z: p[2] = z
            if m: p[3] = m
            self._shapes[shape][part][point] = p
        # shape, part
        elif shape and part and not point:
            try: self._shapes[shape]
            except IndexError: self._shapes.append([])
            try: self._shapes[shape][part]
            except IndexError: self._shapes[shape].append([])
            points = self._shapes[shape][part]
            for i in range(len(points)):
                p = points[i]
                if x: p[0] = x
                if y: p[1] = y
                if z: p[2] = z
                if m: p[3] = m
                self._shapes[shape][part][i] = p
        # shape
        elif shape and not part and not point:
            try: self._shapes[shape]
            except IndexError: self._shapes.append([])

        # point
        # part
        if addr:
            shape, part, point = addr
            self._shapes[shape][part][point] = [x, y, z, m]
        else:
            Writer.point(self, x, y, z, m)
        if self.autoBalance:
            self.balance()
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;
	}
878640
def polygon(self, points, stroke=None, fill=None, stroke_width=1, disable_anti_aliasing=False):
        
        self.put(' <polygon points="')
        self.put(' '.join(['%s,%s' % p for p in points]))
        self.put('" stroke-width="')
        self.put(str(stroke_width))
        self.put('"')
        if fill:
            self.put(' fill="')
            self.put(fill)
            self.put('"')
        if stroke:
            self.put(' stroke="')
            self.put(stroke)
            self.put('"')
        if disable_anti_aliasing:
            self.put(' shape-rendering="crispEdges"')
        self.put('/>\n')
1076690
def multipointm(self, points):
        """"""
        shapeType = MULTIPOINTM
        points = [points] # nest the points inside a list to be compatible with the generic shapeparts method
        self._shapeparts(parts=points, shapeType=shapeType)
1085653
public SimpleFeature convertDwgLine( String typeName, String layerName, DwgLine line, int id ) {
        double[] p1 = line.getP1();
        double[] p2 = line.getP2();
        Point2D[] ptos = new Point2D[]{new Point2D.Double(p1[0], p1[1]),
                new Point2D.Double(p2[0], p2[1])};
        CoordinateList coordList = new CoordinateList();
        for( int j = 0; j < ptos.length; j++ ) {
            Coordinate coord = new Coordinate(ptos[j].getX(), ptos[j].getY(), 0.0);
            coordList.add(coord);
        }

        SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
        b.setName(typeName);
        b.setCRS(crs);
        b.add(THE_GEOM, LineString.class);
        b.add(LAYER, String.class);
        SimpleFeatureType type = b.buildFeatureType();
        SimpleFeatureBuilder builder = new SimpleFeatureBuilder(type);
        Geometry lineString = gF.createLineString(coordList.toCoordinateArray());
        Object[] values = new Object[]{lineString, layerName};
        builder.addAll(values);
        return builder.buildFeature(typeName + "." + id);
    }