doc_content
stringlengths
1
386k
doc_id
stringlengths
5
188
ellipsoid
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.ellipsoid
from_esri()
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.from_esri
geographic
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.geographic
identify_epsg()
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.identify_epsg
import_epsg(epsg)
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.import_epsg
import_proj(proj)
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.import_proj
import_user_input(user_input)
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.import_user_input
import_wkt(wkt)
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.import_wkt
import_xml(xml)
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.import_xml
inverse_flattening
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.inverse_flattening
linear_name
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.linear_name
linear_units
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.linear_units
local
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.local
name
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.name
pretty_wkt
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.pretty_wkt
proj
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.proj
proj4
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.proj4
projected
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.projected
semi_major
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.semi_major
semi_minor
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.semi_minor
srid
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.srid
to_esri()
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.to_esri
units
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.units
validate()
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.validate
wkt
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.wkt
xml
django.ref.contrib.gis.gdal#django.contrib.gis.gdal.SpatialReference.xml
class GeoIP2(path=None, cache=0, country=None, city=None)
django.ref.contrib.gis.geoip2#django.contrib.gis.geoip2.GeoIP2
GeoIP2.city(query)
django.ref.contrib.gis.geoip2#django.contrib.gis.geoip2.GeoIP2.city
GeoIP2.coords(query)
django.ref.contrib.gis.geoip2#django.contrib.gis.geoip2.GeoIP2.coords
GeoIP2.country(query)
django.ref.contrib.gis.geoip2#django.contrib.gis.geoip2.GeoIP2.country
GeoIP2.country_code(query)
django.ref.contrib.gis.geoip2#django.contrib.gis.geoip2.GeoIP2.country_code
GeoIP2.country_name(query)
django.ref.contrib.gis.geoip2#django.contrib.gis.geoip2.GeoIP2.country_name
GeoIP2.geos(query)
django.ref.contrib.gis.geoip2#django.contrib.gis.geoip2.GeoIP2.geos
GeoIP2.lat_lon(query)
django.ref.contrib.gis.geoip2#django.contrib.gis.geoip2.GeoIP2.lat_lon
GeoIP2.lon_lat(query)
django.ref.contrib.gis.geoip2#django.contrib.gis.geoip2.GeoIP2.lon_lat
fromfile(file_h) Parameters: file_h (a Python file object or a string path to the file) – input file that contains spatial data Return type: a GEOSGeometry corresponding to the spatial data in the file Example: >>> from django.contrib.gis.geos import fromfile >>> g = fromfile('/home/bob/geom.wkt')
django.ref.contrib.gis.geos#django.contrib.gis.geos.fromfile
fromstr(string, srid=None) Parameters: string (str) – string that contains spatial data srid (int) – spatial reference identifier Return type: a GEOSGeometry corresponding to the spatial data in the string fromstr(string, srid) is equivalent to GEOSGeometry(string, srid). Example: >>> from django.contrib.gis.geos import fromstr >>> pnt = fromstr('POINT(-90.5 29.5)', srid=4326)
django.ref.contrib.gis.geos#django.contrib.gis.geos.fromstr
class GeometryCollection(*args, **kwargs) GeometryCollection objects may be instantiated by passing in other GEOSGeometry as arguments, or a single sequence of GEOSGeometry objects: >>> poly = Polygon( ((0, 0), (0, 1), (1, 1), (0, 0)) ) >>> gc = GeometryCollection(Point(0, 0), MultiPoint(Point(0, 0), Point(1, 1)), poly) >>> gc = GeometryCollection((Point(0, 0), MultiPoint(Point(0, 0), Point(1, 1)), poly))
django.ref.contrib.gis.geos#django.contrib.gis.geos.GeometryCollection
class GEOSGeometry(geo_input, srid=None) Parameters: geo_input – Geometry input value (string or buffer) srid (int) – spatial reference identifier
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry
GEOSGeometry.area This property returns the area of the Geometry.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.area
GEOSGeometry.boundary Returns the boundary as a newly allocated Geometry object.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.boundary
GEOSGeometry.buffer(width, quadsegs=8) Returns a GEOSGeometry that represents all points whose distance from this geometry is less than or equal to the given width. The optional quadsegs keyword sets the number of segments used to approximate a quarter circle (defaults is 8).
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.buffer
GEOSGeometry.buffer_with_style(width, quadsegs=8, end_cap_style=1, join_style=1, mitre_limit=5.0) Same as buffer(), but allows customizing the style of the buffer. end_cap_style can be round (1), flat (2), or square (3). join_style can be round (1), mitre (2), or bevel (3). Mitre ratio limit (mitre_limit) only affects mitered join style.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.buffer_with_style
GEOSGeometry.centroid Returns a Point object representing the geometric center of the geometry. The point is not guaranteed to be on the interior of the geometry.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.centroid
GEOSGeometry.clone() This method returns a GEOSGeometry that is a clone of the original.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.clone
GEOSGeometry.contains(other) Returns True if other.within(this) returns True.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.contains
GEOSGeometry.convex_hull Returns the smallest Polygon that contains all the points in the geometry.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.convex_hull
GEOSGeometry.coords Returns the coordinates of the geometry as a tuple.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.coords
GEOSGeometry.covers(other) Returns True if this geometry covers the specified geometry. The covers predicate has the following equivalent definitions: Every point of the other geometry is a point of this geometry. The DE-9IM Intersection Matrix for the two geometries is T*****FF*, *T****FF*, ***T**FF*, or ****T*FF*. If either geometry is empty, returns False. This predicate is similar to GEOSGeometry.contains(), but is more inclusive (i.e. returns True for more cases). In particular, unlike contains() it does not distinguish between points in the boundary and in the interior of geometries. For most situations, covers() should be preferred to contains(). As an added benefit, covers() is more amenable to optimization and hence should outperform contains().
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.covers
GEOSGeometry.crosses(other) Returns True if the DE-9IM intersection matrix for the two Geometries is T*T****** (for a point and a curve,a point and an area or a line and an area) 0******** (for two curves).
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.crosses
GEOSGeometry.difference(other) Returns a GEOSGeometry representing the points making up this geometry that do not make up other.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.difference
GEOSGeometry.dims Returns the dimension of the geometry: 0 for Points and MultiPoints 1 for LineStrings and MultiLineStrings 2 for Polygons and MultiPolygons -1 for empty GeometryCollections the maximum dimension of its elements for non-empty GeometryCollections
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.dims
GEOSGeometry.disjoint(other) Returns True if the DE-9IM intersection matrix for the two geometries is FF*FF****.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.disjoint
GEOSGeometry.distance(geom) Returns the distance between the closest points on this geometry and the given geom (another GEOSGeometry object). Note GEOS distance calculations are linear – in other words, GEOS does not perform a spherical calculation even if the SRID specifies a geographic coordinate system.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.distance
GEOSGeometry.empty Returns whether or not the set of points in the geometry is empty.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.empty
GEOSGeometry.envelope Returns a Polygon that represents the bounding envelope of this geometry. Note that it can also return a Point if the input geometry is a point.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.envelope
GEOSGeometry.equals(other) Returns True if the DE-9IM intersection matrix for the two geometries is T*F**FFF*.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.equals
GEOSGeometry.equals_exact(other, tolerance=0) Returns true if the two geometries are exactly equal, up to a specified tolerance. The tolerance value should be a floating point number representing the error tolerance in the comparison, e.g., poly1.equals_exact(poly2, 0.001) will compare equality to within one thousandth of a unit.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.equals_exact
GEOSGeometry.ewkb Return the EWKB representation of this Geometry as a Python buffer. This is an extension of the WKB specification that includes any SRID value that are a part of this geometry.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.ewkb
GEOSGeometry.ewkt Returns the “extended” Well-Known Text of the geometry. This representation is specific to PostGIS and is a superset of the OGC WKT standard. [1] Essentially the SRID is prepended to the WKT representation, for example SRID=4326;POINT(5 23). Note The output from this property does not include the 3dm, 3dz, and 4d information that PostGIS supports in its EWKT representations.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.ewkt
GEOSGeometry.extent This property returns the extent of this geometry as a 4-tuple, consisting of (xmin, ymin, xmax, ymax).
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.extent
GEOSGeometry.geojson Alias for GEOSGeometry.json.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.geojson
GEOSGeometry.geom_type Returns a string corresponding to the type of geometry. For example: >>> pnt = GEOSGeometry('POINT(5 23)') >>> pnt.geom_type 'Point'
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.geom_type
GEOSGeometry.geom_typeid Returns the GEOS geometry type identification number. The following table shows the value for each geometry type: Geometry ID Point 0 LineString 1 LinearRing 2 Polygon 3 MultiPoint 4 MultiLineString 5 MultiPolygon 6 GeometryCollection 7
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.geom_typeid
GEOSGeometry.hasz Returns a boolean indicating whether the geometry is three-dimensional.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.hasz
GEOSGeometry.hex Returns the WKB of this Geometry in hexadecimal form. Please note that the SRID value is not included in this representation because it is not a part of the OGC specification (use the GEOSGeometry.hexewkb property instead).
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.hex
GEOSGeometry.hexewkb Returns the EWKB of this Geometry in hexadecimal form. This is an extension of the WKB specification that includes the SRID value that are a part of this geometry.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.hexewkb
GEOSGeometry.interpolate(distance)
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.interpolate
GEOSGeometry.interpolate_normalized(distance) Given a distance (float), returns the point (or closest point) within the geometry (LineString or MultiLineString) at that distance. The normalized version takes the distance as a float between 0 (origin) and 1 (endpoint). Reverse of GEOSGeometry.project().
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.interpolate_normalized
GEOSGeometry.intersection(other) Returns a GEOSGeometry representing the points shared by this geometry and other.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.intersection
GEOSGeometry.intersects(other) Returns True if GEOSGeometry.disjoint() is False.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.intersects
GEOSGeometry.json Returns the GeoJSON representation of the geometry. Note that the result is not a complete GeoJSON structure but only the geometry key content of a GeoJSON structure. See also GeoJSON Serializer.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.json
GEOSGeometry.kml Returns a KML (Keyhole Markup Language) representation of the geometry. This should only be used for geometries with an SRID of 4326 (WGS84), but this restriction is not enforced.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.kml
GEOSGeometry.length Returns the length of this geometry (e.g., 0 for a Point, the length of a LineString, or the circumference of a Polygon).
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.length
GEOSGeometry.normalize() Converts this geometry to canonical form: >>> g = MultiPoint(Point(0, 0), Point(2, 2), Point(1, 1)) >>> print(g) MULTIPOINT (0 0, 2 2, 1 1) >>> g.normalize() >>> print(g) MULTIPOINT (2 2, 1 1, 0 0)
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.normalize
GEOSGeometry.num_coords Returns the number of coordinates in the geometry.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.num_coords
GEOSGeometry.num_geom Returns the number of geometries in this geometry. In other words, will return 1 on anything but geometry collections.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.num_geom
GEOSGeometry.ogr Returns an OGRGeometry object corresponding to the GEOS geometry.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.ogr
GEOSGeometry.overlaps(other) Returns true if the DE-9IM intersection matrix for the two geometries is T*T***T** (for two points or two surfaces) 1*T***T** (for two curves).
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.overlaps
GEOSGeometry.point_on_surface Computes and returns a Point guaranteed to be on the interior of this geometry.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.point_on_surface
GEOSGeometry.prepared Returns a GEOS PreparedGeometry for the contents of this geometry. PreparedGeometry objects are optimized for the contains, intersects, covers, crosses, disjoint, overlaps, touches and within operations. Refer to the Prepared Geometries documentation for more information.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.prepared
GEOSGeometry.project(point)
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.project
GEOSGeometry.project_normalized(point) Returns the distance (float) from the origin of the geometry (LineString or MultiLineString) to the point projected on the geometry (that is to a point of the line the closest to the given point). The normalized version returns the distance as a float between 0 (origin) and 1 (endpoint). Reverse of GEOSGeometry.interpolate().
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.project_normalized
GEOSGeometry.relate(other) Returns the DE-9IM intersection matrix (a string) representing the topological relationship between this geometry and the other.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.relate
GEOSGeometry.relate_pattern(other, pattern) Returns True if the elements in the DE-9IM intersection matrix for this geometry and the other matches the given pattern – a string of nine characters from the alphabet: {T, F, *, 0}.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.relate_pattern
GEOSGeometry.ring Returns a boolean indicating whether the geometry is a LinearRing.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.ring
GEOSGeometry.simple Returns a boolean indicating whether the geometry is ‘simple’. A geometry is simple if and only if it does not intersect itself (except at boundary points). For example, a LineString object is not simple if it intersects itself. Thus, LinearRing and Polygon objects are always simple because they do cannot intersect themselves, by definition.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.simple
GEOSGeometry.simplify(tolerance=0.0, preserve_topology=False) Returns a new GEOSGeometry, simplified to the specified tolerance using the Douglas-Peucker algorithm. A higher tolerance value implies fewer points in the output. If no tolerance is provided, it defaults to 0. By default, this function does not preserve topology. For example, Polygon objects can be split, be collapsed into lines, or disappear. Polygon holes can be created or disappear, and lines may cross. By specifying preserve_topology=True, the result will have the same dimension and number of components as the input; this is significantly slower, however.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.simplify
GEOSGeometry.srid Property that may be used to retrieve or set the SRID associated with the geometry. For example: >>> pnt = Point(5, 23) >>> print(pnt.srid) None >>> pnt.srid = 4326 >>> pnt.srid 4326
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.srid
GEOSGeometry.srs Returns a SpatialReference object corresponding to the SRID of the geometry or None.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.srs
GEOSGeometry.sym_difference(other) Returns a GEOSGeometry combining the points in this geometry not in other, and the points in other not in this geometry.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.sym_difference
GEOSGeometry.touches(other) Returns True if the DE-9IM intersection matrix for the two geometries is FT*******, F**T***** or F***T****.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.touches
GEOSGeometry.transform(ct, clone=False) Transforms the geometry according to the given coordinate transformation parameter (ct), which may be an integer SRID, spatial reference WKT string, a PROJ string, a SpatialReference object, or a CoordTransform object. By default, the geometry is transformed in-place and nothing is returned. However if the clone keyword is set, then the geometry is not modified and a transformed clone of the geometry is returned instead. Note Raises GEOSException if GDAL is not available or if the geometry’s SRID is None or less than 0. It doesn’t impose any constraints on the geometry’s SRID if called with a CoordTransform object.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.transform
GEOSGeometry.unary_union Computes the union of all the elements of this geometry. The result obeys the following contract: Unioning a set of LineStrings has the effect of fully noding and dissolving the linework. Unioning a set of Polygons will always return a Polygon or MultiPolygon geometry (unlike GEOSGeometry.union(), which may return geometries of lower dimension if a topology collapse occurs).
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.unary_union
GEOSGeometry.union(other) Returns a GEOSGeometry representing all the points in this geometry and the other.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.union
GEOSGeometry.valid Returns a boolean indicating whether the geometry is valid.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.valid
GEOSGeometry.valid_reason Returns a string describing the reason why a geometry is invalid.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.valid_reason
GEOSGeometry.within(other) Returns True if the DE-9IM intersection matrix for the two geometries is T*F**F***.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.within
GEOSGeometry.wkb Returns the WKB (Well-Known Binary) representation of this Geometry as a Python buffer. SRID value is not included, use the GEOSGeometry.ewkb property instead.
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.wkb
GEOSGeometry.wkt Returns the Well-Known Text of the geometry (an OGC standard).
django.ref.contrib.gis.geos#django.contrib.gis.geos.GEOSGeometry.wkt