code
string
repo_name
string
path
string
language
string
license
string
size
int64
from ctypes import c_void_p from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import ds as vcapi from django.contrib.gis.gdal.prototypes import raster as rcapi from django.utils.encoding import force_bytes, force_str class Driver(GDALBase): """ Wrap a GDAL/OGR Data Source Driver. For more information, see the C API documentation: https://gdal.org/api/vector_c_api.html https://gdal.org/api/raster_c_api.html """ # Case-insensitive aliases for some GDAL/OGR Drivers. # For a complete list of original driver names see # https://gdal.org/drivers/vector/ # https://gdal.org/drivers/raster/ _alias = { # vector "esri": "ESRI Shapefile", "shp": "ESRI Shapefile", "shape": "ESRI Shapefile", "tiger": "TIGER", "tiger/line": "TIGER", # raster "tiff": "GTiff", "tif": "GTiff", "jpeg": "JPEG", "jpg": "JPEG", } def __init__(self, dr_input): """ Initialize an GDAL/OGR driver on either a string or integer input. """ if isinstance(dr_input, str): # If a string name of the driver was passed in self.ensure_registered() # Checking the alias dictionary (case-insensitive) to see if an # alias exists for the given driver. if dr_input.lower() in self._alias: name = self._alias[dr_input.lower()] else: name = dr_input # Attempting to get the GDAL/OGR driver by the string name. for iface in (vcapi, rcapi): driver = c_void_p(iface.get_driver_by_name(force_bytes(name))) if driver: break elif isinstance(dr_input, int): self.ensure_registered() for iface in (vcapi, rcapi): driver = iface.get_driver(dr_input) if driver: break elif isinstance(dr_input, c_void_p): driver = dr_input else: raise GDALException( "Unrecognized input type for GDAL/OGR Driver: %s" % type(dr_input) ) # Making sure we get a valid pointer to the OGR Driver if not driver: raise GDALException( "Could not initialize GDAL/OGR Driver on input: %s" % dr_input ) self.ptr = driver def __str__(self): return self.name @classmethod def ensure_registered(cls): """ Attempt to register all the data source drivers. """ # Only register all if the driver counts are 0 (or else all drivers # will be registered over and over again) if not vcapi.get_driver_count(): vcapi.register_all() if not rcapi.get_driver_count(): rcapi.register_all() @classmethod def driver_count(cls): """ Return the number of GDAL/OGR data source drivers registered. """ return vcapi.get_driver_count() + rcapi.get_driver_count() @property def name(self): """ Return description/name string for this driver. """ return force_str(rcapi.get_driver_description(self.ptr))
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/driver.py
Python
mit
3,351
""" The GDAL/OGR library uses an Envelope structure to hold the bounding box information for a geometry. The envelope (bounding box) contains two pairs of coordinates, one for the lower left coordinate and one for the upper right coordinate: +----------o Upper right; (max_x, max_y) | | | | | | Lower left (min_x, min_y) o----------+ """ from ctypes import Structure, c_double from django.contrib.gis.gdal.error import GDALException # The OGR definition of an Envelope is a C structure containing four doubles. # See the 'ogr_core.h' source file for more information: # https://gdal.org/doxygen/ogr__core_8h_source.html class OGREnvelope(Structure): "Represent the OGREnvelope C Structure." _fields_ = [ ("MinX", c_double), ("MaxX", c_double), ("MinY", c_double), ("MaxY", c_double), ] class Envelope: """ The Envelope object is a C structure that contains the minimum and maximum X, Y coordinates for a rectangle bounding box. The naming of the variables is compatible with the OGR Envelope structure. """ def __init__(self, *args): """ The initialization function may take an OGREnvelope structure, 4-element tuple or list, or 4 individual arguments. """ if len(args) == 1: if isinstance(args[0], OGREnvelope): # OGREnvelope (a ctypes Structure) was passed in. self._envelope = args[0] elif isinstance(args[0], (tuple, list)): # A tuple was passed in. if len(args[0]) != 4: raise GDALException( "Incorrect number of tuple elements (%d)." % len(args[0]) ) else: self._from_sequence(args[0]) else: raise TypeError("Incorrect type of argument: %s" % type(args[0])) elif len(args) == 4: # Individual parameters passed in. # Thanks to ww for the help self._from_sequence([float(a) for a in args]) else: raise GDALException("Incorrect number (%d) of arguments." % len(args)) # Checking the x,y coordinates if self.min_x > self.max_x: raise GDALException("Envelope minimum X > maximum X.") if self.min_y > self.max_y: raise GDALException("Envelope minimum Y > maximum Y.") def __eq__(self, other): """ Return True if the envelopes are equivalent; can compare against other Envelopes and 4-tuples. """ if isinstance(other, Envelope): return ( (self.min_x == other.min_x) and (self.min_y == other.min_y) and (self.max_x == other.max_x) and (self.max_y == other.max_y) ) elif isinstance(other, tuple) and len(other) == 4: return ( (self.min_x == other[0]) and (self.min_y == other[1]) and (self.max_x == other[2]) and (self.max_y == other[3]) ) else: raise GDALException("Equivalence testing only works with other Envelopes.") def __str__(self): "Return a string representation of the tuple." return str(self.tuple) def _from_sequence(self, seq): "Initialize the C OGR Envelope structure from the given sequence." self._envelope = OGREnvelope() self._envelope.MinX = seq[0] self._envelope.MinY = seq[1] self._envelope.MaxX = seq[2] self._envelope.MaxY = seq[3] def expand_to_include(self, *args): """ Modify the envelope to expand to include the boundaries of the passed-in 2-tuple (a point), 4-tuple (an extent) or envelope. """ # We provide a number of different signatures for this method, # and the logic here is all about converting them into a # 4-tuple single parameter which does the actual work of # expanding the envelope. if len(args) == 1: if isinstance(args[0], Envelope): return self.expand_to_include(args[0].tuple) elif hasattr(args[0], "x") and hasattr(args[0], "y"): return self.expand_to_include( args[0].x, args[0].y, args[0].x, args[0].y ) elif isinstance(args[0], (tuple, list)): # A tuple was passed in. if len(args[0]) == 2: return self.expand_to_include( (args[0][0], args[0][1], args[0][0], args[0][1]) ) elif len(args[0]) == 4: (minx, miny, maxx, maxy) = args[0] if minx < self._envelope.MinX: self._envelope.MinX = minx if miny < self._envelope.MinY: self._envelope.MinY = miny if maxx > self._envelope.MaxX: self._envelope.MaxX = maxx if maxy > self._envelope.MaxY: self._envelope.MaxY = maxy else: raise GDALException( "Incorrect number of tuple elements (%d)." % len(args[0]) ) else: raise TypeError("Incorrect type of argument: %s" % type(args[0])) elif len(args) == 2: # An x and an y parameter were passed in return self.expand_to_include((args[0], args[1], args[0], args[1])) elif len(args) == 4: # Individual parameters passed in. return self.expand_to_include(args) else: raise GDALException("Incorrect number (%d) of arguments." % len(args[0])) @property def min_x(self): "Return the value of the minimum X coordinate." return self._envelope.MinX @property def min_y(self): "Return the value of the minimum Y coordinate." return self._envelope.MinY @property def max_x(self): "Return the value of the maximum X coordinate." return self._envelope.MaxX @property def max_y(self): "Return the value of the maximum Y coordinate." return self._envelope.MaxY @property def ur(self): "Return the upper-right coordinate." return (self.max_x, self.max_y) @property def ll(self): "Return the lower-left coordinate." return (self.min_x, self.min_y) @property def tuple(self): "Return a tuple representing the envelope." return (self.min_x, self.min_y, self.max_x, self.max_y) @property def wkt(self): "Return WKT representing a Polygon for this envelope." # TODO: Fix significant figures. return "POLYGON((%s %s,%s %s,%s %s,%s %s,%s %s))" % ( self.min_x, self.min_y, self.min_x, self.max_y, self.max_x, self.max_y, self.max_x, self.min_y, self.min_x, self.min_y, )
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/envelope.py
Python
mit
7,323
""" This module houses the GDAL & SRS Exception objects, and the check_err() routine which checks the status code returned by GDAL/OGR methods. """ # #### GDAL & SRS Exceptions #### class GDALException(Exception): pass class SRSException(Exception): pass # #### GDAL/OGR error checking codes and routine #### # OGR Error Codes OGRERR_DICT = { 1: (GDALException, "Not enough data."), 2: (GDALException, "Not enough memory."), 3: (GDALException, "Unsupported geometry type."), 4: (GDALException, "Unsupported operation."), 5: (GDALException, "Corrupt data."), 6: (GDALException, "OGR failure."), 7: (SRSException, "Unsupported SRS."), 8: (GDALException, "Invalid handle."), } # CPL Error Codes # https://gdal.org/api/cpl.html#cpl-error-h CPLERR_DICT = { 1: (GDALException, "AppDefined"), 2: (GDALException, "OutOfMemory"), 3: (GDALException, "FileIO"), 4: (GDALException, "OpenFailed"), 5: (GDALException, "IllegalArg"), 6: (GDALException, "NotSupported"), 7: (GDALException, "AssertionFailed"), 8: (GDALException, "NoWriteAccess"), 9: (GDALException, "UserInterrupt"), 10: (GDALException, "ObjectNull"), } ERR_NONE = 0 def check_err(code, cpl=False): """ Check the given CPL/OGRERR and raise an exception where appropriate. """ err_dict = CPLERR_DICT if cpl else OGRERR_DICT if code == ERR_NONE: return elif code in err_dict: e, msg = err_dict[code] raise e(msg) else: raise GDALException('Unknown error code: "%s"' % code)
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/error.py
Python
mit
1,578
from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.field import Field from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType from django.contrib.gis.gdal.prototypes import ds as capi from django.contrib.gis.gdal.prototypes import geom as geom_api from django.utils.encoding import force_bytes, force_str # For more information, see the OGR C API source code: # https://gdal.org/api/vector_c_api.html # # The OGR_F_* routines are relevant here. class Feature(GDALBase): """ This class that wraps an OGR Feature, needs to be instantiated from a Layer object. """ destructor = capi.destroy_feature def __init__(self, feat, layer): """ Initialize Feature from a pointer and its Layer object. """ if not feat: raise GDALException("Cannot create OGR Feature, invalid pointer given.") self.ptr = feat self._layer = layer def __getitem__(self, index): """ Get the Field object at the specified index, which may be either an integer or the Field's string label. Note that the Field object is not the field's _value_ -- use the `get` method instead to retrieve the value (e.g. an integer) instead of a Field instance. """ if isinstance(index, str): i = self.index(index) elif 0 <= index < self.num_fields: i = index else: raise IndexError( "Index out of range when accessing field in a feature: %s." % index ) return Field(self, i) def __len__(self): "Return the count of fields in this feature." return self.num_fields def __str__(self): "The string name of the feature." return "Feature FID %d in Layer<%s>" % (self.fid, self.layer_name) def __eq__(self, other): "Do equivalence testing on the features." return bool(capi.feature_equal(self.ptr, other._ptr)) # #### Feature Properties #### @property def encoding(self): return self._layer._ds.encoding @property def fid(self): "Return the feature identifier." return capi.get_fid(self.ptr) @property def layer_name(self): "Return the name of the layer for the feature." name = capi.get_feat_name(self._layer._ldefn) return force_str(name, self.encoding, strings_only=True) @property def num_fields(self): "Return the number of fields in the Feature." return capi.get_feat_field_count(self.ptr) @property def fields(self): "Return a list of fields in the Feature." return [ force_str( capi.get_field_name(capi.get_field_defn(self._layer._ldefn, i)), self.encoding, strings_only=True, ) for i in range(self.num_fields) ] @property def geom(self): "Return the OGR Geometry for this Feature." # Retrieving the geometry pointer for the feature. geom_ptr = capi.get_feat_geom_ref(self.ptr) return OGRGeometry(geom_api.clone_geom(geom_ptr)) @property def geom_type(self): "Return the OGR Geometry Type for this Feature." return OGRGeomType(capi.get_fd_geom_type(self._layer._ldefn)) # #### Feature Methods #### def get(self, field): """ Return the value of the field, instead of an instance of the Field object. May take a string of the field name or a Field object as parameters. """ field_name = getattr(field, "name", field) return self[field_name].value def index(self, field_name): "Return the index of the given field name." i = capi.get_field_index(self.ptr, force_bytes(field_name)) if i < 0: raise IndexError("Invalid OFT field name given: %s." % field_name) return i
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/feature.py
Python
mit
4,017
from ctypes import byref, c_int from datetime import date, datetime, time from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import ds as capi from django.utils.encoding import force_str # For more information, see the OGR C API source code: # https://gdal.org/api/vector_c_api.html # # The OGR_Fld_* routines are relevant here. class Field(GDALBase): """ Wrap an OGR Field. Needs to be instantiated from a Feature object. """ def __init__(self, feat, index): """ Initialize on the feature object and the integer index of the field within the feature. """ # Setting the feature pointer and index. self._feat = feat self._index = index # Getting the pointer for this field. fld_ptr = capi.get_feat_field_defn(feat.ptr, index) if not fld_ptr: raise GDALException("Cannot create OGR Field, invalid pointer given.") self.ptr = fld_ptr # Setting the class depending upon the OGR Field Type (OFT) self.__class__ = OGRFieldTypes[self.type] def __str__(self): "Return the string representation of the Field." return str(self.value).strip() # #### Field Methods #### def as_double(self): "Retrieve the Field's value as a double (float)." return ( capi.get_field_as_double(self._feat.ptr, self._index) if self.is_set else None ) def as_int(self, is_64=False): "Retrieve the Field's value as an integer." if is_64: return ( capi.get_field_as_integer64(self._feat.ptr, self._index) if self.is_set else None ) else: return ( capi.get_field_as_integer(self._feat.ptr, self._index) if self.is_set else None ) def as_string(self): "Retrieve the Field's value as a string." if not self.is_set: return None string = capi.get_field_as_string(self._feat.ptr, self._index) return force_str(string, encoding=self._feat.encoding, strings_only=True) def as_datetime(self): "Retrieve the Field's value as a tuple of date & time components." if not self.is_set: return None yy, mm, dd, hh, mn, ss, tz = [c_int() for i in range(7)] status = capi.get_field_as_datetime( self._feat.ptr, self._index, byref(yy), byref(mm), byref(dd), byref(hh), byref(mn), byref(ss), byref(tz), ) if status: return (yy, mm, dd, hh, mn, ss, tz) else: raise GDALException( "Unable to retrieve date & time information from the field." ) # #### Field Properties #### @property def is_set(self): "Return True if the value of this field isn't null, False otherwise." return capi.is_field_set(self._feat.ptr, self._index) @property def name(self): "Return the name of this Field." name = capi.get_field_name(self.ptr) return force_str(name, encoding=self._feat.encoding, strings_only=True) @property def precision(self): "Return the precision of this Field." return capi.get_field_precision(self.ptr) @property def type(self): "Return the OGR type of this Field." return capi.get_field_type(self.ptr) @property def type_name(self): "Return the OGR field type name for this Field." return capi.get_field_type_name(self.type) @property def value(self): "Return the value of this Field." # Default is to get the field as a string. return self.as_string() @property def width(self): "Return the width of this Field." return capi.get_field_width(self.ptr) # ### The Field sub-classes for each OGR Field type. ### class OFTInteger(Field): _bit64 = False @property def value(self): "Return an integer contained in this field." return self.as_int(self._bit64) @property def type(self): """ GDAL uses OFTReals to represent OFTIntegers in created shapefiles -- forcing the type here since the underlying field type may actually be OFTReal. """ return 0 class OFTReal(Field): @property def value(self): "Return a float contained in this field." return self.as_double() # String & Binary fields, just subclasses class OFTString(Field): pass class OFTWideString(Field): pass class OFTBinary(Field): pass # OFTDate, OFTTime, OFTDateTime fields. class OFTDate(Field): @property def value(self): "Return a Python `date` object for the OFTDate field." try: yy, mm, dd, hh, mn, ss, tz = self.as_datetime() return date(yy.value, mm.value, dd.value) except (TypeError, ValueError, GDALException): return None class OFTDateTime(Field): @property def value(self): "Return a Python `datetime` object for this OFTDateTime field." # TODO: Adapt timezone information. # See https://lists.osgeo.org/pipermail/gdal-dev/2006-February/007990.html # The `tz` variable has values of: 0=unknown, 1=localtime (ambiguous), # 100=GMT, 104=GMT+1, 80=GMT-5, etc. try: yy, mm, dd, hh, mn, ss, tz = self.as_datetime() return datetime(yy.value, mm.value, dd.value, hh.value, mn.value, ss.value) except (TypeError, ValueError, GDALException): return None class OFTTime(Field): @property def value(self): "Return a Python `time` object for this OFTTime field." try: yy, mm, dd, hh, mn, ss, tz = self.as_datetime() return time(hh.value, mn.value, ss.value) except (ValueError, GDALException): return None class OFTInteger64(OFTInteger): _bit64 = True # List fields are also just subclasses class OFTIntegerList(Field): pass class OFTRealList(Field): pass class OFTStringList(Field): pass class OFTWideStringList(Field): pass class OFTInteger64List(Field): pass # Class mapping dictionary for OFT Types and reverse mapping. OGRFieldTypes = { 0: OFTInteger, 1: OFTIntegerList, 2: OFTReal, 3: OFTRealList, 4: OFTString, 5: OFTStringList, 6: OFTWideString, 7: OFTWideStringList, 8: OFTBinary, 9: OFTDate, 10: OFTTime, 11: OFTDateTime, 12: OFTInteger64, 13: OFTInteger64List, } ROGRFieldTypes = {cls: num for num, cls in OGRFieldTypes.items()}
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/field.py
Python
mit
6,886
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see https://gdal.org/api/ogrgeometry_cpp.html#_CPPv411OGRGeometry). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" unlike the traditional and "next-generation" OGR Python bindings. One major advantage OGR Geometries have over their GEOS counterparts is support for spatial reference systems and their transformation. Example: >>> from django.contrib.gis.gdal import OGRGeometry, OGRGeomType, SpatialReference >>> wkt1, wkt2 = 'POINT(-90 30)', 'POLYGON((0 0, 5 0, 5 5, 0 5)' >>> pnt = OGRGeometry(wkt1) >>> print(pnt) POINT (-90 30) >>> mpnt = OGRGeometry(OGRGeomType('MultiPoint'), SpatialReference('WGS84')) >>> mpnt.add(wkt1) >>> mpnt.add(wkt1) >>> print(mpnt) MULTIPOINT (-90 30,-90 30) >>> print(mpnt.srs.name) WGS 84 >>> print(mpnt.srs.proj) +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs >>> mpnt.transform(SpatialReference('NAD27')) >>> print(mpnt.proj) +proj=longlat +ellps=clrk66 +datum=NAD27 +no_defs >>> print(mpnt) MULTIPOINT (-89.99993037860248 29.99979788655764,-89.99993037860248 29.99979788655764) The OGRGeomType class is to make it easy to specify an OGR geometry type: >>> from django.contrib.gis.gdal import OGRGeomType >>> gt1 = OGRGeomType(3) # Using an integer for the type >>> gt2 = OGRGeomType('Polygon') # Using a string >>> gt3 = OGRGeomType('POLYGON') # It's case-insensitive >>> print(gt1 == 3, gt1 == 'Polygon') # Equivalence works w/non-OGRGeomType objects True True """ import sys from binascii import b2a_hex from ctypes import byref, c_char_p, c_double, c_ubyte, c_void_p, string_at from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope from django.contrib.gis.gdal.error import GDALException, SRSException from django.contrib.gis.gdal.geomtype import OGRGeomType from django.contrib.gis.gdal.prototypes import geom as capi from django.contrib.gis.gdal.prototypes import srs as srs_api from django.contrib.gis.gdal.srs import CoordTransform, SpatialReference from django.contrib.gis.geometry import hex_regex, json_regex, wkt_regex from django.utils.encoding import force_bytes # For more information, see the OGR C API source code: # https://gdal.org/api/vector_c_api.html # # The OGR_G_* routines are relevant here. class OGRGeometry(GDALBase): """Encapsulate an OGR geometry.""" destructor = capi.destroy_geom def __init__(self, geom_input, srs=None): """Initialize Geometry on either WKT or an OGR pointer as input.""" str_instance = isinstance(geom_input, str) # If HEX, unpack input to a binary buffer. if str_instance and hex_regex.match(geom_input): geom_input = memoryview(bytes.fromhex(geom_input)) str_instance = False # Constructing the geometry, if str_instance: wkt_m = wkt_regex.match(geom_input) json_m = json_regex.match(geom_input) if wkt_m: if wkt_m["srid"]: # If there's EWKT, set the SRS w/value of the SRID. srs = int(wkt_m["srid"]) if wkt_m["type"].upper() == "LINEARRING": # OGR_G_CreateFromWkt doesn't work with LINEARRING WKT. # See https://trac.osgeo.org/gdal/ticket/1992. g = capi.create_geom(OGRGeomType(wkt_m["type"]).num) capi.import_wkt(g, byref(c_char_p(wkt_m["wkt"].encode()))) else: g = capi.from_wkt( byref(c_char_p(wkt_m["wkt"].encode())), None, byref(c_void_p()) ) elif json_m: g = self._from_json(geom_input.encode()) else: # Seeing if the input is a valid short-hand string # (e.g., 'Point', 'POLYGON'). OGRGeomType(geom_input) g = capi.create_geom(OGRGeomType(geom_input).num) elif isinstance(geom_input, memoryview): # WKB was passed in g = self._from_wkb(geom_input) elif isinstance(geom_input, OGRGeomType): # OGRGeomType was passed in, an empty geometry will be created. g = capi.create_geom(geom_input.num) elif isinstance(geom_input, self.ptr_type): # OGR pointer (c_void_p) was the input. g = geom_input else: raise GDALException( "Invalid input type for OGR Geometry construction: %s" % type(geom_input) ) # Now checking the Geometry pointer before finishing initialization # by setting the pointer for the object. if not g: raise GDALException( "Cannot create OGR Geometry from input: %s" % geom_input ) self.ptr = g # Assigning the SpatialReference object to the geometry, if valid. if srs: self.srs = srs # Setting the class depending upon the OGR Geometry Type self.__class__ = GEO_CLASSES[self.geom_type.num] # Pickle routines def __getstate__(self): srs = self.srs if srs: srs = srs.wkt else: srs = None return bytes(self.wkb), srs def __setstate__(self, state): wkb, srs = state ptr = capi.from_wkb(wkb, None, byref(c_void_p()), len(wkb)) if not ptr: raise GDALException("Invalid OGRGeometry loaded from pickled state.") self.ptr = ptr self.srs = srs @classmethod def _from_wkb(cls, geom_input): return capi.from_wkb( bytes(geom_input), None, byref(c_void_p()), len(geom_input) ) @staticmethod def _from_json(geom_input): return capi.from_json(geom_input) @classmethod def from_bbox(cls, bbox): "Construct a Polygon from a bounding box (4-tuple)." x0, y0, x1, y1 = bbox return OGRGeometry( "POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s))" % (x0, y0, x0, y1, x1, y1, x1, y0, x0, y0) ) @staticmethod def from_json(geom_input): return OGRGeometry(OGRGeometry._from_json(force_bytes(geom_input))) @classmethod def from_gml(cls, gml_string): return cls(capi.from_gml(force_bytes(gml_string))) # ### Geometry set-like operations ### # g = g1 | g2 def __or__(self, other): "Return the union of the two geometries." return self.union(other) # g = g1 & g2 def __and__(self, other): "Return the intersection of this Geometry and the other." return self.intersection(other) # g = g1 - g2 def __sub__(self, other): "Return the difference this Geometry and the other." return self.difference(other) # g = g1 ^ g2 def __xor__(self, other): "Return the symmetric difference of this Geometry and the other." return self.sym_difference(other) def __eq__(self, other): "Is this Geometry equal to the other?" return isinstance(other, OGRGeometry) and self.equals(other) def __str__(self): "WKT is used for the string representation." return self.wkt # #### Geometry Properties #### @property def dimension(self): "Return 0 for points, 1 for lines, and 2 for surfaces." return capi.get_dims(self.ptr) def _get_coord_dim(self): "Return the coordinate dimension of the Geometry." return capi.get_coord_dim(self.ptr) def _set_coord_dim(self, dim): "Set the coordinate dimension of this Geometry." if dim not in (2, 3): raise ValueError("Geometry dimension must be either 2 or 3") capi.set_coord_dim(self.ptr, dim) coord_dim = property(_get_coord_dim, _set_coord_dim) @property def geom_count(self): "Return the number of elements in this Geometry." return capi.get_geom_count(self.ptr) @property def point_count(self): "Return the number of Points in this Geometry." return capi.get_point_count(self.ptr) @property def num_points(self): "Alias for `point_count` (same name method in GEOS API.)" return self.point_count @property def num_coords(self): "Alias for `point_count`." return self.point_count @property def geom_type(self): "Return the Type for this Geometry." return OGRGeomType(capi.get_geom_type(self.ptr)) @property def geom_name(self): "Return the Name of this Geometry." return capi.get_geom_name(self.ptr) @property def area(self): "Return the area for a LinearRing, Polygon, or MultiPolygon; 0 otherwise." return capi.get_area(self.ptr) @property def envelope(self): "Return the envelope for this Geometry." # TODO: Fix Envelope() for Point geometries. return Envelope(capi.get_envelope(self.ptr, byref(OGREnvelope()))) @property def empty(self): return capi.is_empty(self.ptr) @property def extent(self): "Return the envelope as a 4-tuple, instead of as an Envelope object." return self.envelope.tuple # #### SpatialReference-related Properties #### # The SRS property def _get_srs(self): "Return the Spatial Reference for this Geometry." try: srs_ptr = capi.get_geom_srs(self.ptr) return SpatialReference(srs_api.clone_srs(srs_ptr)) except SRSException: return None def _set_srs(self, srs): "Set the SpatialReference for this geometry." # Do not have to clone the `SpatialReference` object pointer because # when it is assigned to this `OGRGeometry` it's internal OGR # reference count is incremented, and will likewise be released # (decremented) when this geometry's destructor is called. if isinstance(srs, SpatialReference): srs_ptr = srs.ptr elif isinstance(srs, (int, str)): sr = SpatialReference(srs) srs_ptr = sr.ptr elif srs is None: srs_ptr = None else: raise TypeError( "Cannot assign spatial reference with object of type: %s" % type(srs) ) capi.assign_srs(self.ptr, srs_ptr) srs = property(_get_srs, _set_srs) # The SRID property def _get_srid(self): srs = self.srs if srs: return srs.srid return None def _set_srid(self, srid): if isinstance(srid, int) or srid is None: self.srs = srid else: raise TypeError("SRID must be set with an integer.") srid = property(_get_srid, _set_srid) # #### Output Methods #### def _geos_ptr(self): from django.contrib.gis.geos import GEOSGeometry return GEOSGeometry._from_wkb(self.wkb) @property def geos(self): "Return a GEOSGeometry object from this OGRGeometry." from django.contrib.gis.geos import GEOSGeometry return GEOSGeometry(self._geos_ptr(), self.srid) @property def gml(self): "Return the GML representation of the Geometry." return capi.to_gml(self.ptr) @property def hex(self): "Return the hexadecimal representation of the WKB (a string)." return b2a_hex(self.wkb).upper() @property def json(self): """ Return the GeoJSON representation of this Geometry. """ return capi.to_json(self.ptr) geojson = json @property def kml(self): "Return the KML representation of the Geometry." return capi.to_kml(self.ptr, None) @property def wkb_size(self): "Return the size of the WKB buffer." return capi.get_wkbsize(self.ptr) @property def wkb(self): "Return the WKB representation of the Geometry." if sys.byteorder == "little": byteorder = 1 # wkbNDR (from ogr_core.h) else: byteorder = 0 # wkbXDR sz = self.wkb_size # Creating the unsigned character buffer, and passing it in by reference. buf = (c_ubyte * sz)() capi.to_wkb(self.ptr, byteorder, byref(buf)) # Returning a buffer of the string at the pointer. return memoryview(string_at(buf, sz)) @property def wkt(self): "Return the WKT representation of the Geometry." return capi.to_wkt(self.ptr, byref(c_char_p())) @property def ewkt(self): "Return the EWKT representation of the Geometry." srs = self.srs if srs and srs.srid: return "SRID=%s;%s" % (srs.srid, self.wkt) else: return self.wkt # #### Geometry Methods #### def clone(self): "Clone this OGR Geometry." return OGRGeometry(capi.clone_geom(self.ptr), self.srs) def close_rings(self): """ If there are any rings within this geometry that have not been closed, this routine will do so by adding the starting point at the end. """ # Closing the open rings. capi.geom_close_rings(self.ptr) def transform(self, coord_trans, clone=False): """ Transform this geometry to a different spatial reference system. May take a CoordTransform object, a SpatialReference object, string WKT or PROJ, and/or an integer SRID. By default, return nothing and transform the geometry in-place. However, if the `clone` keyword is set, return a transformed clone of this geometry. """ if clone: klone = self.clone() klone.transform(coord_trans) return klone # Depending on the input type, use the appropriate OGR routine # to perform the transformation. if isinstance(coord_trans, CoordTransform): capi.geom_transform(self.ptr, coord_trans.ptr) elif isinstance(coord_trans, SpatialReference): capi.geom_transform_to(self.ptr, coord_trans.ptr) elif isinstance(coord_trans, (int, str)): sr = SpatialReference(coord_trans) capi.geom_transform_to(self.ptr, sr.ptr) else: raise TypeError( "Transform only accepts CoordTransform, " "SpatialReference, string, and integer objects." ) # #### Topology Methods #### def _topology(self, func, other): """A generalized function for topology operations, takes a GDAL function and the other geometry to perform the operation on.""" if not isinstance(other, OGRGeometry): raise TypeError( "Must use another OGRGeometry object for topology operations!" ) # Returning the output of the given function with the other geometry's # pointer. return func(self.ptr, other.ptr) def intersects(self, other): "Return True if this geometry intersects with the other." return self._topology(capi.ogr_intersects, other) def equals(self, other): "Return True if this geometry is equivalent to the other." return self._topology(capi.ogr_equals, other) def disjoint(self, other): "Return True if this geometry and the other are spatially disjoint." return self._topology(capi.ogr_disjoint, other) def touches(self, other): "Return True if this geometry touches the other." return self._topology(capi.ogr_touches, other) def crosses(self, other): "Return True if this geometry crosses the other." return self._topology(capi.ogr_crosses, other) def within(self, other): "Return True if this geometry is within the other." return self._topology(capi.ogr_within, other) def contains(self, other): "Return True if this geometry contains the other." return self._topology(capi.ogr_contains, other) def overlaps(self, other): "Return True if this geometry overlaps the other." return self._topology(capi.ogr_overlaps, other) # #### Geometry-generation Methods #### def _geomgen(self, gen_func, other=None): "A helper routine for the OGR routines that generate geometries." if isinstance(other, OGRGeometry): return OGRGeometry(gen_func(self.ptr, other.ptr), self.srs) else: return OGRGeometry(gen_func(self.ptr), self.srs) @property def boundary(self): "Return the boundary of this geometry." return self._geomgen(capi.get_boundary) @property def convex_hull(self): """ Return the smallest convex Polygon that contains all the points in this Geometry. """ return self._geomgen(capi.geom_convex_hull) def difference(self, other): """ Return a new geometry consisting of the region which is the difference of this geometry and the other. """ return self._geomgen(capi.geom_diff, other) def intersection(self, other): """ Return a new geometry consisting of the region of intersection of this geometry and the other. """ return self._geomgen(capi.geom_intersection, other) def sym_difference(self, other): """ Return a new geometry which is the symmetric difference of this geometry and the other. """ return self._geomgen(capi.geom_sym_diff, other) def union(self, other): """ Return a new geometry consisting of the region which is the union of this geometry and the other. """ return self._geomgen(capi.geom_union, other) # The subclasses for OGR Geometry. class Point(OGRGeometry): def _geos_ptr(self): from django.contrib.gis import geos return geos.Point._create_empty() if self.empty else super()._geos_ptr() @classmethod def _create_empty(cls): return capi.create_geom(OGRGeomType("point").num) @property def x(self): "Return the X coordinate for this Point." return capi.getx(self.ptr, 0) @property def y(self): "Return the Y coordinate for this Point." return capi.gety(self.ptr, 0) @property def z(self): "Return the Z coordinate for this Point." if self.coord_dim == 3: return capi.getz(self.ptr, 0) @property def tuple(self): "Return the tuple of this point." if self.coord_dim == 2: return (self.x, self.y) elif self.coord_dim == 3: return (self.x, self.y, self.z) coords = tuple class LineString(OGRGeometry): def __getitem__(self, index): "Return the Point at the given index." if 0 <= index < self.point_count: x, y, z = c_double(), c_double(), c_double() capi.get_point(self.ptr, index, byref(x), byref(y), byref(z)) dim = self.coord_dim if dim == 1: return (x.value,) elif dim == 2: return (x.value, y.value) elif dim == 3: return (x.value, y.value, z.value) else: raise IndexError( "Index out of range when accessing points of a line string: %s." % index ) def __len__(self): "Return the number of points in the LineString." return self.point_count @property def tuple(self): "Return the tuple representation of this LineString." return tuple(self[i] for i in range(len(self))) coords = tuple def _listarr(self, func): """ Internal routine that returns a sequence (list) corresponding with the given function. """ return [func(self.ptr, i) for i in range(len(self))] @property def x(self): "Return the X coordinates in a list." return self._listarr(capi.getx) @property def y(self): "Return the Y coordinates in a list." return self._listarr(capi.gety) @property def z(self): "Return the Z coordinates in a list." if self.coord_dim == 3: return self._listarr(capi.getz) # LinearRings are used in Polygons. class LinearRing(LineString): pass class Polygon(OGRGeometry): def __len__(self): "Return the number of interior rings in this Polygon." return self.geom_count def __getitem__(self, index): "Get the ring at the specified index." if 0 <= index < self.geom_count: return OGRGeometry( capi.clone_geom(capi.get_geom_ref(self.ptr, index)), self.srs ) else: raise IndexError( "Index out of range when accessing rings of a polygon: %s." % index ) # Polygon Properties @property def shell(self): "Return the shell of this Polygon." return self[0] # First ring is the shell exterior_ring = shell @property def tuple(self): "Return a tuple of LinearRing coordinate tuples." return tuple(self[i].tuple for i in range(self.geom_count)) coords = tuple @property def point_count(self): "Return the number of Points in this Polygon." # Summing up the number of points in each ring of the Polygon. return sum(self[i].point_count for i in range(self.geom_count)) @property def centroid(self): "Return the centroid (a Point) of this Polygon." # The centroid is a Point, create a geometry for this. p = OGRGeometry(OGRGeomType("Point")) capi.get_centroid(self.ptr, p.ptr) return p # Geometry Collection base class. class GeometryCollection(OGRGeometry): "The Geometry Collection class." def __getitem__(self, index): "Get the Geometry at the specified index." if 0 <= index < self.geom_count: return OGRGeometry( capi.clone_geom(capi.get_geom_ref(self.ptr, index)), self.srs ) else: raise IndexError( "Index out of range when accessing geometry in a collection: %s." % index ) def __len__(self): "Return the number of geometries in this Geometry Collection." return self.geom_count def add(self, geom): "Add the geometry to this Geometry Collection." if isinstance(geom, OGRGeometry): if isinstance(geom, self.__class__): for g in geom: capi.add_geom(self.ptr, g.ptr) else: capi.add_geom(self.ptr, geom.ptr) elif isinstance(geom, str): tmp = OGRGeometry(geom) capi.add_geom(self.ptr, tmp.ptr) else: raise GDALException("Must add an OGRGeometry.") @property def point_count(self): "Return the number of Points in this Geometry Collection." # Summing up the number of points in each geometry in this collection return sum(self[i].point_count for i in range(self.geom_count)) @property def tuple(self): "Return a tuple representation of this Geometry Collection." return tuple(self[i].tuple for i in range(self.geom_count)) coords = tuple # Multiple Geometry types. class MultiPoint(GeometryCollection): pass class MultiLineString(GeometryCollection): pass class MultiPolygon(GeometryCollection): pass # Class mapping dictionary (using the OGRwkbGeometryType as the key) GEO_CLASSES = { 1: Point, 2: LineString, 3: Polygon, 4: MultiPoint, 5: MultiLineString, 6: MultiPolygon, 7: GeometryCollection, 101: LinearRing, 1 + OGRGeomType.wkb25bit: Point, 2 + OGRGeomType.wkb25bit: LineString, 3 + OGRGeomType.wkb25bit: Polygon, 4 + OGRGeomType.wkb25bit: MultiPoint, 5 + OGRGeomType.wkb25bit: MultiLineString, 6 + OGRGeomType.wkb25bit: MultiPolygon, 7 + OGRGeomType.wkb25bit: GeometryCollection, }
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/geometries.py
Python
mit
24,346
from django.contrib.gis.gdal.error import GDALException class OGRGeomType: "Encapsulate OGR Geometry Types." wkb25bit = -2147483648 # Dictionary of acceptable OGRwkbGeometryType s and their string names. _types = { 0: "Unknown", 1: "Point", 2: "LineString", 3: "Polygon", 4: "MultiPoint", 5: "MultiLineString", 6: "MultiPolygon", 7: "GeometryCollection", 100: "None", 101: "LinearRing", 102: "PointZ", 1 + wkb25bit: "Point25D", 2 + wkb25bit: "LineString25D", 3 + wkb25bit: "Polygon25D", 4 + wkb25bit: "MultiPoint25D", 5 + wkb25bit: "MultiLineString25D", 6 + wkb25bit: "MultiPolygon25D", 7 + wkb25bit: "GeometryCollection25D", } # Reverse type dictionary, keyed by lowercase of the name. _str_types = {v.lower(): k for k, v in _types.items()} def __init__(self, type_input): "Figure out the correct OGR Type based upon the input." if isinstance(type_input, OGRGeomType): num = type_input.num elif isinstance(type_input, str): type_input = type_input.lower() if type_input == "geometry": type_input = "unknown" num = self._str_types.get(type_input) if num is None: raise GDALException('Invalid OGR String Type "%s"' % type_input) elif isinstance(type_input, int): if type_input not in self._types: raise GDALException("Invalid OGR Integer Type: %d" % type_input) num = type_input else: raise TypeError("Invalid OGR input type given.") # Setting the OGR geometry type number. self.num = num def __str__(self): "Return the value of the name property." return self.name def __eq__(self, other): """ Do an equivalence test on the OGR type with the given other OGRGeomType, the short-hand string, or the integer. """ if isinstance(other, OGRGeomType): return self.num == other.num elif isinstance(other, str): return self.name.lower() == other.lower() elif isinstance(other, int): return self.num == other else: return False @property def name(self): "Return a short-hand string form of the OGR Geometry type." return self._types[self.num] @property def django(self): "Return the Django GeometryField for this OGR Type." s = self.name.replace("25D", "") if s in ("LinearRing", "None"): return None elif s == "Unknown": s = "Geometry" elif s == "PointZ": s = "Point" return s + "Field" def to_multi(self): """ Transform Point, LineString, Polygon, and their 25D equivalents to their Multi... counterpart. """ if self.name.startswith(("Point", "LineString", "Polygon")): self.num += 3
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/geomtype.py
Python
mit
3,071
from ctypes import byref, c_double from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope from django.contrib.gis.gdal.error import GDALException, SRSException from django.contrib.gis.gdal.feature import Feature from django.contrib.gis.gdal.field import OGRFieldTypes from django.contrib.gis.gdal.geometries import OGRGeometry from django.contrib.gis.gdal.geomtype import OGRGeomType from django.contrib.gis.gdal.prototypes import ds as capi from django.contrib.gis.gdal.prototypes import geom as geom_api from django.contrib.gis.gdal.prototypes import srs as srs_api from django.contrib.gis.gdal.srs import SpatialReference from django.utils.encoding import force_bytes, force_str # For more information, see the OGR C API source code: # https://gdal.org/api/vector_c_api.html # # The OGR_L_* routines are relevant here. class Layer(GDALBase): """ A class that wraps an OGR Layer, needs to be instantiated from a DataSource object. """ def __init__(self, layer_ptr, ds): """ Initialize on an OGR C pointer to the Layer and the `DataSource` object that owns this layer. The `DataSource` object is required so that a reference to it is kept with this Layer. This prevents garbage collection of the `DataSource` while this Layer is still active. """ if not layer_ptr: raise GDALException("Cannot create Layer, invalid pointer given") self.ptr = layer_ptr self._ds = ds self._ldefn = capi.get_layer_defn(self._ptr) # Does the Layer support random reading? self._random_read = self.test_capability(b"RandomRead") def __getitem__(self, index): "Get the Feature at the specified index." if isinstance(index, int): # An integer index was given -- we cannot do a check based on the # number of features because the beginning and ending feature IDs # are not guaranteed to be 0 and len(layer)-1, respectively. if index < 0: raise IndexError("Negative indices are not allowed on OGR Layers.") return self._make_feature(index) elif isinstance(index, slice): # A slice was given start, stop, stride = index.indices(self.num_feat) return [self._make_feature(fid) for fid in range(start, stop, stride)] else: raise TypeError( "Integers and slices may only be used when indexing OGR Layers." ) def __iter__(self): "Iterate over each Feature in the Layer." # ResetReading() must be called before iteration is to begin. capi.reset_reading(self._ptr) for i in range(self.num_feat): yield Feature(capi.get_next_feature(self._ptr), self) def __len__(self): "The length is the number of features." return self.num_feat def __str__(self): "The string name of the layer." return self.name def _make_feature(self, feat_id): """ Helper routine for __getitem__ that constructs a Feature from the given Feature ID. If the OGR Layer does not support random-access reading, then each feature of the layer will be incremented through until the a Feature is found matching the given feature ID. """ if self._random_read: # If the Layer supports random reading, return. try: return Feature(capi.get_feature(self.ptr, feat_id), self) except GDALException: pass else: # Random access isn't supported, have to increment through # each feature until the given feature ID is encountered. for feat in self: if feat.fid == feat_id: return feat # Should have returned a Feature, raise an IndexError. raise IndexError("Invalid feature id: %s." % feat_id) # #### Layer properties #### @property def extent(self): "Return the extent (an Envelope) of this layer." env = OGREnvelope() capi.get_extent(self.ptr, byref(env), 1) return Envelope(env) @property def name(self): "Return the name of this layer in the Data Source." name = capi.get_fd_name(self._ldefn) return force_str(name, self._ds.encoding, strings_only=True) @property def num_feat(self, force=1): "Return the number of features in the Layer." return capi.get_feature_count(self.ptr, force) @property def num_fields(self): "Return the number of fields in the Layer." return capi.get_field_count(self._ldefn) @property def geom_type(self): "Return the geometry type (OGRGeomType) of the Layer." return OGRGeomType(capi.get_fd_geom_type(self._ldefn)) @property def srs(self): "Return the Spatial Reference used in this Layer." try: ptr = capi.get_layer_srs(self.ptr) return SpatialReference(srs_api.clone_srs(ptr)) except SRSException: return None @property def fields(self): """ Return a list of string names corresponding to each of the Fields available in this Layer. """ return [ force_str( capi.get_field_name(capi.get_field_defn(self._ldefn, i)), self._ds.encoding, strings_only=True, ) for i in range(self.num_fields) ] @property def field_types(self): """ Return a list of the types of fields in this Layer. For example, return the list [OFTInteger, OFTReal, OFTString] for an OGR layer that has an integer, a floating-point, and string fields. """ return [ OGRFieldTypes[capi.get_field_type(capi.get_field_defn(self._ldefn, i))] for i in range(self.num_fields) ] @property def field_widths(self): "Return a list of the maximum field widths for the features." return [ capi.get_field_width(capi.get_field_defn(self._ldefn, i)) for i in range(self.num_fields) ] @property def field_precisions(self): "Return the field precisions for the features." return [ capi.get_field_precision(capi.get_field_defn(self._ldefn, i)) for i in range(self.num_fields) ] def _get_spatial_filter(self): try: return OGRGeometry(geom_api.clone_geom(capi.get_spatial_filter(self.ptr))) except GDALException: return None def _set_spatial_filter(self, filter): if isinstance(filter, OGRGeometry): capi.set_spatial_filter(self.ptr, filter.ptr) elif isinstance(filter, (tuple, list)): if not len(filter) == 4: raise ValueError("Spatial filter list/tuple must have 4 elements.") # Map c_double onto params -- if a bad type is passed in it # will be caught here. xmin, ymin, xmax, ymax = map(c_double, filter) capi.set_spatial_filter_rect(self.ptr, xmin, ymin, xmax, ymax) elif filter is None: capi.set_spatial_filter(self.ptr, None) else: raise TypeError( "Spatial filter must be either an OGRGeometry instance, a 4-tuple, or " "None." ) spatial_filter = property(_get_spatial_filter, _set_spatial_filter) # #### Layer Methods #### def get_fields(self, field_name): """ Return a list containing the given field name for every Feature in the Layer. """ if field_name not in self.fields: raise GDALException("invalid field name: %s" % field_name) return [feat.get(field_name) for feat in self] def get_geoms(self, geos=False): """ Return a list containing the OGRGeometry for every Feature in the Layer. """ if geos: from django.contrib.gis.geos import GEOSGeometry return [GEOSGeometry(feat.geom.wkb) for feat in self] else: return [feat.geom for feat in self] def test_capability(self, capability): """ Return a bool indicating whether the this Layer supports the given capability (a string). Valid capability strings include: 'RandomRead', 'SequentialWrite', 'RandomWrite', 'FastSpatialFilter', 'FastFeatureCount', 'FastGetExtent', 'CreateField', 'Transactions', 'DeleteFeature', and 'FastSetNextByIndex'. """ return bool(capi.test_capability(self.ptr, force_bytes(capability)))
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/layer.py
Python
mit
8,825
import logging import os import re from ctypes import CDLL, CFUNCTYPE, c_char_p, c_int from ctypes.util import find_library from django.contrib.gis.gdal.error import GDALException from django.core.exceptions import ImproperlyConfigured logger = logging.getLogger("django.contrib.gis") # Custom library path set? try: from django.conf import settings lib_path = settings.GDAL_LIBRARY_PATH except (AttributeError, ImportError, ImproperlyConfigured, OSError): lib_path = None if lib_path: lib_names = None elif os.name == "nt": # Windows NT shared libraries lib_names = [ "gdal306", "gdal305", "gdal304", "gdal303", "gdal302", "gdal301", "gdal300", "gdal204", "gdal203", "gdal202", ] elif os.name == "posix": # *NIX library names. lib_names = [ "gdal", "GDAL", "gdal3.6.0", "gdal3.5.0", "gdal3.4.0", "gdal3.3.0", "gdal3.2.0", "gdal3.1.0", "gdal3.0.0", "gdal2.4.0", "gdal2.3.0", "gdal2.2.0", ] else: raise ImproperlyConfigured('GDAL is unsupported on OS "%s".' % os.name) # Using the ctypes `find_library` utility to find the # path to the GDAL library from the list of library names. if lib_names: for lib_name in lib_names: lib_path = find_library(lib_name) if lib_path is not None: break if lib_path is None: raise ImproperlyConfigured( 'Could not find the GDAL library (tried "%s"). Is GDAL installed? ' "If it is, try setting GDAL_LIBRARY_PATH in your settings." % '", "'.join(lib_names) ) # This loads the GDAL/OGR C library lgdal = CDLL(lib_path) # On Windows, the GDAL binaries have some OSR routines exported with # STDCALL, while others are not. Thus, the library will also need to # be loaded up as WinDLL for said OSR functions that require the # different calling convention. if os.name == "nt": from ctypes import WinDLL lwingdal = WinDLL(lib_path) def std_call(func): """ Return the correct STDCALL function for certain OSR routines on Win32 platforms. """ if os.name == "nt": return lwingdal[func] else: return lgdal[func] # #### Version-information functions. #### # Return GDAL library version information with the given key. _version_info = std_call("GDALVersionInfo") _version_info.argtypes = [c_char_p] _version_info.restype = c_char_p def gdal_version(): "Return only the GDAL version number information." return _version_info(b"RELEASE_NAME") def gdal_full_version(): "Return the full GDAL version information." return _version_info(b"") def gdal_version_info(): ver = gdal_version() m = re.match(rb"^(?P<major>\d+)\.(?P<minor>\d+)(?:\.(?P<subminor>\d+))?", ver) if not m: raise GDALException('Could not parse GDAL version string "%s"' % ver) major, minor, subminor = m.groups() return (int(major), int(minor), subminor and int(subminor)) GDAL_VERSION = gdal_version_info() # Set library error handling so as errors are logged CPLErrorHandler = CFUNCTYPE(None, c_int, c_int, c_char_p) def err_handler(error_class, error_number, message): logger.error("GDAL_ERROR %d: %s", error_number, message) err_handler = CPLErrorHandler(err_handler) def function(name, args, restype): func = std_call(name) func.argtypes = args func.restype = restype return func set_error_handler = function("CPLSetErrorHandler", [CPLErrorHandler], CPLErrorHandler) set_error_handler(err_handler)
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/libgdal.py
Python
mit
3,618
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/prototypes/__init__.py
Python
mit
0
""" This module houses the ctypes function prototypes for OGR DataSource related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*, OGR_Fld_* routines are relevant here. """ from ctypes import POINTER, c_char_p, c_double, c_int, c_long, c_void_p from django.contrib.gis.gdal.envelope import OGREnvelope from django.contrib.gis.gdal.libgdal import lgdal from django.contrib.gis.gdal.prototypes.generation import ( bool_output, const_string_output, double_output, geom_output, int64_output, int_output, srs_output, void_output, voidptr_output, ) c_int_p = POINTER(c_int) # shortcut type # Driver Routines register_all = void_output(lgdal.OGRRegisterAll, [], errcheck=False) cleanup_all = void_output(lgdal.OGRCleanupAll, [], errcheck=False) get_driver = voidptr_output(lgdal.OGRGetDriver, [c_int]) get_driver_by_name = voidptr_output( lgdal.OGRGetDriverByName, [c_char_p], errcheck=False ) get_driver_count = int_output(lgdal.OGRGetDriverCount, []) get_driver_name = const_string_output( lgdal.OGR_Dr_GetName, [c_void_p], decoding="ascii" ) # DataSource open_ds = voidptr_output(lgdal.OGROpen, [c_char_p, c_int, POINTER(c_void_p)]) destroy_ds = void_output(lgdal.OGR_DS_Destroy, [c_void_p], errcheck=False) release_ds = void_output(lgdal.OGRReleaseDataSource, [c_void_p]) get_ds_name = const_string_output(lgdal.OGR_DS_GetName, [c_void_p]) get_layer = voidptr_output(lgdal.OGR_DS_GetLayer, [c_void_p, c_int]) get_layer_by_name = voidptr_output(lgdal.OGR_DS_GetLayerByName, [c_void_p, c_char_p]) get_layer_count = int_output(lgdal.OGR_DS_GetLayerCount, [c_void_p]) # Layer Routines get_extent = void_output(lgdal.OGR_L_GetExtent, [c_void_p, POINTER(OGREnvelope), c_int]) get_feature = voidptr_output(lgdal.OGR_L_GetFeature, [c_void_p, c_long]) get_feature_count = int_output(lgdal.OGR_L_GetFeatureCount, [c_void_p, c_int]) get_layer_defn = voidptr_output(lgdal.OGR_L_GetLayerDefn, [c_void_p]) get_layer_srs = srs_output(lgdal.OGR_L_GetSpatialRef, [c_void_p]) get_next_feature = voidptr_output(lgdal.OGR_L_GetNextFeature, [c_void_p]) reset_reading = void_output(lgdal.OGR_L_ResetReading, [c_void_p], errcheck=False) test_capability = int_output(lgdal.OGR_L_TestCapability, [c_void_p, c_char_p]) get_spatial_filter = geom_output(lgdal.OGR_L_GetSpatialFilter, [c_void_p]) set_spatial_filter = void_output( lgdal.OGR_L_SetSpatialFilter, [c_void_p, c_void_p], errcheck=False ) set_spatial_filter_rect = void_output( lgdal.OGR_L_SetSpatialFilterRect, [c_void_p, c_double, c_double, c_double, c_double], errcheck=False, ) # Feature Definition Routines get_fd_geom_type = int_output(lgdal.OGR_FD_GetGeomType, [c_void_p]) get_fd_name = const_string_output(lgdal.OGR_FD_GetName, [c_void_p]) get_feat_name = const_string_output(lgdal.OGR_FD_GetName, [c_void_p]) get_field_count = int_output(lgdal.OGR_FD_GetFieldCount, [c_void_p]) get_field_defn = voidptr_output(lgdal.OGR_FD_GetFieldDefn, [c_void_p, c_int]) # Feature Routines clone_feature = voidptr_output(lgdal.OGR_F_Clone, [c_void_p]) destroy_feature = void_output(lgdal.OGR_F_Destroy, [c_void_p], errcheck=False) feature_equal = int_output(lgdal.OGR_F_Equal, [c_void_p, c_void_p]) get_feat_geom_ref = geom_output(lgdal.OGR_F_GetGeometryRef, [c_void_p]) get_feat_field_count = int_output(lgdal.OGR_F_GetFieldCount, [c_void_p]) get_feat_field_defn = voidptr_output(lgdal.OGR_F_GetFieldDefnRef, [c_void_p, c_int]) get_fid = int_output(lgdal.OGR_F_GetFID, [c_void_p]) get_field_as_datetime = int_output( lgdal.OGR_F_GetFieldAsDateTime, [c_void_p, c_int, c_int_p, c_int_p, c_int_p, c_int_p, c_int_p, c_int_p], ) get_field_as_double = double_output(lgdal.OGR_F_GetFieldAsDouble, [c_void_p, c_int]) get_field_as_integer = int_output(lgdal.OGR_F_GetFieldAsInteger, [c_void_p, c_int]) get_field_as_integer64 = int64_output( lgdal.OGR_F_GetFieldAsInteger64, [c_void_p, c_int] ) is_field_set = bool_output(lgdal.OGR_F_IsFieldSetAndNotNull, [c_void_p, c_int]) get_field_as_string = const_string_output( lgdal.OGR_F_GetFieldAsString, [c_void_p, c_int] ) get_field_index = int_output(lgdal.OGR_F_GetFieldIndex, [c_void_p, c_char_p]) # Field Routines get_field_name = const_string_output(lgdal.OGR_Fld_GetNameRef, [c_void_p]) get_field_precision = int_output(lgdal.OGR_Fld_GetPrecision, [c_void_p]) get_field_type = int_output(lgdal.OGR_Fld_GetType, [c_void_p]) get_field_type_name = const_string_output(lgdal.OGR_GetFieldTypeName, [c_int]) get_field_width = int_output(lgdal.OGR_Fld_GetWidth, [c_void_p])
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/prototypes/ds.py
Python
mit
4,525
""" This module houses the error-checking routines used by the GDAL ctypes prototypes. """ from ctypes import c_void_p, string_at from django.contrib.gis.gdal.error import GDALException, SRSException, check_err from django.contrib.gis.gdal.libgdal import lgdal # Helper routines for retrieving pointers and/or values from # arguments passed in by reference. def arg_byref(args, offset=-1): "Return the pointer argument's by-reference value." return args[offset]._obj.value def ptr_byref(args, offset=-1): "Return the pointer argument passed in by-reference." return args[offset]._obj # ### String checking Routines ### def check_const_string(result, func, cargs, offset=None, cpl=False): """ Similar functionality to `check_string`, but does not free the pointer. """ if offset: check_err(result, cpl=cpl) ptr = ptr_byref(cargs, offset) return ptr.value else: return result def check_string(result, func, cargs, offset=-1, str_result=False): """ Check the string output returned from the given function, and free the string pointer allocated by OGR. The `str_result` keyword may be used when the result is the string pointer, otherwise the OGR error code is assumed. The `offset` keyword may be used to extract the string pointer passed in by-reference at the given slice offset in the function arguments. """ if str_result: # For routines that return a string. ptr = result if not ptr: s = None else: s = string_at(result) else: # Error-code return specified. check_err(result) ptr = ptr_byref(cargs, offset) # Getting the string value s = ptr.value # Correctly freeing the allocated memory behind GDAL pointer # with the VSIFree routine. if ptr: lgdal.VSIFree(ptr) return s # ### DataSource, Layer error-checking ### # ### Envelope checking ### def check_envelope(result, func, cargs, offset=-1): "Check a function that returns an OGR Envelope by reference." return ptr_byref(cargs, offset) # ### Geometry error-checking routines ### def check_geom(result, func, cargs): "Check a function that returns a geometry." # OGR_G_Clone may return an integer, even though the # restype is set to c_void_p if isinstance(result, int): result = c_void_p(result) if not result: raise GDALException( 'Invalid geometry pointer returned from "%s".' % func.__name__ ) return result def check_geom_offset(result, func, cargs, offset=-1): "Check the geometry at the given offset in the C parameter list." check_err(result) geom = ptr_byref(cargs, offset=offset) return check_geom(geom, func, cargs) # ### Spatial Reference error-checking routines ### def check_srs(result, func, cargs): if isinstance(result, int): result = c_void_p(result) if not result: raise SRSException( 'Invalid spatial reference pointer returned from "%s".' % func.__name__ ) return result # ### Other error-checking routines ### def check_arg_errcode(result, func, cargs, cpl=False): """ The error code is returned in the last argument, by reference. Check its value with `check_err` before returning the result. """ check_err(arg_byref(cargs), cpl=cpl) return result def check_errcode(result, func, cargs, cpl=False): """ Check the error code returned (c_int). """ check_err(result, cpl=cpl) def check_pointer(result, func, cargs): "Make sure the result pointer is valid." if isinstance(result, int): result = c_void_p(result) if result: return result else: raise GDALException('Invalid pointer returned from "%s"' % func.__name__) def check_str_arg(result, func, cargs): """ This is for the OSRGet[Angular|Linear]Units functions, which require that the returned string pointer not be freed. This returns both the double and string values. """ dbl = result ptr = cargs[-1]._obj return dbl, ptr.value.decode()
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/prototypes/errcheck.py
Python
mit
4,173
""" This module contains functions that generate ctypes prototypes for the GDAL routines. """ from ctypes import POINTER, c_bool, c_char_p, c_double, c_int, c_int64, c_void_p from functools import partial from django.contrib.gis.gdal.prototypes.errcheck import ( check_arg_errcode, check_const_string, check_errcode, check_geom, check_geom_offset, check_pointer, check_srs, check_str_arg, check_string, ) class gdal_char_p(c_char_p): pass def bool_output(func, argtypes, errcheck=None): """Generate a ctypes function that returns a boolean value.""" func.argtypes = argtypes func.restype = c_bool if errcheck: func.errcheck = errcheck return func def double_output(func, argtypes, errcheck=False, strarg=False, cpl=False): "Generate a ctypes function that returns a double value." func.argtypes = argtypes func.restype = c_double if errcheck: func.errcheck = partial(check_arg_errcode, cpl=cpl) if strarg: func.errcheck = check_str_arg return func def geom_output(func, argtypes, offset=None): """ Generate a function that returns a Geometry either by reference or directly (if the return_geom keyword is set to True). """ # Setting the argument types func.argtypes = argtypes if not offset: # When a geometry pointer is directly returned. func.restype = c_void_p func.errcheck = check_geom else: # Error code returned, geometry is returned by-reference. func.restype = c_int def geomerrcheck(result, func, cargs): return check_geom_offset(result, func, cargs, offset) func.errcheck = geomerrcheck return func def int_output(func, argtypes, errcheck=None): "Generate a ctypes function that returns an integer value." func.argtypes = argtypes func.restype = c_int if errcheck: func.errcheck = errcheck return func def int64_output(func, argtypes): "Generate a ctypes function that returns a 64-bit integer value." func.argtypes = argtypes func.restype = c_int64 return func def srs_output(func, argtypes): """ Generate a ctypes prototype for the given function with the given C arguments that returns a pointer to an OGR Spatial Reference System. """ func.argtypes = argtypes func.restype = c_void_p func.errcheck = check_srs return func def const_string_output(func, argtypes, offset=None, decoding=None, cpl=False): func.argtypes = argtypes if offset: func.restype = c_int else: func.restype = c_char_p def _check_const(result, func, cargs): res = check_const_string(result, func, cargs, offset=offset, cpl=cpl) if res and decoding: res = res.decode(decoding) return res func.errcheck = _check_const return func def string_output(func, argtypes, offset=-1, str_result=False, decoding=None): """ Generate a ctypes prototype for the given function with the given argument types that returns a string from a GDAL pointer. The `const` flag indicates whether the allocated pointer should be freed via the GDAL library routine VSIFree -- but only applies only when `str_result` is True. """ func.argtypes = argtypes if str_result: # Use subclass of c_char_p so the error checking routine # can free the memory at the pointer's address. func.restype = gdal_char_p else: # Error code is returned func.restype = c_int # Dynamically defining our error-checking function with the # given offset. def _check_str(result, func, cargs): res = check_string(result, func, cargs, offset=offset, str_result=str_result) if res and decoding: res = res.decode(decoding) return res func.errcheck = _check_str return func def void_output(func, argtypes, errcheck=True, cpl=False): """ For functions that don't only return an error code that needs to be examined. """ if argtypes: func.argtypes = argtypes if errcheck: # `errcheck` keyword may be set to False for routines that # return void, rather than a status code. func.restype = c_int func.errcheck = partial(check_errcode, cpl=cpl) else: func.restype = None return func def voidptr_output(func, argtypes, errcheck=True): "For functions that return c_void_p." func.argtypes = argtypes func.restype = c_void_p if errcheck: func.errcheck = check_pointer return func def chararray_output(func, argtypes, errcheck=True): """For functions that return a c_char_p array.""" func.argtypes = argtypes func.restype = POINTER(c_char_p) if errcheck: func.errcheck = check_pointer return func
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/prototypes/generation.py
Python
mit
4,889
from ctypes import POINTER, c_char_p, c_double, c_int, c_void_p from django.contrib.gis.gdal.envelope import OGREnvelope from django.contrib.gis.gdal.libgdal import lgdal from django.contrib.gis.gdal.prototypes.errcheck import check_envelope from django.contrib.gis.gdal.prototypes.generation import ( const_string_output, double_output, geom_output, int_output, srs_output, string_output, void_output, ) # ### Generation routines specific to this module ### def env_func(f, argtypes): "For getting OGREnvelopes." f.argtypes = argtypes f.restype = None f.errcheck = check_envelope return f def pnt_func(f): "For accessing point information." return double_output(f, [c_void_p, c_int]) def topology_func(f): f.argtypes = [c_void_p, c_void_p] f.restype = c_int f.errcheck = lambda result, func, cargs: bool(result) return f # ### OGR_G ctypes function prototypes ### # GeoJSON routines. from_json = geom_output(lgdal.OGR_G_CreateGeometryFromJson, [c_char_p]) to_json = string_output( lgdal.OGR_G_ExportToJson, [c_void_p], str_result=True, decoding="ascii" ) to_kml = string_output( lgdal.OGR_G_ExportToKML, [c_void_p, c_char_p], str_result=True, decoding="ascii" ) # GetX, GetY, GetZ all return doubles. getx = pnt_func(lgdal.OGR_G_GetX) gety = pnt_func(lgdal.OGR_G_GetY) getz = pnt_func(lgdal.OGR_G_GetZ) # Geometry creation routines. from_wkb = geom_output( lgdal.OGR_G_CreateFromWkb, [c_char_p, c_void_p, POINTER(c_void_p), c_int], offset=-2 ) from_wkt = geom_output( lgdal.OGR_G_CreateFromWkt, [POINTER(c_char_p), c_void_p, POINTER(c_void_p)], offset=-1, ) from_gml = geom_output(lgdal.OGR_G_CreateFromGML, [c_char_p]) create_geom = geom_output(lgdal.OGR_G_CreateGeometry, [c_int]) clone_geom = geom_output(lgdal.OGR_G_Clone, [c_void_p]) get_geom_ref = geom_output(lgdal.OGR_G_GetGeometryRef, [c_void_p, c_int]) get_boundary = geom_output(lgdal.OGR_G_GetBoundary, [c_void_p]) geom_convex_hull = geom_output(lgdal.OGR_G_ConvexHull, [c_void_p]) geom_diff = geom_output(lgdal.OGR_G_Difference, [c_void_p, c_void_p]) geom_intersection = geom_output(lgdal.OGR_G_Intersection, [c_void_p, c_void_p]) geom_sym_diff = geom_output(lgdal.OGR_G_SymmetricDifference, [c_void_p, c_void_p]) geom_union = geom_output(lgdal.OGR_G_Union, [c_void_p, c_void_p]) # Geometry modification routines. add_geom = void_output(lgdal.OGR_G_AddGeometry, [c_void_p, c_void_p]) import_wkt = void_output(lgdal.OGR_G_ImportFromWkt, [c_void_p, POINTER(c_char_p)]) # Destroys a geometry destroy_geom = void_output(lgdal.OGR_G_DestroyGeometry, [c_void_p], errcheck=False) # Geometry export routines. to_wkb = void_output( lgdal.OGR_G_ExportToWkb, None, errcheck=True ) # special handling for WKB. to_wkt = string_output( lgdal.OGR_G_ExportToWkt, [c_void_p, POINTER(c_char_p)], decoding="ascii" ) to_gml = string_output( lgdal.OGR_G_ExportToGML, [c_void_p], str_result=True, decoding="ascii" ) get_wkbsize = int_output(lgdal.OGR_G_WkbSize, [c_void_p]) # Geometry spatial-reference related routines. assign_srs = void_output( lgdal.OGR_G_AssignSpatialReference, [c_void_p, c_void_p], errcheck=False ) get_geom_srs = srs_output(lgdal.OGR_G_GetSpatialReference, [c_void_p]) # Geometry properties get_area = double_output(lgdal.OGR_G_GetArea, [c_void_p]) get_centroid = void_output(lgdal.OGR_G_Centroid, [c_void_p, c_void_p]) get_dims = int_output(lgdal.OGR_G_GetDimension, [c_void_p]) get_coord_dim = int_output(lgdal.OGR_G_GetCoordinateDimension, [c_void_p]) set_coord_dim = void_output( lgdal.OGR_G_SetCoordinateDimension, [c_void_p, c_int], errcheck=False ) is_empty = int_output( lgdal.OGR_G_IsEmpty, [c_void_p], errcheck=lambda result, func, cargs: bool(result) ) get_geom_count = int_output(lgdal.OGR_G_GetGeometryCount, [c_void_p]) get_geom_name = const_string_output( lgdal.OGR_G_GetGeometryName, [c_void_p], decoding="ascii" ) get_geom_type = int_output(lgdal.OGR_G_GetGeometryType, [c_void_p]) get_point_count = int_output(lgdal.OGR_G_GetPointCount, [c_void_p]) get_point = void_output( lgdal.OGR_G_GetPoint, [c_void_p, c_int, POINTER(c_double), POINTER(c_double), POINTER(c_double)], errcheck=False, ) geom_close_rings = void_output(lgdal.OGR_G_CloseRings, [c_void_p], errcheck=False) # Topology routines. ogr_contains = topology_func(lgdal.OGR_G_Contains) ogr_crosses = topology_func(lgdal.OGR_G_Crosses) ogr_disjoint = topology_func(lgdal.OGR_G_Disjoint) ogr_equals = topology_func(lgdal.OGR_G_Equals) ogr_intersects = topology_func(lgdal.OGR_G_Intersects) ogr_overlaps = topology_func(lgdal.OGR_G_Overlaps) ogr_touches = topology_func(lgdal.OGR_G_Touches) ogr_within = topology_func(lgdal.OGR_G_Within) # Transformation routines. geom_transform = void_output(lgdal.OGR_G_Transform, [c_void_p, c_void_p]) geom_transform_to = void_output(lgdal.OGR_G_TransformTo, [c_void_p, c_void_p]) # For retrieving the envelope of the geometry. get_envelope = env_func(lgdal.OGR_G_GetEnvelope, [c_void_p, POINTER(OGREnvelope)])
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/prototypes/geom.py
Python
mit
5,046
""" This module houses the ctypes function prototypes for GDAL DataSource (raster) related data structures. """ from ctypes import POINTER, c_bool, c_char_p, c_double, c_int, c_void_p from functools import partial from django.contrib.gis.gdal.libgdal import std_call from django.contrib.gis.gdal.prototypes.generation import ( chararray_output, const_string_output, double_output, int_output, void_output, voidptr_output, ) # For more detail about c function names and definitions see # https://gdal.org/api/raster_c_api.html # https://gdal.org/doxygen/gdalwarper_8h.html # https://gdal.org/api/gdal_utils.html # Prepare partial functions that use cpl error codes void_output = partial(void_output, cpl=True) const_string_output = partial(const_string_output, cpl=True) double_output = partial(double_output, cpl=True) # Raster Driver Routines register_all = void_output(std_call("GDALAllRegister"), [], errcheck=False) get_driver = voidptr_output(std_call("GDALGetDriver"), [c_int]) get_driver_by_name = voidptr_output( std_call("GDALGetDriverByName"), [c_char_p], errcheck=False ) get_driver_count = int_output(std_call("GDALGetDriverCount"), []) get_driver_description = const_string_output(std_call("GDALGetDescription"), [c_void_p]) # Raster Data Source Routines create_ds = voidptr_output( std_call("GDALCreate"), [c_void_p, c_char_p, c_int, c_int, c_int, c_int, c_void_p] ) open_ds = voidptr_output(std_call("GDALOpen"), [c_char_p, c_int]) close_ds = void_output(std_call("GDALClose"), [c_void_p], errcheck=False) flush_ds = int_output(std_call("GDALFlushCache"), [c_void_p]) copy_ds = voidptr_output( std_call("GDALCreateCopy"), [c_void_p, c_char_p, c_void_p, c_int, POINTER(c_char_p), c_void_p, c_void_p], ) add_band_ds = void_output(std_call("GDALAddBand"), [c_void_p, c_int]) get_ds_description = const_string_output(std_call("GDALGetDescription"), [c_void_p]) get_ds_driver = voidptr_output(std_call("GDALGetDatasetDriver"), [c_void_p]) get_ds_info = const_string_output(std_call("GDALInfo"), [c_void_p, c_void_p]) get_ds_xsize = int_output(std_call("GDALGetRasterXSize"), [c_void_p]) get_ds_ysize = int_output(std_call("GDALGetRasterYSize"), [c_void_p]) get_ds_raster_count = int_output(std_call("GDALGetRasterCount"), [c_void_p]) get_ds_raster_band = voidptr_output(std_call("GDALGetRasterBand"), [c_void_p, c_int]) get_ds_projection_ref = const_string_output( std_call("GDALGetProjectionRef"), [c_void_p] ) set_ds_projection_ref = void_output(std_call("GDALSetProjection"), [c_void_p, c_char_p]) get_ds_geotransform = void_output( std_call("GDALGetGeoTransform"), [c_void_p, POINTER(c_double * 6)], errcheck=False ) set_ds_geotransform = void_output( std_call("GDALSetGeoTransform"), [c_void_p, POINTER(c_double * 6)] ) get_ds_metadata = chararray_output( std_call("GDALGetMetadata"), [c_void_p, c_char_p], errcheck=False ) set_ds_metadata = void_output( std_call("GDALSetMetadata"), [c_void_p, POINTER(c_char_p), c_char_p] ) get_ds_metadata_domain_list = chararray_output( std_call("GDALGetMetadataDomainList"), [c_void_p], errcheck=False ) get_ds_metadata_item = const_string_output( std_call("GDALGetMetadataItem"), [c_void_p, c_char_p, c_char_p] ) set_ds_metadata_item = const_string_output( std_call("GDALSetMetadataItem"), [c_void_p, c_char_p, c_char_p, c_char_p] ) free_dsl = void_output(std_call("CSLDestroy"), [POINTER(c_char_p)], errcheck=False) # Raster Band Routines band_io = void_output( std_call("GDALRasterIO"), [ c_void_p, c_int, c_int, c_int, c_int, c_int, c_void_p, c_int, c_int, c_int, c_int, c_int, ], ) get_band_xsize = int_output(std_call("GDALGetRasterBandXSize"), [c_void_p]) get_band_ysize = int_output(std_call("GDALGetRasterBandYSize"), [c_void_p]) get_band_index = int_output(std_call("GDALGetBandNumber"), [c_void_p]) get_band_description = const_string_output(std_call("GDALGetDescription"), [c_void_p]) get_band_ds = voidptr_output(std_call("GDALGetBandDataset"), [c_void_p]) get_band_datatype = int_output(std_call("GDALGetRasterDataType"), [c_void_p]) get_band_color_interp = int_output( std_call("GDALGetRasterColorInterpretation"), [c_void_p] ) get_band_nodata_value = double_output( std_call("GDALGetRasterNoDataValue"), [c_void_p, POINTER(c_int)] ) set_band_nodata_value = void_output( std_call("GDALSetRasterNoDataValue"), [c_void_p, c_double] ) delete_band_nodata_value = void_output( std_call("GDALDeleteRasterNoDataValue"), [c_void_p] ) get_band_statistics = void_output( std_call("GDALGetRasterStatistics"), [ c_void_p, c_int, c_int, POINTER(c_double), POINTER(c_double), POINTER(c_double), POINTER(c_double), c_void_p, c_void_p, ], ) compute_band_statistics = void_output( std_call("GDALComputeRasterStatistics"), [ c_void_p, c_int, POINTER(c_double), POINTER(c_double), POINTER(c_double), POINTER(c_double), c_void_p, c_void_p, ], ) # Reprojection routine reproject_image = void_output( std_call("GDALReprojectImage"), [ c_void_p, c_char_p, c_void_p, c_char_p, c_int, c_double, c_double, c_void_p, c_void_p, c_void_p, ], ) auto_create_warped_vrt = voidptr_output( std_call("GDALAutoCreateWarpedVRT"), [c_void_p, c_char_p, c_char_p, c_int, c_double, c_void_p], ) # Create VSI gdal raster files from in-memory buffers. # https://gdal.org/api/cpl.html#cpl-vsi-h create_vsi_file_from_mem_buffer = voidptr_output( std_call("VSIFileFromMemBuffer"), [c_char_p, c_void_p, c_int, c_int] ) get_mem_buffer_from_vsi_file = voidptr_output( std_call("VSIGetMemFileBuffer"), [c_char_p, POINTER(c_int), c_bool] ) unlink_vsi_file = int_output(std_call("VSIUnlink"), [c_char_p])
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/prototypes/raster.py
Python
mit
5,994
from ctypes import POINTER, c_char_p, c_int, c_void_p from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal, std_call from django.contrib.gis.gdal.prototypes.generation import ( const_string_output, double_output, int_output, srs_output, string_output, void_output, ) # Shortcut generation for routines with known parameters. def srs_double(f): """ Create a function prototype for the OSR routines that take the OSRSpatialReference object and return a double value. """ return double_output(f, [c_void_p, POINTER(c_int)], errcheck=True) def units_func(f): """ Create a ctypes function prototype for OSR units functions, e.g., OSRGetAngularUnits, OSRGetLinearUnits. """ return double_output(f, [c_void_p, POINTER(c_char_p)], strarg=True) # Creation & destruction. clone_srs = srs_output(std_call("OSRClone"), [c_void_p]) new_srs = srs_output(std_call("OSRNewSpatialReference"), [c_char_p]) release_srs = void_output(lgdal.OSRRelease, [c_void_p], errcheck=False) destroy_srs = void_output( std_call("OSRDestroySpatialReference"), [c_void_p], errcheck=False ) srs_validate = void_output(lgdal.OSRValidate, [c_void_p]) if GDAL_VERSION >= (3, 0): set_axis_strategy = void_output( lgdal.OSRSetAxisMappingStrategy, [c_void_p, c_int], errcheck=False ) # Getting the semi_major, semi_minor, and flattening functions. semi_major = srs_double(lgdal.OSRGetSemiMajor) semi_minor = srs_double(lgdal.OSRGetSemiMinor) invflattening = srs_double(lgdal.OSRGetInvFlattening) # WKT, PROJ, EPSG, XML importation routines. from_wkt = void_output(lgdal.OSRImportFromWkt, [c_void_p, POINTER(c_char_p)]) from_proj = void_output(lgdal.OSRImportFromProj4, [c_void_p, c_char_p]) from_epsg = void_output(std_call("OSRImportFromEPSG"), [c_void_p, c_int]) from_xml = void_output(lgdal.OSRImportFromXML, [c_void_p, c_char_p]) from_user_input = void_output(std_call("OSRSetFromUserInput"), [c_void_p, c_char_p]) # Morphing to/from ESRI WKT. morph_to_esri = void_output(lgdal.OSRMorphToESRI, [c_void_p]) morph_from_esri = void_output(lgdal.OSRMorphFromESRI, [c_void_p]) # Identifying the EPSG identify_epsg = void_output(lgdal.OSRAutoIdentifyEPSG, [c_void_p]) # Getting the angular_units, linear_units functions linear_units = units_func(lgdal.OSRGetLinearUnits) angular_units = units_func(lgdal.OSRGetAngularUnits) # For exporting to WKT, PROJ, "Pretty" WKT, and XML. to_wkt = string_output( std_call("OSRExportToWkt"), [c_void_p, POINTER(c_char_p)], decoding="utf-8" ) to_proj = string_output( std_call("OSRExportToProj4"), [c_void_p, POINTER(c_char_p)], decoding="ascii" ) to_pretty_wkt = string_output( std_call("OSRExportToPrettyWkt"), [c_void_p, POINTER(c_char_p), c_int], offset=-2, decoding="utf-8", ) to_xml = string_output( lgdal.OSRExportToXML, [c_void_p, POINTER(c_char_p), c_char_p], offset=-2, decoding="utf-8", ) # String attribute retrieval routines. get_attr_value = const_string_output( std_call("OSRGetAttrValue"), [c_void_p, c_char_p, c_int], decoding="utf-8" ) get_auth_name = const_string_output( lgdal.OSRGetAuthorityName, [c_void_p, c_char_p], decoding="ascii" ) get_auth_code = const_string_output( lgdal.OSRGetAuthorityCode, [c_void_p, c_char_p], decoding="ascii" ) # SRS Properties isgeographic = int_output(lgdal.OSRIsGeographic, [c_void_p]) islocal = int_output(lgdal.OSRIsLocal, [c_void_p]) isprojected = int_output(lgdal.OSRIsProjected, [c_void_p]) # Coordinate transformation new_ct = srs_output(std_call("OCTNewCoordinateTransformation"), [c_void_p, c_void_p]) destroy_ct = void_output( std_call("OCTDestroyCoordinateTransformation"), [c_void_p], errcheck=False )
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/prototypes/srs.py
Python
mit
3,731
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/raster/__init__.py
Python
mit
0
from ctypes import byref, c_double, c_int, c_void_p from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import raster as capi from django.contrib.gis.gdal.raster.base import GDALRasterBase from django.contrib.gis.shortcuts import numpy from django.utils.encoding import force_str from .const import ( GDAL_COLOR_TYPES, GDAL_INTEGER_TYPES, GDAL_PIXEL_TYPES, GDAL_TO_CTYPES, ) class GDALBand(GDALRasterBase): """ Wrap a GDAL raster band, needs to be obtained from a GDALRaster object. """ def __init__(self, source, index): self.source = source self._ptr = capi.get_ds_raster_band(source._ptr, index) def _flush(self): """ Call the flush method on the Band's parent raster and force a refresh of the statistics attribute when requested the next time. """ self.source._flush() self._stats_refresh = True @property def description(self): """ Return the description string of the band. """ return force_str(capi.get_band_description(self._ptr)) @property def width(self): """ Width (X axis) in pixels of the band. """ return capi.get_band_xsize(self._ptr) @property def height(self): """ Height (Y axis) in pixels of the band. """ return capi.get_band_ysize(self._ptr) @property def pixel_count(self): """ Return the total number of pixels in this band. """ return self.width * self.height _stats_refresh = False def statistics(self, refresh=False, approximate=False): """ Compute statistics on the pixel values of this band. The return value is a tuple with the following structure: (minimum, maximum, mean, standard deviation). If approximate=True, the statistics may be computed based on overviews or a subset of image tiles. If refresh=True, the statistics will be computed from the data directly, and the cache will be updated where applicable. For empty bands (where all pixel values are nodata), all statistics values are returned as None. For raster formats using Persistent Auxiliary Metadata (PAM) services, the statistics might be cached in an auxiliary file. """ # Prepare array with arguments for capi function smin, smax, smean, sstd = c_double(), c_double(), c_double(), c_double() stats_args = [ self._ptr, c_int(approximate), byref(smin), byref(smax), byref(smean), byref(sstd), c_void_p(), c_void_p(), ] if refresh or self._stats_refresh: func = capi.compute_band_statistics else: # Add additional argument to force computation if there is no # existing PAM file to take the values from. force = True stats_args.insert(2, c_int(force)) func = capi.get_band_statistics # Computation of statistics fails for empty bands. try: func(*stats_args) result = smin.value, smax.value, smean.value, sstd.value except GDALException: result = (None, None, None, None) self._stats_refresh = False return result @property def min(self): """ Return the minimum pixel value for this band. """ return self.statistics()[0] @property def max(self): """ Return the maximum pixel value for this band. """ return self.statistics()[1] @property def mean(self): """ Return the mean of all pixel values of this band. """ return self.statistics()[2] @property def std(self): """ Return the standard deviation of all pixel values of this band. """ return self.statistics()[3] @property def nodata_value(self): """ Return the nodata value for this band, or None if it isn't set. """ # Get value and nodata exists flag nodata_exists = c_int() value = capi.get_band_nodata_value(self._ptr, nodata_exists) if not nodata_exists: value = None # If the pixeltype is an integer, convert to int elif self.datatype() in GDAL_INTEGER_TYPES: value = int(value) return value @nodata_value.setter def nodata_value(self, value): """ Set the nodata value for this band. """ if value is None: capi.delete_band_nodata_value(self._ptr) elif not isinstance(value, (int, float)): raise ValueError("Nodata value must be numeric or None.") else: capi.set_band_nodata_value(self._ptr, value) self._flush() def datatype(self, as_string=False): """ Return the GDAL Pixel Datatype for this band. """ dtype = capi.get_band_datatype(self._ptr) if as_string: dtype = GDAL_PIXEL_TYPES[dtype] return dtype def color_interp(self, as_string=False): """Return the GDAL color interpretation for this band.""" color = capi.get_band_color_interp(self._ptr) if as_string: color = GDAL_COLOR_TYPES[color] return color def data(self, data=None, offset=None, size=None, shape=None, as_memoryview=False): """ Read or writes pixel values for this band. Blocks of data can be accessed by specifying the width, height and offset of the desired block. The same specification can be used to update parts of a raster by providing an array of values. Allowed input data types are bytes, memoryview, list, tuple, and array. """ offset = offset or (0, 0) size = size or (self.width - offset[0], self.height - offset[1]) shape = shape or size if any(x <= 0 for x in size): raise ValueError("Offset too big for this raster.") if size[0] > self.width or size[1] > self.height: raise ValueError("Size is larger than raster.") # Create ctypes type array generator ctypes_array = GDAL_TO_CTYPES[self.datatype()] * (shape[0] * shape[1]) if data is None: # Set read mode access_flag = 0 # Prepare empty ctypes array data_array = ctypes_array() else: # Set write mode access_flag = 1 # Instantiate ctypes array holding the input data if isinstance(data, (bytes, memoryview)) or ( numpy and isinstance(data, numpy.ndarray) ): data_array = ctypes_array.from_buffer_copy(data) else: data_array = ctypes_array(*data) # Access band capi.band_io( self._ptr, access_flag, offset[0], offset[1], size[0], size[1], byref(data_array), shape[0], shape[1], self.datatype(), 0, 0, ) # Return data as numpy array if possible, otherwise as list if data is None: if as_memoryview: return memoryview(data_array) elif numpy: # reshape() needs a reshape parameter with the height first. return numpy.frombuffer( data_array, dtype=numpy.dtype(data_array) ).reshape(tuple(reversed(size))) else: return list(data_array) else: self._flush() class BandList(list): def __init__(self, source): self.source = source super().__init__() def __iter__(self): for idx in range(1, len(self) + 1): yield GDALBand(self.source, idx) def __len__(self): return capi.get_ds_raster_count(self.source._ptr) def __getitem__(self, index): try: return GDALBand(self.source, index + 1) except GDALException: raise GDALException("Unable to get band index %d" % index)
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/raster/band.py
Python
mit
8,343
from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.prototypes import raster as capi class GDALRasterBase(GDALBase): """ Attributes that exist on both GDALRaster and GDALBand. """ @property def metadata(self): """ Return the metadata for this raster or band. The return value is a nested dictionary, where the first-level key is the metadata domain and the second-level is the metadata item names and values for that domain. """ # The initial metadata domain list contains the default domain. # The default is returned if domain name is None. domain_list = ["DEFAULT"] # Get additional metadata domains from the raster. meta_list = capi.get_ds_metadata_domain_list(self._ptr) if meta_list: # The number of domains is unknown, so retrieve data until there # are no more values in the ctypes array. counter = 0 domain = meta_list[counter] while domain: domain_list.append(domain.decode()) counter += 1 domain = meta_list[counter] # Free domain list array. capi.free_dsl(meta_list) # Retrieve metadata values for each domain. result = {} for domain in domain_list: # Get metadata for this domain. data = capi.get_ds_metadata( self._ptr, (None if domain == "DEFAULT" else domain.encode()), ) if not data: continue # The number of metadata items is unknown, so retrieve data until # there are no more values in the ctypes array. domain_meta = {} counter = 0 item = data[counter] while item: key, val = item.decode().split("=") domain_meta[key] = val counter += 1 item = data[counter] # The default domain values are returned if domain is None. result[domain or "DEFAULT"] = domain_meta return result @metadata.setter def metadata(self, value): """ Set the metadata. Update only the domains that are contained in the value dictionary. """ # Loop through domains. for domain, metadata in value.items(): # Set the domain to None for the default, otherwise encode. domain = None if domain == "DEFAULT" else domain.encode() # Set each metadata entry separately. for meta_name, meta_value in metadata.items(): capi.set_ds_metadata_item( self._ptr, meta_name.encode(), meta_value.encode() if meta_value else None, domain, )
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/raster/base.py
Python
mit
2,882
""" GDAL - Constant definitions """ from ctypes import c_double, c_float, c_int16, c_int32, c_ubyte, c_uint16, c_uint32 # See https://gdal.org/api/raster_c_api.html#_CPPv412GDALDataType GDAL_PIXEL_TYPES = { 0: "GDT_Unknown", # Unknown or unspecified type 1: "GDT_Byte", # Eight bit unsigned integer 2: "GDT_UInt16", # Sixteen bit unsigned integer 3: "GDT_Int16", # Sixteen bit signed integer 4: "GDT_UInt32", # Thirty-two bit unsigned integer 5: "GDT_Int32", # Thirty-two bit signed integer 6: "GDT_Float32", # Thirty-two bit floating point 7: "GDT_Float64", # Sixty-four bit floating point 8: "GDT_CInt16", # Complex Int16 9: "GDT_CInt32", # Complex Int32 10: "GDT_CFloat32", # Complex Float32 11: "GDT_CFloat64", # Complex Float64 } # A list of gdal datatypes that are integers. GDAL_INTEGER_TYPES = [1, 2, 3, 4, 5] # Lookup values to convert GDAL pixel type indices into ctypes objects. # The GDAL band-io works with ctypes arrays to hold data to be written # or to hold the space for data to be read into. The lookup below helps # selecting the right ctypes object for a given gdal pixel type. GDAL_TO_CTYPES = [ None, c_ubyte, c_uint16, c_int16, c_uint32, c_int32, c_float, c_double, None, None, None, None, ] # List of resampling algorithms that can be used to warp a GDALRaster. GDAL_RESAMPLE_ALGORITHMS = { "NearestNeighbour": 0, "Bilinear": 1, "Cubic": 2, "CubicSpline": 3, "Lanczos": 4, "Average": 5, "Mode": 6, } # See https://gdal.org/api/raster_c_api.html#_CPPv415GDALColorInterp GDAL_COLOR_TYPES = { 0: "GCI_Undefined", # Undefined, default value, i.e. not known 1: "GCI_GrayIndex", # Grayscale 2: "GCI_PaletteIndex", # Paletted 3: "GCI_RedBand", # Red band of RGBA image 4: "GCI_GreenBand", # Green band of RGBA image 5: "GCI_BlueBand", # Blue band of RGBA image 6: "GCI_AlphaBand", # Alpha (0=transparent, 255=opaque) 7: "GCI_HueBand", # Hue band of HLS image 8: "GCI_SaturationBand", # Saturation band of HLS image 9: "GCI_LightnessBand", # Lightness band of HLS image 10: "GCI_CyanBand", # Cyan band of CMYK image 11: "GCI_MagentaBand", # Magenta band of CMYK image 12: "GCI_YellowBand", # Yellow band of CMYK image 13: "GCI_BlackBand", # Black band of CMLY image 14: "GCI_YCbCr_YBand", # Y Luminance 15: "GCI_YCbCr_CbBand", # Cb Chroma 16: "GCI_YCbCr_CrBand", # Cr Chroma, also GCI_Max } # GDAL virtual filesystems prefix. VSI_FILESYSTEM_PREFIX = "/vsi" # Fixed base path for buffer-based GDAL in-memory files. VSI_MEM_FILESYSTEM_BASE_PATH = "/vsimem/" # Should the memory file system take ownership of the buffer, freeing it when # the file is deleted? (No, GDALRaster.__del__() will delete the buffer.) VSI_TAKE_BUFFER_OWNERSHIP = False # Should a VSI file be removed when retrieving its buffer? VSI_DELETE_BUFFER_ON_READ = False
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/raster/const.py
Python
mit
2,981
import json import os import sys import uuid from ctypes import ( addressof, byref, c_buffer, c_char_p, c_double, c_int, c_void_p, string_at, ) from pathlib import Path from django.contrib.gis.gdal.driver import Driver from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import raster as capi from django.contrib.gis.gdal.raster.band import BandList from django.contrib.gis.gdal.raster.base import GDALRasterBase from django.contrib.gis.gdal.raster.const import ( GDAL_RESAMPLE_ALGORITHMS, VSI_DELETE_BUFFER_ON_READ, VSI_FILESYSTEM_PREFIX, VSI_MEM_FILESYSTEM_BASE_PATH, VSI_TAKE_BUFFER_OWNERSHIP, ) from django.contrib.gis.gdal.srs import SpatialReference, SRSException from django.contrib.gis.geometry import json_regex from django.utils.encoding import force_bytes, force_str from django.utils.functional import cached_property class TransformPoint(list): indices = { "origin": (0, 3), "scale": (1, 5), "skew": (2, 4), } def __init__(self, raster, prop): x = raster.geotransform[self.indices[prop][0]] y = raster.geotransform[self.indices[prop][1]] super().__init__([x, y]) self._raster = raster self._prop = prop @property def x(self): return self[0] @x.setter def x(self, value): gtf = self._raster.geotransform gtf[self.indices[self._prop][0]] = value self._raster.geotransform = gtf @property def y(self): return self[1] @y.setter def y(self, value): gtf = self._raster.geotransform gtf[self.indices[self._prop][1]] = value self._raster.geotransform = gtf class GDALRaster(GDALRasterBase): """ Wrap a raster GDAL Data Source object. """ destructor = capi.close_ds def __init__(self, ds_input, write=False): self._write = 1 if write else 0 Driver.ensure_registered() # Preprocess json inputs. This converts json strings to dictionaries, # which are parsed below the same way as direct dictionary inputs. if isinstance(ds_input, str) and json_regex.match(ds_input): ds_input = json.loads(ds_input) # If input is a valid file path, try setting file as source. if isinstance(ds_input, (str, Path)): ds_input = str(ds_input) if not ds_input.startswith(VSI_FILESYSTEM_PREFIX) and not os.path.exists( ds_input ): raise GDALException( 'Unable to read raster source input "%s".' % ds_input ) try: # GDALOpen will auto-detect the data source type. self._ptr = capi.open_ds(force_bytes(ds_input), self._write) except GDALException as err: raise GDALException( 'Could not open the datasource at "{}" ({}).'.format(ds_input, err) ) elif isinstance(ds_input, bytes): # Create a new raster in write mode. self._write = 1 # Get size of buffer. size = sys.getsizeof(ds_input) # Pass data to ctypes, keeping a reference to the ctypes object so # that the vsimem file remains available until the GDALRaster is # deleted. self._ds_input = c_buffer(ds_input) # Create random name to reference in vsimem filesystem. vsi_path = os.path.join(VSI_MEM_FILESYSTEM_BASE_PATH, str(uuid.uuid4())) # Create vsimem file from buffer. capi.create_vsi_file_from_mem_buffer( force_bytes(vsi_path), byref(self._ds_input), size, VSI_TAKE_BUFFER_OWNERSHIP, ) # Open the new vsimem file as a GDALRaster. try: self._ptr = capi.open_ds(force_bytes(vsi_path), self._write) except GDALException: # Remove the broken file from the VSI filesystem. capi.unlink_vsi_file(force_bytes(vsi_path)) raise GDALException("Failed creating VSI raster from the input buffer.") elif isinstance(ds_input, dict): # A new raster needs to be created in write mode self._write = 1 # Create driver (in memory by default) driver = Driver(ds_input.get("driver", "MEM")) # For out of memory drivers, check filename argument if driver.name != "MEM" and "name" not in ds_input: raise GDALException( 'Specify name for creation of raster with driver "{}".'.format( driver.name ) ) # Check if width and height where specified if "width" not in ds_input or "height" not in ds_input: raise GDALException( "Specify width and height attributes for JSON or dict input." ) # Check if srid was specified if "srid" not in ds_input: raise GDALException("Specify srid for JSON or dict input.") # Create null terminated gdal options array. papsz_options = [] for key, val in ds_input.get("papsz_options", {}).items(): option = "{}={}".format(key, val) papsz_options.append(option.upper().encode()) papsz_options.append(None) # Convert papszlist to ctypes array. papsz_options = (c_char_p * len(papsz_options))(*papsz_options) # Create GDAL Raster self._ptr = capi.create_ds( driver._ptr, force_bytes(ds_input.get("name", "")), ds_input["width"], ds_input["height"], ds_input.get("nr_of_bands", len(ds_input.get("bands", []))), ds_input.get("datatype", 6), byref(papsz_options), ) # Set band data if provided for i, band_input in enumerate(ds_input.get("bands", [])): band = self.bands[i] if "nodata_value" in band_input: band.nodata_value = band_input["nodata_value"] # Instantiate band filled with nodata values if only # partial input data has been provided. if band.nodata_value is not None and ( "data" not in band_input or "size" in band_input or "shape" in band_input ): band.data(data=(band.nodata_value,), shape=(1, 1)) # Set band data values from input. band.data( data=band_input.get("data"), size=band_input.get("size"), shape=band_input.get("shape"), offset=band_input.get("offset"), ) # Set SRID self.srs = ds_input.get("srid") # Set additional properties if provided if "origin" in ds_input: self.origin.x, self.origin.y = ds_input["origin"] if "scale" in ds_input: self.scale.x, self.scale.y = ds_input["scale"] if "skew" in ds_input: self.skew.x, self.skew.y = ds_input["skew"] elif isinstance(ds_input, c_void_p): # Instantiate the object using an existing pointer to a gdal raster. self._ptr = ds_input else: raise GDALException( 'Invalid data source input type: "{}".'.format(type(ds_input)) ) def __del__(self): if self.is_vsi_based: # Remove the temporary file from the VSI in-memory filesystem. capi.unlink_vsi_file(force_bytes(self.name)) super().__del__() def __str__(self): return self.name def __repr__(self): """ Short-hand representation because WKB may be very large. """ return "<Raster object at %s>" % hex(addressof(self._ptr)) def _flush(self): """ Flush all data from memory into the source file if it exists. The data that needs flushing are geotransforms, coordinate systems, nodata_values and pixel values. This function will be called automatically wherever it is needed. """ # Raise an Exception if the value is being changed in read mode. if not self._write: raise GDALException( "Raster needs to be opened in write mode to change values." ) capi.flush_ds(self._ptr) @property def vsi_buffer(self): if not ( self.is_vsi_based and self.name.startswith(VSI_MEM_FILESYSTEM_BASE_PATH) ): return None # Prepare an integer that will contain the buffer length. out_length = c_int() # Get the data using the vsi file name. dat = capi.get_mem_buffer_from_vsi_file( force_bytes(self.name), byref(out_length), VSI_DELETE_BUFFER_ON_READ, ) # Read the full buffer pointer. return string_at(dat, out_length.value) @cached_property def is_vsi_based(self): return self._ptr and self.name.startswith(VSI_FILESYSTEM_PREFIX) @property def name(self): """ Return the name of this raster. Corresponds to filename for file-based rasters. """ return force_str(capi.get_ds_description(self._ptr)) @cached_property def driver(self): """ Return the GDAL Driver used for this raster. """ ds_driver = capi.get_ds_driver(self._ptr) return Driver(ds_driver) @property def width(self): """ Width (X axis) in pixels. """ return capi.get_ds_xsize(self._ptr) @property def height(self): """ Height (Y axis) in pixels. """ return capi.get_ds_ysize(self._ptr) @property def srs(self): """ Return the SpatialReference used in this GDALRaster. """ try: wkt = capi.get_ds_projection_ref(self._ptr) if not wkt: return None return SpatialReference(wkt, srs_type="wkt") except SRSException: return None @srs.setter def srs(self, value): """ Set the spatial reference used in this GDALRaster. The input can be a SpatialReference or any parameter accepted by the SpatialReference constructor. """ if isinstance(value, SpatialReference): srs = value elif isinstance(value, (int, str)): srs = SpatialReference(value) else: raise ValueError("Could not create a SpatialReference from input.") capi.set_ds_projection_ref(self._ptr, srs.wkt.encode()) self._flush() @property def srid(self): """ Shortcut to access the srid of this GDALRaster. """ return self.srs.srid @srid.setter def srid(self, value): """ Shortcut to set this GDALRaster's srs from an srid. """ self.srs = value @property def geotransform(self): """ Return the geotransform of the data source. Return the default geotransform if it does not exist or has not been set previously. The default is [0.0, 1.0, 0.0, 0.0, 0.0, -1.0]. """ # Create empty ctypes double array for data gtf = (c_double * 6)() capi.get_ds_geotransform(self._ptr, byref(gtf)) return list(gtf) @geotransform.setter def geotransform(self, values): "Set the geotransform for the data source." if len(values) != 6 or not all(isinstance(x, (int, float)) for x in values): raise ValueError("Geotransform must consist of 6 numeric values.") # Create ctypes double array with input and write data values = (c_double * 6)(*values) capi.set_ds_geotransform(self._ptr, byref(values)) self._flush() @property def origin(self): """ Coordinates of the raster origin. """ return TransformPoint(self, "origin") @property def scale(self): """ Pixel scale in units of the raster projection. """ return TransformPoint(self, "scale") @property def skew(self): """ Skew of pixels (rotation parameters). """ return TransformPoint(self, "skew") @property def extent(self): """ Return the extent as a 4-tuple (xmin, ymin, xmax, ymax). """ # Calculate boundary values based on scale and size xval = self.origin.x + self.scale.x * self.width yval = self.origin.y + self.scale.y * self.height # Calculate min and max values xmin = min(xval, self.origin.x) xmax = max(xval, self.origin.x) ymin = min(yval, self.origin.y) ymax = max(yval, self.origin.y) return xmin, ymin, xmax, ymax @property def bands(self): return BandList(self) def warp(self, ds_input, resampling="NearestNeighbour", max_error=0.0): """ Return a warped GDALRaster with the given input characteristics. The input is expected to be a dictionary containing the parameters of the target raster. Allowed values are width, height, SRID, origin, scale, skew, datatype, driver, and name (filename). By default, the warp functions keeps all parameters equal to the values of the original source raster. For the name of the target raster, the name of the source raster will be used and appended with _copy. + source_driver_name. In addition, the resampling algorithm can be specified with the "resampling" input parameter. The default is NearestNeighbor. For a list of all options consult the GDAL_RESAMPLE_ALGORITHMS constant. """ # Get the parameters defining the geotransform, srid, and size of the raster ds_input.setdefault("width", self.width) ds_input.setdefault("height", self.height) ds_input.setdefault("srid", self.srs.srid) ds_input.setdefault("origin", self.origin) ds_input.setdefault("scale", self.scale) ds_input.setdefault("skew", self.skew) # Get the driver, name, and datatype of the target raster ds_input.setdefault("driver", self.driver.name) if "name" not in ds_input: ds_input["name"] = self.name + "_copy." + self.driver.name if "datatype" not in ds_input: ds_input["datatype"] = self.bands[0].datatype() # Instantiate raster bands filled with nodata values. ds_input["bands"] = [{"nodata_value": bnd.nodata_value} for bnd in self.bands] # Create target raster target = GDALRaster(ds_input, write=True) # Select resampling algorithm algorithm = GDAL_RESAMPLE_ALGORITHMS[resampling] # Reproject image capi.reproject_image( self._ptr, self.srs.wkt.encode(), target._ptr, target.srs.wkt.encode(), algorithm, 0.0, max_error, c_void_p(), c_void_p(), c_void_p(), ) # Make sure all data is written to file target._flush() return target def clone(self, name=None): """Return a clone of this GDALRaster.""" if name: clone_name = name elif self.driver.name != "MEM": clone_name = self.name + "_copy." + self.driver.name else: clone_name = os.path.join(VSI_MEM_FILESYSTEM_BASE_PATH, str(uuid.uuid4())) return GDALRaster( capi.copy_ds( self.driver._ptr, force_bytes(clone_name), self._ptr, c_int(), c_char_p(), c_void_p(), c_void_p(), ), write=self._write, ) def transform( self, srs, driver=None, name=None, resampling="NearestNeighbour", max_error=0.0 ): """ Return a copy of this raster reprojected into the given spatial reference system. """ # Convert the resampling algorithm name into an algorithm id algorithm = GDAL_RESAMPLE_ALGORITHMS[resampling] if isinstance(srs, SpatialReference): target_srs = srs elif isinstance(srs, (int, str)): target_srs = SpatialReference(srs) else: raise TypeError( "Transform only accepts SpatialReference, string, and integer " "objects." ) if target_srs.srid == self.srid and (not driver or driver == self.driver.name): return self.clone(name) # Create warped virtual dataset in the target reference system target = capi.auto_create_warped_vrt( self._ptr, self.srs.wkt.encode(), target_srs.wkt.encode(), algorithm, max_error, c_void_p(), ) target = GDALRaster(target) # Construct the target warp dictionary from the virtual raster data = { "srid": target_srs.srid, "width": target.width, "height": target.height, "origin": [target.origin.x, target.origin.y], "scale": [target.scale.x, target.scale.y], "skew": [target.skew.x, target.skew.y], } # Set the driver and filepath if provided if driver: data["driver"] = driver if name: data["name"] = name # Warp the raster into new srid return self.warp(data, resampling=resampling, max_error=max_error) @property def info(self): """ Return information about this raster in a string format equivalent to the output of the gdalinfo command line utility. """ return capi.get_ds_info(self.ptr, None).decode()
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/raster/source.py
Python
mit
18,394
""" The Spatial Reference class, represents OGR Spatial Reference objects. Example: >>> from django.contrib.gis.gdal import SpatialReference >>> srs = SpatialReference('WGS84') >>> print(srs) GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]], TOWGS84[0,0,0,0,0,0,0], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0, AUTHORITY["EPSG","8901"]], UNIT["degree",0.01745329251994328, AUTHORITY["EPSG","9122"]], AUTHORITY["EPSG","4326"]] >>> print(srs.proj) +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs >>> print(srs.ellipsoid) (6378137.0, 6356752.3142451793, 298.25722356300003) >>> print(srs.projected, srs.geographic) False True >>> srs.import_epsg(32140) >>> print(srs.name) NAD83 / Texas South Central """ from ctypes import byref, c_char_p, c_int from enum import IntEnum from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import SRSException from django.contrib.gis.gdal.libgdal import GDAL_VERSION from django.contrib.gis.gdal.prototypes import srs as capi from django.utils.encoding import force_bytes, force_str class AxisOrder(IntEnum): TRADITIONAL = 0 AUTHORITY = 1 class SpatialReference(GDALBase): """ A wrapper for the OGRSpatialReference object. According to the GDAL web site, the SpatialReference object "provide[s] services to represent coordinate systems (projections and datums) and to transform between them." """ destructor = capi.release_srs def __init__(self, srs_input="", srs_type="user", axis_order=None): """ Create a GDAL OSR Spatial Reference object from the given input. The input may be string of OGC Well Known Text (WKT), an integer EPSG code, a PROJ string, and/or a projection "well known" shorthand string (one of 'WGS84', 'WGS72', 'NAD27', 'NAD83'). """ if not isinstance(axis_order, (type(None), AxisOrder)): raise ValueError( "SpatialReference.axis_order must be an AxisOrder instance." ) self.axis_order = axis_order or AxisOrder.TRADITIONAL if srs_type == "wkt": self.ptr = capi.new_srs(c_char_p(b"")) self.import_wkt(srs_input) if self.axis_order == AxisOrder.TRADITIONAL and GDAL_VERSION >= (3, 0): capi.set_axis_strategy(self.ptr, self.axis_order) elif self.axis_order != AxisOrder.TRADITIONAL and GDAL_VERSION < (3, 0): raise ValueError("%s is not supported in GDAL < 3.0." % self.axis_order) return elif isinstance(srs_input, str): try: # If SRID is a string, e.g., '4326', then make acceptable # as user input. srid = int(srs_input) srs_input = "EPSG:%d" % srid except ValueError: pass elif isinstance(srs_input, int): # EPSG integer code was input. srs_type = "epsg" elif isinstance(srs_input, self.ptr_type): srs = srs_input srs_type = "ogr" else: raise TypeError('Invalid SRS type "%s"' % srs_type) if srs_type == "ogr": # Input is already an SRS pointer. srs = srs_input else: # Creating a new SRS pointer, using the string buffer. buf = c_char_p(b"") srs = capi.new_srs(buf) # If the pointer is NULL, throw an exception. if not srs: raise SRSException( "Could not create spatial reference from: %s" % srs_input ) else: self.ptr = srs if self.axis_order == AxisOrder.TRADITIONAL and GDAL_VERSION >= (3, 0): capi.set_axis_strategy(self.ptr, self.axis_order) elif self.axis_order != AxisOrder.TRADITIONAL and GDAL_VERSION < (3, 0): raise ValueError("%s is not supported in GDAL < 3.0." % self.axis_order) # Importing from either the user input string or an integer SRID. if srs_type == "user": self.import_user_input(srs_input) elif srs_type == "epsg": self.import_epsg(srs_input) def __getitem__(self, target): """ Return the value of the given string attribute node, None if the node doesn't exist. Can also take a tuple as a parameter, (target, child), where child is the index of the attribute in the WKT. For example: >>> wkt = 'GEOGCS["WGS 84", DATUM["WGS_1984, ... AUTHORITY["EPSG","4326"]]' >>> srs = SpatialReference(wkt) # could also use 'WGS84', or 4326 >>> print(srs['GEOGCS']) WGS 84 >>> print(srs['DATUM']) WGS_1984 >>> print(srs['AUTHORITY']) EPSG >>> print(srs['AUTHORITY', 1]) # The authority value 4326 >>> print(srs['TOWGS84', 4]) # the fourth value in this wkt 0 >>> # For the units authority, have to use the pipe symbole. >>> print(srs['UNIT|AUTHORITY']) EPSG >>> print(srs['UNIT|AUTHORITY', 1]) # The authority value for the units 9122 """ if isinstance(target, tuple): return self.attr_value(*target) else: return self.attr_value(target) def __str__(self): "Use 'pretty' WKT." return self.pretty_wkt # #### SpatialReference Methods #### def attr_value(self, target, index=0): """ The attribute value for the given target node (e.g. 'PROJCS'). The index keyword specifies an index of the child node to return. """ if not isinstance(target, str) or not isinstance(index, int): raise TypeError return capi.get_attr_value(self.ptr, force_bytes(target), index) def auth_name(self, target): "Return the authority name for the given string target node." return capi.get_auth_name( self.ptr, target if target is None else force_bytes(target) ) def auth_code(self, target): "Return the authority code for the given string target node." return capi.get_auth_code( self.ptr, target if target is None else force_bytes(target) ) def clone(self): "Return a clone of this SpatialReference object." return SpatialReference(capi.clone_srs(self.ptr), axis_order=self.axis_order) def from_esri(self): "Morph this SpatialReference from ESRI's format to EPSG." capi.morph_from_esri(self.ptr) def identify_epsg(self): """ This method inspects the WKT of this SpatialReference, and will add EPSG authority nodes where an EPSG identifier is applicable. """ capi.identify_epsg(self.ptr) def to_esri(self): "Morph this SpatialReference to ESRI's format." capi.morph_to_esri(self.ptr) def validate(self): "Check to see if the given spatial reference is valid." capi.srs_validate(self.ptr) # #### Name & SRID properties #### @property def name(self): "Return the name of this Spatial Reference." if self.projected: return self.attr_value("PROJCS") elif self.geographic: return self.attr_value("GEOGCS") elif self.local: return self.attr_value("LOCAL_CS") else: return None @property def srid(self): "Return the SRID of top-level authority, or None if undefined." try: return int(self.auth_code(target=None)) except (TypeError, ValueError): return None # #### Unit Properties #### @property def linear_name(self): "Return the name of the linear units." units, name = capi.linear_units(self.ptr, byref(c_char_p())) return name @property def linear_units(self): "Return the value of the linear units." units, name = capi.linear_units(self.ptr, byref(c_char_p())) return units @property def angular_name(self): "Return the name of the angular units." units, name = capi.angular_units(self.ptr, byref(c_char_p())) return name @property def angular_units(self): "Return the value of the angular units." units, name = capi.angular_units(self.ptr, byref(c_char_p())) return units @property def units(self): """ Return a 2-tuple of the units value and the units name. Automatically determine whether to return the linear or angular units. """ units, name = None, None if self.projected or self.local: units, name = capi.linear_units(self.ptr, byref(c_char_p())) elif self.geographic: units, name = capi.angular_units(self.ptr, byref(c_char_p())) if name is not None: name = force_str(name) return (units, name) # #### Spheroid/Ellipsoid Properties #### @property def ellipsoid(self): """ Return a tuple of the ellipsoid parameters: (semimajor axis, semiminor axis, and inverse flattening) """ return (self.semi_major, self.semi_minor, self.inverse_flattening) @property def semi_major(self): "Return the Semi Major Axis for this Spatial Reference." return capi.semi_major(self.ptr, byref(c_int())) @property def semi_minor(self): "Return the Semi Minor Axis for this Spatial Reference." return capi.semi_minor(self.ptr, byref(c_int())) @property def inverse_flattening(self): "Return the Inverse Flattening for this Spatial Reference." return capi.invflattening(self.ptr, byref(c_int())) # #### Boolean Properties #### @property def geographic(self): """ Return True if this SpatialReference is geographic (root node is GEOGCS). """ return bool(capi.isgeographic(self.ptr)) @property def local(self): "Return True if this SpatialReference is local (root node is LOCAL_CS)." return bool(capi.islocal(self.ptr)) @property def projected(self): """ Return True if this SpatialReference is a projected coordinate system (root node is PROJCS). """ return bool(capi.isprojected(self.ptr)) # #### Import Routines ##### def import_epsg(self, epsg): "Import the Spatial Reference from the EPSG code (an integer)." capi.from_epsg(self.ptr, epsg) def import_proj(self, proj): """Import the Spatial Reference from a PROJ string.""" capi.from_proj(self.ptr, proj) def import_user_input(self, user_input): "Import the Spatial Reference from the given user input string." capi.from_user_input(self.ptr, force_bytes(user_input)) def import_wkt(self, wkt): "Import the Spatial Reference from OGC WKT (string)" capi.from_wkt(self.ptr, byref(c_char_p(force_bytes(wkt)))) def import_xml(self, xml): "Import the Spatial Reference from an XML string." capi.from_xml(self.ptr, xml) # #### Export Properties #### @property def wkt(self): "Return the WKT representation of this Spatial Reference." return capi.to_wkt(self.ptr, byref(c_char_p())) @property def pretty_wkt(self, simplify=0): "Return the 'pretty' representation of the WKT." return capi.to_pretty_wkt(self.ptr, byref(c_char_p()), simplify) @property def proj(self): """Return the PROJ representation for this Spatial Reference.""" return capi.to_proj(self.ptr, byref(c_char_p())) @property def proj4(self): "Alias for proj()." return self.proj @property def xml(self, dialect=""): "Return the XML representation of this Spatial Reference." return capi.to_xml(self.ptr, byref(c_char_p()), force_bytes(dialect)) class CoordTransform(GDALBase): "The coordinate system transformation object." destructor = capi.destroy_ct def __init__(self, source, target): "Initialize on a source and target SpatialReference objects." if not isinstance(source, SpatialReference) or not isinstance( target, SpatialReference ): raise TypeError("source and target must be of type SpatialReference") self.ptr = capi.new_ct(source._ptr, target._ptr) self._srs1_name = source.name self._srs2_name = target.name def __str__(self): return 'Transform from "%s" to "%s"' % (self._srs1_name, self._srs2_name)
castiel248/Convert
Lib/site-packages/django/contrib/gis/gdal/srs.py
Python
mit
12,775
""" This module houses the GeoIP2 object, a wrapper for the MaxMind GeoIP2(R) Python API (https://geoip2.readthedocs.io/). This is an alternative to the Python GeoIP2 interface provided by MaxMind. GeoIP(R) is a registered trademark of MaxMind, Inc. For IP-based geolocation, this module requires the GeoLite2 Country and City datasets, in binary format (CSV will not work!). The datasets may be downloaded from MaxMind at https://dev.maxmind.com/geoip/geoip2/geolite2/. Grab GeoLite2-Country.mmdb.gz and GeoLite2-City.mmdb.gz, and unzip them in the directory corresponding to settings.GEOIP_PATH. """ __all__ = ["HAS_GEOIP2"] try: import geoip2 # NOQA except ImportError: HAS_GEOIP2 = False else: from .base import GeoIP2, GeoIP2Exception HAS_GEOIP2 = True __all__ += ["GeoIP2", "GeoIP2Exception"]
castiel248/Convert
Lib/site-packages/django/contrib/gis/geoip2/__init__.py
Python
mit
824
import socket import geoip2.database from django.conf import settings from django.core.exceptions import ValidationError from django.core.validators import validate_ipv46_address from django.utils._os import to_path from .resources import City, Country # Creating the settings dictionary with any settings, if needed. GEOIP_SETTINGS = { "GEOIP_PATH": getattr(settings, "GEOIP_PATH", None), "GEOIP_CITY": getattr(settings, "GEOIP_CITY", "GeoLite2-City.mmdb"), "GEOIP_COUNTRY": getattr(settings, "GEOIP_COUNTRY", "GeoLite2-Country.mmdb"), } class GeoIP2Exception(Exception): pass class GeoIP2: # The flags for GeoIP memory caching. # Try MODE_MMAP_EXT, MODE_MMAP, MODE_FILE in that order. MODE_AUTO = 0 # Use the C extension with memory map. MODE_MMAP_EXT = 1 # Read from memory map. Pure Python. MODE_MMAP = 2 # Read database as standard file. Pure Python. MODE_FILE = 4 # Load database into memory. Pure Python. MODE_MEMORY = 8 cache_options = frozenset( (MODE_AUTO, MODE_MMAP_EXT, MODE_MMAP, MODE_FILE, MODE_MEMORY) ) # Paths to the city & country binary databases. _city_file = "" _country_file = "" # Initially, pointers to GeoIP file references are NULL. _city = None _country = None def __init__(self, path=None, cache=0, country=None, city=None): """ Initialize the GeoIP object. No parameters are required to use default settings. Keyword arguments may be passed in to customize the locations of the GeoIP datasets. * path: Base directory to where GeoIP data is located or the full path to where the city or country data files (*.mmdb) are located. Assumes that both the city and country data sets are located in this directory; overrides the GEOIP_PATH setting. * cache: The cache settings when opening up the GeoIP datasets. May be an integer in (0, 1, 2, 4, 8) corresponding to the MODE_AUTO, MODE_MMAP_EXT, MODE_MMAP, MODE_FILE, and MODE_MEMORY, `GeoIPOptions` C API settings, respectively. Defaults to 0, meaning MODE_AUTO. * country: The name of the GeoIP country data file. Defaults to 'GeoLite2-Country.mmdb'; overrides the GEOIP_COUNTRY setting. * city: The name of the GeoIP city data file. Defaults to 'GeoLite2-City.mmdb'; overrides the GEOIP_CITY setting. """ # Checking the given cache option. if cache not in self.cache_options: raise GeoIP2Exception("Invalid GeoIP caching option: %s" % cache) # Getting the GeoIP data path. path = path or GEOIP_SETTINGS["GEOIP_PATH"] if not path: raise GeoIP2Exception( "GeoIP path must be provided via parameter or the GEOIP_PATH setting." ) path = to_path(path) if path.is_dir(): # Constructing the GeoIP database filenames using the settings # dictionary. If the database files for the GeoLite country # and/or city datasets exist, then try to open them. country_db = path / (country or GEOIP_SETTINGS["GEOIP_COUNTRY"]) if country_db.is_file(): self._country = geoip2.database.Reader(str(country_db), mode=cache) self._country_file = country_db city_db = path / (city or GEOIP_SETTINGS["GEOIP_CITY"]) if city_db.is_file(): self._city = geoip2.database.Reader(str(city_db), mode=cache) self._city_file = city_db if not self._reader: raise GeoIP2Exception("Could not load a database from %s." % path) elif path.is_file(): # Otherwise, some detective work will be needed to figure out # whether the given database path is for the GeoIP country or city # databases. reader = geoip2.database.Reader(str(path), mode=cache) db_type = reader.metadata().database_type if "City" in db_type: # GeoLite City database detected. self._city = reader self._city_file = path elif "Country" in db_type: # GeoIP Country database detected. self._country = reader self._country_file = path else: raise GeoIP2Exception( "Unable to recognize database edition: %s" % db_type ) else: raise GeoIP2Exception("GeoIP path must be a valid file or directory.") @property def _reader(self): return self._country or self._city @property def _country_or_city(self): if self._country: return self._country.country else: return self._city.city def __del__(self): # Cleanup any GeoIP file handles lying around. if self._reader: self._reader.close() def __repr__(self): meta = self._reader.metadata() version = "[v%s.%s]" % ( meta.binary_format_major_version, meta.binary_format_minor_version, ) return ( '<%(cls)s %(version)s _country_file="%(country)s", _city_file="%(city)s">' % { "cls": self.__class__.__name__, "version": version, "country": self._country_file, "city": self._city_file, } ) def _check_query(self, query, city=False, city_or_country=False): "Check the query and database availability." # Making sure a string was passed in for the query. if not isinstance(query, str): raise TypeError( "GeoIP query must be a string, not type %s" % type(query).__name__ ) # Extra checks for the existence of country and city databases. if city_or_country and not (self._country or self._city): raise GeoIP2Exception("Invalid GeoIP country and city data files.") elif city and not self._city: raise GeoIP2Exception("Invalid GeoIP city data file: %s" % self._city_file) # Return the query string back to the caller. GeoIP2 only takes IP addresses. try: validate_ipv46_address(query) except ValidationError: query = socket.gethostbyname(query) return query def city(self, query): """ Return a dictionary of city information for the given IP address or Fully Qualified Domain Name (FQDN). Some information in the dictionary may be undefined (None). """ enc_query = self._check_query(query, city=True) return City(self._city.city(enc_query)) def country_code(self, query): "Return the country code for the given IP Address or FQDN." return self.country(query)["country_code"] def country_name(self, query): "Return the country name for the given IP Address or FQDN." return self.country(query)["country_name"] def country(self, query): """ Return a dictionary with the country code and name when given an IP address or a Fully Qualified Domain Name (FQDN). For example, both '24.124.1.80' and 'djangoproject.com' are valid parameters. """ # Returning the country code and name enc_query = self._check_query(query, city_or_country=True) return Country(self._country_or_city(enc_query)) # #### Coordinate retrieval routines #### def coords(self, query, ordering=("longitude", "latitude")): cdict = self.city(query) if cdict is None: return None else: return tuple(cdict[o] for o in ordering) def lon_lat(self, query): "Return a tuple of the (longitude, latitude) for the given query." return self.coords(query) def lat_lon(self, query): "Return a tuple of the (latitude, longitude) for the given query." return self.coords(query, ("latitude", "longitude")) def geos(self, query): "Return a GEOS Point object for the given query." ll = self.lon_lat(query) if ll: # Allows importing and using GeoIP2() when GEOS is not installed. from django.contrib.gis.geos import Point return Point(ll, srid=4326) else: return None # #### GeoIP Database Information Routines #### @property def info(self): "Return information about the GeoIP library and databases in use." meta = self._reader.metadata() return "GeoIP Library:\n\t%s.%s\n" % ( meta.binary_format_major_version, meta.binary_format_minor_version, ) @classmethod def open(cls, full_path, cache): return GeoIP2(full_path, cache)
castiel248/Convert
Lib/site-packages/django/contrib/gis/geoip2/base.py
Python
mit
8,942
def City(response): return { "city": response.city.name, "continent_code": response.continent.code, "continent_name": response.continent.name, "country_code": response.country.iso_code, "country_name": response.country.name, "dma_code": response.location.metro_code, "is_in_european_union": response.country.is_in_european_union, "latitude": response.location.latitude, "longitude": response.location.longitude, "postal_code": response.postal.code, "region": response.subdivisions[0].iso_code if response.subdivisions else None, "time_zone": response.location.time_zone, } def Country(response): return { "country_code": response.country.iso_code, "country_name": response.country.name, }
castiel248/Convert
Lib/site-packages/django/contrib/gis/geoip2/resources.py
Python
mit
819
import re from django.utils.regex_helper import _lazy_re_compile # Regular expression for recognizing HEXEWKB and WKT. A prophylactic measure # to prevent potentially malicious input from reaching the underlying C # library. Not a substitute for good web security programming practices. hex_regex = _lazy_re_compile(r"^[0-9A-F]+$", re.I) wkt_regex = _lazy_re_compile( r"^(SRID=(?P<srid>\-?[0-9]+);)?" r"(?P<wkt>" r"(?P<type>POINT|LINESTRING|LINEARRING|POLYGON|MULTIPOINT|" r"MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)" r"[ACEGIMLONPSRUTYZ0-9,\.\-\+\(\) ]+)$", re.I, ) json_regex = _lazy_re_compile(r"^(\s+)?\{.*}(\s+)?$", re.DOTALL)
castiel248/Convert
Lib/site-packages/django/contrib/gis/geometry.py
Python
mit
666
""" The GeoDjango GEOS module. Please consult the GeoDjango documentation for more details: https://docs.djangoproject.com/en/dev/ref/contrib/gis/geos/ """ from .collections import ( # NOQA GeometryCollection, MultiLineString, MultiPoint, MultiPolygon, ) from .error import GEOSException # NOQA from .factory import fromfile, fromstr # NOQA from .geometry import GEOSGeometry, hex_regex, wkt_regex # NOQA from .io import WKBReader, WKBWriter, WKTReader, WKTWriter # NOQA from .libgeos import geos_version # NOQA from .linestring import LinearRing, LineString # NOQA from .point import Point # NOQA from .polygon import Polygon # NOQA
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/__init__.py
Python
mit
660
from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.ptr import CPointerBase class GEOSBase(CPointerBase): null_ptr_exception_class = GEOSException
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/base.py
Python
mit
181
""" This module houses the Geometry Collection objects: GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon """ from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin from django.contrib.gis.geos.libgeos import GEOM_PTR from django.contrib.gis.geos.linestring import LinearRing, LineString from django.contrib.gis.geos.point import Point from django.contrib.gis.geos.polygon import Polygon class GeometryCollection(GEOSGeometry): _typeid = 7 def __init__(self, *args, **kwargs): "Initialize a Geometry Collection from a sequence of Geometry objects." # Checking the arguments if len(args) == 1: # If only one geometry provided or a list of geometries is provided # in the first argument. if isinstance(args[0], (tuple, list)): init_geoms = args[0] else: init_geoms = args else: init_geoms = args # Ensuring that only the permitted geometries are allowed in this collection # this is moved to list mixin super class self._check_allowed(init_geoms) # Creating the geometry pointer array. collection = self._create_collection(len(init_geoms), init_geoms) super().__init__(collection, **kwargs) def __iter__(self): "Iterate over each Geometry in the Collection." for i in range(len(self)): yield self[i] def __len__(self): "Return the number of geometries in this Collection." return self.num_geom # ### Methods for compatibility with ListMixin ### def _create_collection(self, length, items): # Creating the geometry pointer array. geoms = (GEOM_PTR * length)( *[ # this is a little sloppy, but makes life easier # allow GEOSGeometry types (python wrappers) or pointer types capi.geom_clone(getattr(g, "ptr", g)) for g in items ] ) return capi.create_collection(self._typeid, geoms, length) def _get_single_internal(self, index): return capi.get_geomn(self.ptr, index) def _get_single_external(self, index): "Return the Geometry from this Collection at the given index (0-based)." # Checking the index and returning the corresponding GEOS geometry. return GEOSGeometry( capi.geom_clone(self._get_single_internal(index)), srid=self.srid ) def _set_list(self, length, items): "Create a new collection, and destroy the contents of the previous pointer." prev_ptr = self.ptr srid = self.srid self.ptr = self._create_collection(length, items) if srid: self.srid = srid capi.destroy_geom(prev_ptr) _set_single = GEOSGeometry._set_single_rebuild _assign_extended_slice = GEOSGeometry._assign_extended_slice_rebuild @property def kml(self): "Return the KML for this Geometry Collection." return "<MultiGeometry>%s</MultiGeometry>" % "".join(g.kml for g in self) @property def tuple(self): "Return a tuple of all the coordinates in this Geometry Collection" return tuple(g.tuple for g in self) coords = tuple # MultiPoint, MultiLineString, and MultiPolygon class definitions. class MultiPoint(GeometryCollection): _allowed = Point _typeid = 4 class MultiLineString(LinearGeometryMixin, GeometryCollection): _allowed = (LineString, LinearRing) _typeid = 5 class MultiPolygon(GeometryCollection): _allowed = Polygon _typeid = 6 # Setting the allowed types here since GeometryCollection is defined before # its subclasses. GeometryCollection._allowed = ( Point, LineString, LinearRing, Polygon, MultiPoint, MultiLineString, MultiPolygon, )
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/collections.py
Python
mit
3,940
""" This module houses the GEOSCoordSeq object, which is used internally by GEOSGeometry to house the actual coordinates of the Point, LineString, and LinearRing geometries. """ from ctypes import byref, c_byte, c_double, c_uint from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.base import GEOSBase from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.libgeos import CS_PTR, geos_version_tuple from django.contrib.gis.shortcuts import numpy class GEOSCoordSeq(GEOSBase): "The internal representation of a list of coordinates inside a Geometry." ptr_type = CS_PTR def __init__(self, ptr, z=False): "Initialize from a GEOS pointer." if not isinstance(ptr, CS_PTR): raise TypeError("Coordinate sequence should initialize with a CS_PTR.") self._ptr = ptr self._z = z def __iter__(self): "Iterate over each point in the coordinate sequence." for i in range(self.size): yield self[i] def __len__(self): "Return the number of points in the coordinate sequence." return self.size def __str__(self): "Return the string representation of the coordinate sequence." return str(self.tuple) def __getitem__(self, index): "Return the coordinate sequence value at the given index." self._checkindex(index) return self._point_getter(index) def __setitem__(self, index, value): "Set the coordinate sequence value at the given index." # Checking the input value if isinstance(value, (list, tuple)): pass elif numpy and isinstance(value, numpy.ndarray): pass else: raise TypeError( "Must set coordinate with a sequence (list, tuple, or numpy array)." ) # Checking the dims of the input if self.dims == 3 and self._z: n_args = 3 point_setter = self._set_point_3d else: n_args = 2 point_setter = self._set_point_2d if len(value) != n_args: raise TypeError("Dimension of value does not match.") self._checkindex(index) point_setter(index, value) # #### Internal Routines #### def _checkindex(self, index): "Check the given index." if not (0 <= index < self.size): raise IndexError("invalid GEOS Geometry index: %s" % index) def _checkdim(self, dim): "Check the given dimension." if dim < 0 or dim > 2: raise GEOSException('invalid ordinate dimension "%d"' % dim) def _get_x(self, index): return capi.cs_getx(self.ptr, index, byref(c_double())) def _get_y(self, index): return capi.cs_gety(self.ptr, index, byref(c_double())) def _get_z(self, index): return capi.cs_getz(self.ptr, index, byref(c_double())) def _set_x(self, index, value): capi.cs_setx(self.ptr, index, value) def _set_y(self, index, value): capi.cs_sety(self.ptr, index, value) def _set_z(self, index, value): capi.cs_setz(self.ptr, index, value) @property def _point_getter(self): return self._get_point_3d if self.dims == 3 and self._z else self._get_point_2d def _get_point_2d(self, index): return (self._get_x(index), self._get_y(index)) def _get_point_3d(self, index): return (self._get_x(index), self._get_y(index), self._get_z(index)) def _set_point_2d(self, index, value): x, y = value self._set_x(index, x) self._set_y(index, y) def _set_point_3d(self, index, value): x, y, z = value self._set_x(index, x) self._set_y(index, y) self._set_z(index, z) # #### Ordinate getting and setting routines #### def getOrdinate(self, dimension, index): "Return the value for the given dimension and index." self._checkindex(index) self._checkdim(dimension) return capi.cs_getordinate(self.ptr, index, dimension, byref(c_double())) def setOrdinate(self, dimension, index, value): "Set the value for the given dimension and index." self._checkindex(index) self._checkdim(dimension) capi.cs_setordinate(self.ptr, index, dimension, value) def getX(self, index): "Get the X value at the index." return self.getOrdinate(0, index) def setX(self, index, value): "Set X with the value at the given index." self.setOrdinate(0, index, value) def getY(self, index): "Get the Y value at the given index." return self.getOrdinate(1, index) def setY(self, index, value): "Set Y with the value at the given index." self.setOrdinate(1, index, value) def getZ(self, index): "Get Z with the value at the given index." return self.getOrdinate(2, index) def setZ(self, index, value): "Set Z with the value at the given index." self.setOrdinate(2, index, value) # ### Dimensions ### @property def size(self): "Return the size of this coordinate sequence." return capi.cs_getsize(self.ptr, byref(c_uint())) @property def dims(self): "Return the dimensions of this coordinate sequence." return capi.cs_getdims(self.ptr, byref(c_uint())) @property def hasz(self): """ Return whether this coordinate sequence is 3D. This property value is inherited from the parent Geometry. """ return self._z # ### Other Methods ### def clone(self): "Clone this coordinate sequence." return GEOSCoordSeq(capi.cs_clone(self.ptr), self.hasz) @property def kml(self): "Return the KML representation for the coordinates." # Getting the substitution string depending on whether the coordinates have # a Z dimension. if self.hasz: substr = "%s,%s,%s " else: substr = "%s,%s,0 " return ( "<coordinates>%s</coordinates>" % "".join(substr % self[i] for i in range(len(self))).strip() ) @property def tuple(self): "Return a tuple version of this coordinate sequence." n = self.size get_point = self._point_getter if n == 1: return get_point(0) return tuple(get_point(i) for i in range(n)) @property def is_counterclockwise(self): """Return whether this coordinate sequence is counterclockwise.""" if geos_version_tuple() < (3, 7): # A modified shoelace algorithm to determine polygon orientation. # See https://en.wikipedia.org/wiki/Shoelace_formula. area = 0.0 n = len(self) for i in range(n): j = (i + 1) % n area += self[i][0] * self[j][1] area -= self[j][0] * self[i][1] return area > 0.0 ret = c_byte() if not capi.cs_is_ccw(self.ptr, byref(ret)): raise GEOSException( 'Error encountered in GEOS C function "%s".' % capi.cs_is_ccw.func_name ) return ret.value == 1
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/coordseq.py
Python
mit
7,284
class GEOSException(Exception): "The base GEOS exception, indicates a GEOS-related error." pass
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/error.py
Python
mit
104
from django.contrib.gis.geos.geometry import GEOSGeometry, hex_regex, wkt_regex def fromfile(file_h): """ Given a string file name, returns a GEOSGeometry. The file may contain WKB, WKT, or HEX. """ # If given a file name, get a real handle. if isinstance(file_h, str): with open(file_h, "rb") as file_h: buf = file_h.read() else: buf = file_h.read() # If we get WKB need to wrap in memoryview(), so run through regexes. if isinstance(buf, bytes): try: decoded = buf.decode() except UnicodeDecodeError: pass else: if wkt_regex.match(decoded) or hex_regex.match(decoded): return GEOSGeometry(decoded) else: return GEOSGeometry(buf) return GEOSGeometry(memoryview(buf)) def fromstr(string, **kwargs): "Given a string value, return a GEOSGeometry object." return GEOSGeometry(string, **kwargs)
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/factory.py
Python
mit
961
""" This module contains the 'base' GEOSGeometry object -- all GEOS Geometries inherit from this object. """ import re from ctypes import addressof, byref, c_double from django.contrib.gis import gdal from django.contrib.gis.geometry import hex_regex, json_regex, wkt_regex from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.base import GEOSBase from django.contrib.gis.geos.coordseq import GEOSCoordSeq from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.libgeos import GEOM_PTR, geos_version_tuple from django.contrib.gis.geos.mutable_list import ListMixin from django.contrib.gis.geos.prepared import PreparedGeometry from django.contrib.gis.geos.prototypes.io import ewkb_w, wkb_r, wkb_w, wkt_r, wkt_w from django.utils.deconstruct import deconstructible from django.utils.encoding import force_bytes, force_str class GEOSGeometryBase(GEOSBase): _GEOS_CLASSES = None ptr_type = GEOM_PTR destructor = capi.destroy_geom has_cs = False # Only Point, LineString, LinearRing have coordinate sequences def __init__(self, ptr, cls): self._ptr = ptr # Setting the class type (e.g., Point, Polygon, etc.) if type(self) in (GEOSGeometryBase, GEOSGeometry): if cls is None: if GEOSGeometryBase._GEOS_CLASSES is None: # Inner imports avoid import conflicts with GEOSGeometry. from .collections import ( GeometryCollection, MultiLineString, MultiPoint, MultiPolygon, ) from .linestring import LinearRing, LineString from .point import Point from .polygon import Polygon GEOSGeometryBase._GEOS_CLASSES = { 0: Point, 1: LineString, 2: LinearRing, 3: Polygon, 4: MultiPoint, 5: MultiLineString, 6: MultiPolygon, 7: GeometryCollection, } cls = GEOSGeometryBase._GEOS_CLASSES[self.geom_typeid] self.__class__ = cls self._post_init() def _post_init(self): "Perform post-initialization setup." # Setting the coordinate sequence for the geometry (will be None on # geometries that do not have coordinate sequences) self._cs = ( GEOSCoordSeq(capi.get_cs(self.ptr), self.hasz) if self.has_cs else None ) def __copy__(self): """ Return a clone because the copy of a GEOSGeometry may contain an invalid pointer location if the original is garbage collected. """ return self.clone() def __deepcopy__(self, memodict): """ The `deepcopy` routine is used by the `Node` class of django.utils.tree; thus, the protocol routine needs to be implemented to return correct copies (clones) of these GEOS objects, which use C pointers. """ return self.clone() def __str__(self): "EWKT is used for the string representation." return self.ewkt def __repr__(self): "Short-hand representation because WKT may be very large." return "<%s object at %s>" % (self.geom_type, hex(addressof(self.ptr))) # Pickling support def _to_pickle_wkb(self): return bytes(self.wkb) def _from_pickle_wkb(self, wkb): return wkb_r().read(memoryview(wkb)) def __getstate__(self): # The pickled state is simply a tuple of the WKB (in string form) # and the SRID. return self._to_pickle_wkb(), self.srid def __setstate__(self, state): # Instantiating from the tuple state that was pickled. wkb, srid = state ptr = self._from_pickle_wkb(wkb) if not ptr: raise GEOSException("Invalid Geometry loaded from pickled state.") self.ptr = ptr self._post_init() self.srid = srid @classmethod def _from_wkb(cls, wkb): return wkb_r().read(wkb) @staticmethod def from_ewkt(ewkt): ewkt = force_bytes(ewkt) srid = None parts = ewkt.split(b";", 1) if len(parts) == 2: srid_part, wkt = parts match = re.match(rb"SRID=(?P<srid>\-?\d+)", srid_part) if not match: raise ValueError("EWKT has invalid SRID part.") srid = int(match["srid"]) else: wkt = ewkt if not wkt: raise ValueError("Expected WKT but got an empty string.") return GEOSGeometry(GEOSGeometry._from_wkt(wkt), srid=srid) @staticmethod def _from_wkt(wkt): return wkt_r().read(wkt) @classmethod def from_gml(cls, gml_string): return gdal.OGRGeometry.from_gml(gml_string).geos # Comparison operators def __eq__(self, other): """ Equivalence testing, a Geometry may be compared with another Geometry or an EWKT representation. """ if isinstance(other, str): try: other = GEOSGeometry.from_ewkt(other) except (ValueError, GEOSException): return False return ( isinstance(other, GEOSGeometry) and self.srid == other.srid and self.equals_exact(other) ) def __hash__(self): return hash((self.srid, self.wkt)) # ### Geometry set-like operations ### # Thanks to Sean Gillies for inspiration: # http://lists.gispython.org/pipermail/community/2007-July/001034.html # g = g1 | g2 def __or__(self, other): "Return the union of this Geometry and the other." return self.union(other) # g = g1 & g2 def __and__(self, other): "Return the intersection of this Geometry and the other." return self.intersection(other) # g = g1 - g2 def __sub__(self, other): "Return the difference this Geometry and the other." return self.difference(other) # g = g1 ^ g2 def __xor__(self, other): "Return the symmetric difference of this Geometry and the other." return self.sym_difference(other) # #### Coordinate Sequence Routines #### @property def coord_seq(self): "Return a clone of the coordinate sequence for this Geometry." if self.has_cs: return self._cs.clone() # #### Geometry Info #### @property def geom_type(self): "Return a string representing the Geometry type, e.g. 'Polygon'" return capi.geos_type(self.ptr).decode() @property def geom_typeid(self): "Return an integer representing the Geometry type." return capi.geos_typeid(self.ptr) @property def num_geom(self): "Return the number of geometries in the Geometry." return capi.get_num_geoms(self.ptr) @property def num_coords(self): "Return the number of coordinates in the Geometry." return capi.get_num_coords(self.ptr) @property def num_points(self): "Return the number points, or coordinates, in the Geometry." return self.num_coords @property def dims(self): "Return the dimension of this Geometry (0=point, 1=line, 2=surface)." return capi.get_dims(self.ptr) def normalize(self, clone=False): """ Convert this Geometry to normal form (or canonical form). If the `clone` keyword is set, then the geometry is not modified and a normalized clone of the geometry is returned instead. """ if clone: clone = self.clone() capi.geos_normalize(clone.ptr) return clone capi.geos_normalize(self.ptr) def make_valid(self): """ Attempt to create a valid representation of a given invalid geometry without losing any of the input vertices. """ if geos_version_tuple() < (3, 8): raise GEOSException("GEOSGeometry.make_valid() requires GEOS >= 3.8.0.") return GEOSGeometry(capi.geos_makevalid(self.ptr), srid=self.srid) # #### Unary predicates #### @property def empty(self): """ Return a boolean indicating whether the set of points in this Geometry are empty. """ return capi.geos_isempty(self.ptr) @property def hasz(self): "Return whether the geometry has a 3D dimension." return capi.geos_hasz(self.ptr) @property def ring(self): "Return whether or not the geometry is a ring." return capi.geos_isring(self.ptr) @property def simple(self): "Return false if the Geometry isn't simple." return capi.geos_issimple(self.ptr) @property def valid(self): "Test the validity of this Geometry." return capi.geos_isvalid(self.ptr) @property def valid_reason(self): """ Return a string containing the reason for any invalidity. """ return capi.geos_isvalidreason(self.ptr).decode() # #### Binary predicates. #### def contains(self, other): "Return true if other.within(this) returns true." return capi.geos_contains(self.ptr, other.ptr) def covers(self, other): """ Return True if the DE-9IM Intersection Matrix for the two geometries is T*****FF*, *T****FF*, ***T**FF*, or ****T*FF*. If either geometry is empty, return False. """ return capi.geos_covers(self.ptr, other.ptr) def crosses(self, other): """ Return 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). """ return capi.geos_crosses(self.ptr, other.ptr) def disjoint(self, other): """ Return true if the DE-9IM intersection matrix for the two Geometries is FF*FF****. """ return capi.geos_disjoint(self.ptr, other.ptr) def equals(self, other): """ Return true if the DE-9IM intersection matrix for the two Geometries is T*F**FFF*. """ return capi.geos_equals(self.ptr, other.ptr) def equals_exact(self, other, tolerance=0): """ Return true if the two Geometries are exactly equal, up to a specified tolerance. """ return capi.geos_equalsexact(self.ptr, other.ptr, float(tolerance)) def intersects(self, other): "Return true if disjoint return false." return capi.geos_intersects(self.ptr, other.ptr) def overlaps(self, other): """ Return 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). """ return capi.geos_overlaps(self.ptr, other.ptr) def relate_pattern(self, other, pattern): """ Return true if the elements in the DE-9IM intersection matrix for the two Geometries match the elements in pattern. """ if not isinstance(pattern, str) or len(pattern) > 9: raise GEOSException("invalid intersection matrix pattern") return capi.geos_relatepattern(self.ptr, other.ptr, force_bytes(pattern)) def touches(self, other): """ Return true if the DE-9IM intersection matrix for the two Geometries is FT*******, F**T***** or F***T****. """ return capi.geos_touches(self.ptr, other.ptr) def within(self, other): """ Return true if the DE-9IM intersection matrix for the two Geometries is T*F**F***. """ return capi.geos_within(self.ptr, other.ptr) # #### SRID Routines #### @property def srid(self): "Get the SRID for the geometry. Return None if no SRID is set." s = capi.geos_get_srid(self.ptr) if s == 0: return None else: return s @srid.setter def srid(self, srid): "Set the SRID for the geometry." capi.geos_set_srid(self.ptr, 0 if srid is None else srid) # #### Output Routines #### @property def ewkt(self): """ Return the EWKT (SRID + WKT) of the Geometry. """ srid = self.srid return "SRID=%s;%s" % (srid, self.wkt) if srid else self.wkt @property def wkt(self): "Return the WKT (Well-Known Text) representation of this Geometry." return wkt_w(dim=3 if self.hasz else 2, trim=True).write(self).decode() @property def hex(self): """ Return the WKB of this Geometry in hexadecimal form. Please note that the SRID is not included in this representation because it is not a part of the OGC specification (use the `hexewkb` property instead). """ # A possible faster, all-python, implementation: # str(self.wkb).encode('hex') return wkb_w(dim=3 if self.hasz else 2).write_hex(self) @property def hexewkb(self): """ Return the EWKB of this Geometry in hexadecimal form. This is an extension of the WKB specification that includes SRID value that are a part of this geometry. """ return ewkb_w(dim=3 if self.hasz else 2).write_hex(self) @property def json(self): """ Return GeoJSON representation of this Geometry. """ return self.ogr.json geojson = json @property def wkb(self): """ Return the WKB (Well-Known Binary) representation of this Geometry as a Python memoryview. SRID and Z values are not included, use the `ewkb` property instead. """ return wkb_w(3 if self.hasz else 2).write(self) @property def ewkb(self): """ Return the EWKB representation of this Geometry as a Python memoryview. This is an extension of the WKB specification that includes any SRID value that are a part of this geometry. """ return ewkb_w(3 if self.hasz else 2).write(self) @property def kml(self): "Return the KML representation of this Geometry." gtype = self.geom_type return "<%s>%s</%s>" % (gtype, self.coord_seq.kml, gtype) @property def prepared(self): """ Return a PreparedGeometry corresponding to this geometry -- it is optimized for the contains, intersects, and covers operations. """ return PreparedGeometry(self) # #### GDAL-specific output routines #### def _ogr_ptr(self): return gdal.OGRGeometry._from_wkb(self.wkb) @property def ogr(self): "Return the OGR Geometry for this Geometry." return gdal.OGRGeometry(self._ogr_ptr(), self.srs) @property def srs(self): "Return the OSR SpatialReference for SRID of this Geometry." if self.srid: try: return gdal.SpatialReference(self.srid) except (gdal.GDALException, gdal.SRSException): pass return None @property def crs(self): "Alias for `srs` property." return self.srs def transform(self, ct, clone=False): """ Requires GDAL. Transform the geometry according to the given transformation object, which may be an integer SRID, and WKT or PROJ string. By default, transform the geometry in-place and return nothing. However if the `clone` keyword is set, don't modify the geometry and return a transformed clone instead. """ srid = self.srid if ct == srid: # short-circuit where source & dest SRIDs match if clone: return self.clone() else: return if isinstance(ct, gdal.CoordTransform): # We don't care about SRID because CoordTransform presupposes # source SRS. srid = None elif srid is None or srid < 0: raise GEOSException("Calling transform() with no SRID set is not supported") # Creating an OGR Geometry, which is then transformed. g = gdal.OGRGeometry(self._ogr_ptr(), srid) g.transform(ct) # Getting a new GEOS pointer ptr = g._geos_ptr() if clone: # User wants a cloned transformed geometry returned. return GEOSGeometry(ptr, srid=g.srid) if ptr: # Reassigning pointer, and performing post-initialization setup # again due to the reassignment. capi.destroy_geom(self.ptr) self.ptr = ptr self._post_init() self.srid = g.srid else: raise GEOSException("Transformed WKB was invalid.") # #### Topology Routines #### def _topology(self, gptr): "Return Geometry from the given pointer." return GEOSGeometry(gptr, srid=self.srid) @property def boundary(self): "Return the boundary as a newly allocated Geometry object." return self._topology(capi.geos_boundary(self.ptr)) def buffer(self, width, quadsegs=8): """ Return a geometry that represents all points whose distance from this Geometry is less than or equal to distance. Calculations are in the Spatial Reference System of this Geometry. The optional third parameter sets the number of segment used to approximate a quarter circle (defaults to 8). (Text from PostGIS documentation at ch. 6.1.3) """ return self._topology(capi.geos_buffer(self.ptr, width, quadsegs)) def buffer_with_style( self, width, quadsegs=8, end_cap_style=1, join_style=1, mitre_limit=5.0 ): """ Same as buffer() but allows customizing the style of the memoryview. 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 only affects mitered join style. """ return self._topology( capi.geos_bufferwithstyle( self.ptr, width, quadsegs, end_cap_style, join_style, mitre_limit ), ) @property def centroid(self): """ The centroid is equal to the centroid of the set of component Geometries of highest dimension (since the lower-dimension geometries contribute zero "weight" to the centroid). """ return self._topology(capi.geos_centroid(self.ptr)) @property def convex_hull(self): """ Return the smallest convex Polygon that contains all the points in the Geometry. """ return self._topology(capi.geos_convexhull(self.ptr)) def difference(self, other): """ Return a Geometry representing the points making up this Geometry that do not make up other. """ return self._topology(capi.geos_difference(self.ptr, other.ptr)) @property def envelope(self): "Return the envelope for this geometry (a polygon)." return self._topology(capi.geos_envelope(self.ptr)) def intersection(self, other): "Return a Geometry representing the points shared by this Geometry and other." return self._topology(capi.geos_intersection(self.ptr, other.ptr)) @property def point_on_surface(self): "Compute an interior point of this Geometry." return self._topology(capi.geos_pointonsurface(self.ptr)) def relate(self, other): "Return the DE-9IM intersection matrix for this Geometry and the other." return capi.geos_relate(self.ptr, other.ptr).decode() def simplify(self, tolerance=0.0, preserve_topology=False): """ Return the Geometry, simplified using the Douglas-Peucker algorithm to the specified tolerance (higher tolerance => less points). If no tolerance provided, defaults to 0. By default, don't preserve topology - e.g. polygons can be split, collapse to lines or disappear holes can be created or disappear, and lines can cross. By specifying preserve_topology=True, the result will have the same dimension and number of components as the input. This is significantly slower. """ if preserve_topology: return self._topology(capi.geos_preservesimplify(self.ptr, tolerance)) else: return self._topology(capi.geos_simplify(self.ptr, tolerance)) def sym_difference(self, other): """ Return a set combining the points in this Geometry not in other, and the points in other not in this Geometry. """ return self._topology(capi.geos_symdifference(self.ptr, other.ptr)) @property def unary_union(self): "Return the union of all the elements of this geometry." return self._topology(capi.geos_unary_union(self.ptr)) def union(self, other): "Return a Geometry representing all the points in this Geometry and other." return self._topology(capi.geos_union(self.ptr, other.ptr)) # #### Other Routines #### @property def area(self): "Return the area of the Geometry." return capi.geos_area(self.ptr, byref(c_double())) def distance(self, other): """ Return the distance between the closest points on this Geometry and the other. Units will be in those of the coordinate system of the Geometry. """ if not isinstance(other, GEOSGeometry): raise TypeError("distance() works only on other GEOS Geometries.") return capi.geos_distance(self.ptr, other.ptr, byref(c_double())) @property def extent(self): """ Return the extent of this geometry as a 4-tuple, consisting of (xmin, ymin, xmax, ymax). """ from .point import Point env = self.envelope if isinstance(env, Point): xmin, ymin = env.tuple xmax, ymax = xmin, ymin else: xmin, ymin = env[0][0] xmax, ymax = env[0][2] return (xmin, ymin, xmax, ymax) @property def length(self): """ Return the length of this Geometry (e.g., 0 for point, or the circumference of a Polygon). """ return capi.geos_length(self.ptr, byref(c_double())) def clone(self): "Clone this Geometry." return GEOSGeometry(capi.geom_clone(self.ptr)) class LinearGeometryMixin: """ Used for LineString and MultiLineString. """ def interpolate(self, distance): return self._topology(capi.geos_interpolate(self.ptr, distance)) def interpolate_normalized(self, distance): return self._topology(capi.geos_interpolate_normalized(self.ptr, distance)) def project(self, point): from .point import Point if not isinstance(point, Point): raise TypeError("locate_point argument must be a Point") return capi.geos_project(self.ptr, point.ptr) def project_normalized(self, point): from .point import Point if not isinstance(point, Point): raise TypeError("locate_point argument must be a Point") return capi.geos_project_normalized(self.ptr, point.ptr) @property def merged(self): """ Return the line merge of this Geometry. """ return self._topology(capi.geos_linemerge(self.ptr)) @property def closed(self): """ Return whether or not this Geometry is closed. """ return capi.geos_isclosed(self.ptr) @deconstructible class GEOSGeometry(GEOSGeometryBase, ListMixin): "A class that, generally, encapsulates a GEOS geometry." def __init__(self, geo_input, srid=None): """ The base constructor for GEOS geometry objects. It may take the following inputs: * strings: - WKT - HEXEWKB (a PostGIS-specific canonical form) - GeoJSON (requires GDAL) * memoryview: - WKB The `srid` keyword specifies the Source Reference Identifier (SRID) number for this Geometry. If not provided, it defaults to None. """ input_srid = None if isinstance(geo_input, bytes): geo_input = force_str(geo_input) if isinstance(geo_input, str): wkt_m = wkt_regex.match(geo_input) if wkt_m: # Handle WKT input. if wkt_m["srid"]: input_srid = int(wkt_m["srid"]) g = self._from_wkt(force_bytes(wkt_m["wkt"])) elif hex_regex.match(geo_input): # Handle HEXEWKB input. g = wkb_r().read(force_bytes(geo_input)) elif json_regex.match(geo_input): # Handle GeoJSON input. ogr = gdal.OGRGeometry.from_json(geo_input) g = ogr._geos_ptr() input_srid = ogr.srid else: raise ValueError("String input unrecognized as WKT EWKT, and HEXEWKB.") elif isinstance(geo_input, GEOM_PTR): # When the input is a pointer to a geometry (GEOM_PTR). g = geo_input elif isinstance(geo_input, memoryview): # When the input is a memoryview (WKB). g = wkb_r().read(geo_input) elif isinstance(geo_input, GEOSGeometry): g = capi.geom_clone(geo_input.ptr) else: raise TypeError("Improper geometry input type: %s" % type(geo_input)) if not g: raise GEOSException("Could not initialize GEOS Geometry with given input.") input_srid = input_srid or capi.geos_get_srid(g) or None if input_srid and srid and input_srid != srid: raise ValueError("Input geometry already has SRID: %d." % input_srid) super().__init__(g, None) # Set the SRID, if given. srid = input_srid or srid if srid and isinstance(srid, int): self.srid = srid
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/geometry.py
Python
mit
26,418
""" Module that holds classes for performing I/O operations on GEOS geometry objects. Specifically, this has Python implementations of WKB/WKT reader and writer classes. """ from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.prototypes.io import ( WKBWriter, WKTWriter, _WKBReader, _WKTReader, ) __all__ = ["WKBWriter", "WKTWriter", "WKBReader", "WKTReader"] # Public classes for (WKB|WKT)Reader, which return GEOSGeometry class WKBReader(_WKBReader): def read(self, wkb): "Return a GEOSGeometry for the given WKB buffer." return GEOSGeometry(super().read(wkb)) class WKTReader(_WKTReader): def read(self, wkt): "Return a GEOSGeometry for the given WKT string." return GEOSGeometry(super().read(wkt))
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/io.py
Python
mit
799
""" This module houses the ctypes initialization procedures, as well as the notice and error handler function callbacks (get called when an error occurs in GEOS). This module also houses GEOS Pointer utilities, including get_pointer_arr(), and GEOM_PTR. """ import logging import os from ctypes import CDLL, CFUNCTYPE, POINTER, Structure, c_char_p from ctypes.util import find_library from django.core.exceptions import ImproperlyConfigured from django.utils.functional import SimpleLazyObject, cached_property from django.utils.version import get_version_tuple logger = logging.getLogger("django.contrib.gis") def load_geos(): # Custom library path set? try: from django.conf import settings lib_path = settings.GEOS_LIBRARY_PATH except (AttributeError, ImportError, ImproperlyConfigured, OSError): lib_path = None # Setting the appropriate names for the GEOS-C library. if lib_path: lib_names = None elif os.name == "nt": # Windows NT libraries lib_names = ["geos_c", "libgeos_c-1"] elif os.name == "posix": # *NIX libraries lib_names = ["geos_c", "GEOS"] else: raise ImportError('Unsupported OS "%s"' % os.name) # Using the ctypes `find_library` utility to find the path to the GEOS # shared library. This is better than manually specifying each library name # and extension (e.g., libgeos_c.[so|so.1|dylib].). if lib_names: for lib_name in lib_names: lib_path = find_library(lib_name) if lib_path is not None: break # No GEOS library could be found. if lib_path is None: raise ImportError( 'Could not find the GEOS library (tried "%s"). ' "Try setting GEOS_LIBRARY_PATH in your settings." % '", "'.join(lib_names) ) # Getting the GEOS C library. The C interface (CDLL) is used for # both *NIX and Windows. # See the GEOS C API source code for more details on the library function calls: # https://libgeos.org/doxygen/geos__c_8h_source.html _lgeos = CDLL(lib_path) # Here we set up the prototypes for the initGEOS_r and finishGEOS_r # routines. These functions aren't actually called until they are # attached to a GEOS context handle -- this actually occurs in # geos/prototypes/threadsafe.py. _lgeos.initGEOS_r.restype = CONTEXT_PTR _lgeos.finishGEOS_r.argtypes = [CONTEXT_PTR] # Set restype for compatibility across 32 and 64-bit platforms. _lgeos.GEOSversion.restype = c_char_p return _lgeos # The notice and error handler C function callback definitions. # Supposed to mimic the GEOS message handler (C below): # typedef void (*GEOSMessageHandler)(const char *fmt, ...); NOTICEFUNC = CFUNCTYPE(None, c_char_p, c_char_p) def notice_h(fmt, lst): fmt, lst = fmt.decode(), lst.decode() try: warn_msg = fmt % lst except TypeError: warn_msg = fmt logger.warning("GEOS_NOTICE: %s\n", warn_msg) notice_h = NOTICEFUNC(notice_h) ERRORFUNC = CFUNCTYPE(None, c_char_p, c_char_p) def error_h(fmt, lst): fmt, lst = fmt.decode(), lst.decode() try: err_msg = fmt % lst except TypeError: err_msg = fmt logger.error("GEOS_ERROR: %s\n", err_msg) error_h = ERRORFUNC(error_h) # #### GEOS Geometry C data structures, and utility functions. #### # Opaque GEOS geometry structures, used for GEOM_PTR and CS_PTR class GEOSGeom_t(Structure): pass class GEOSPrepGeom_t(Structure): pass class GEOSCoordSeq_t(Structure): pass class GEOSContextHandle_t(Structure): pass # Pointers to opaque GEOS geometry structures. GEOM_PTR = POINTER(GEOSGeom_t) PREPGEOM_PTR = POINTER(GEOSPrepGeom_t) CS_PTR = POINTER(GEOSCoordSeq_t) CONTEXT_PTR = POINTER(GEOSContextHandle_t) lgeos = SimpleLazyObject(load_geos) class GEOSFuncFactory: """ Lazy loading of GEOS functions. """ argtypes = None restype = None errcheck = None def __init__(self, func_name, *, restype=None, errcheck=None, argtypes=None): self.func_name = func_name if restype is not None: self.restype = restype if errcheck is not None: self.errcheck = errcheck if argtypes is not None: self.argtypes = argtypes def __call__(self, *args): return self.func(*args) @cached_property def func(self): from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc func = GEOSFunc(self.func_name) func.argtypes = self.argtypes or [] func.restype = self.restype if self.errcheck: func.errcheck = self.errcheck return func def geos_version(): """Return the string version of the GEOS library.""" return lgeos.GEOSversion() def geos_version_tuple(): """Return the GEOS version as a tuple (major, minor, subminor).""" return get_version_tuple(geos_version().decode())
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/libgeos.py
Python
mit
4,987
from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.coordseq import GEOSCoordSeq from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin from django.contrib.gis.geos.point import Point from django.contrib.gis.shortcuts import numpy class LineString(LinearGeometryMixin, GEOSGeometry): _init_func = capi.create_linestring _minlength = 2 has_cs = True def __init__(self, *args, **kwargs): """ Initialize on the given sequence -- may take lists, tuples, NumPy arrays of X,Y pairs, or Point objects. If Point objects are used, ownership is _not_ transferred to the LineString object. Examples: ls = LineString((1, 1), (2, 2)) ls = LineString([(1, 1), (2, 2)]) ls = LineString(array([(1, 1), (2, 2)])) ls = LineString(Point(1, 1), Point(2, 2)) """ # If only one argument provided, set the coords array appropriately if len(args) == 1: coords = args[0] else: coords = args if not ( isinstance(coords, (tuple, list)) or numpy and isinstance(coords, numpy.ndarray) ): raise TypeError("Invalid initialization input for LineStrings.") # If SRID was passed in with the keyword arguments srid = kwargs.get("srid") ncoords = len(coords) if not ncoords: super().__init__(self._init_func(None), srid=srid) return if ncoords < self._minlength: raise ValueError( "%s requires at least %d points, got %s." % ( self.__class__.__name__, self._minlength, ncoords, ) ) numpy_coords = not isinstance(coords, (tuple, list)) if numpy_coords: shape = coords.shape # Using numpy's shape. if len(shape) != 2: raise TypeError("Too many dimensions.") self._checkdim(shape[1]) ndim = shape[1] else: # Getting the number of coords and the number of dimensions -- which # must stay the same, e.g., no LineString((1, 2), (1, 2, 3)). ndim = None # Incrementing through each of the coordinates and verifying for coord in coords: if not isinstance(coord, (tuple, list, Point)): raise TypeError( "Each coordinate should be a sequence (list or tuple)" ) if ndim is None: ndim = len(coord) self._checkdim(ndim) elif len(coord) != ndim: raise TypeError("Dimension mismatch.") # Creating a coordinate sequence object because it is easier to # set the points using its methods. cs = GEOSCoordSeq(capi.create_cs(ncoords, ndim), z=bool(ndim == 3)) point_setter = cs._set_point_3d if ndim == 3 else cs._set_point_2d for i in range(ncoords): if numpy_coords: point_coords = coords[i, :] elif isinstance(coords[i], Point): point_coords = coords[i].tuple else: point_coords = coords[i] point_setter(i, point_coords) # Calling the base geometry initialization with the returned pointer # from the function. super().__init__(self._init_func(cs.ptr), srid=srid) def __iter__(self): "Allow iteration over this LineString." for i in range(len(self)): yield self[i] def __len__(self): "Return the number of points in this LineString." return len(self._cs) def _get_single_external(self, index): return self._cs[index] _get_single_internal = _get_single_external def _set_list(self, length, items): ndim = self._cs.dims hasz = self._cs.hasz # I don't understand why these are different srid = self.srid # create a new coordinate sequence and populate accordingly cs = GEOSCoordSeq(capi.create_cs(length, ndim), z=hasz) for i, c in enumerate(items): cs[i] = c ptr = self._init_func(cs.ptr) if ptr: capi.destroy_geom(self.ptr) self.ptr = ptr if srid is not None: self.srid = srid self._post_init() else: # can this happen? raise GEOSException("Geometry resulting from slice deletion was invalid.") def _set_single(self, index, value): self._cs[index] = value def _checkdim(self, dim): if dim not in (2, 3): raise TypeError("Dimension mismatch.") # #### Sequence Properties #### @property def tuple(self): "Return a tuple version of the geometry from the coordinate sequence." return self._cs.tuple coords = tuple def _listarr(self, func): """ Return a sequence (list) corresponding with the given function. Return a numpy array if possible. """ lst = [func(i) for i in range(len(self))] if numpy: return numpy.array(lst) # ARRRR! else: return lst @property def array(self): "Return a numpy array for the LineString." return self._listarr(self._cs.__getitem__) @property def x(self): "Return a list or numpy array of the X variable." return self._listarr(self._cs.getX) @property def y(self): "Return a list or numpy array of the Y variable." return self._listarr(self._cs.getY) @property def z(self): "Return a list or numpy array of the Z variable." if not self.hasz: return None else: return self._listarr(self._cs.getZ) # LinearRings are LineStrings used within Polygons. class LinearRing(LineString): _minlength = 4 _init_func = capi.create_linearring @property def is_counterclockwise(self): if self.empty: raise ValueError("Orientation of an empty LinearRing cannot be determined.") return self._cs.is_counterclockwise
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/linestring.py
Python
mit
6,372
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. # Released under the New BSD license. """ This module contains a base type which provides list-style mutations without specific data storage methods. See also http://static.aryehleib.com/oldsite/MutableLists.html Author: Aryeh Leib Taurog. """ from functools import total_ordering @total_ordering class ListMixin: """ A base class which provides complete list interface. Derived classes must call ListMixin's __init__() function and implement the following: function _get_single_external(self, i): Return single item with index i for general use. The index i will always satisfy 0 <= i < len(self). function _get_single_internal(self, i): Same as above, but for use within the class [Optional] Note that if _get_single_internal and _get_single_internal return different types of objects, _set_list must distinguish between the two and handle each appropriately. function _set_list(self, length, items): Recreate the entire object. NOTE: items may be a generator which calls _get_single_internal. Therefore, it is necessary to cache the values in a temporary: temp = list(items) before clobbering the original storage. function _set_single(self, i, value): Set the single item at index i to value [Optional] If left undefined, all mutations will result in rebuilding the object using _set_list. function __len__(self): Return the length int _minlength: The minimum legal length [Optional] int _maxlength: The maximum legal length [Optional] type or tuple _allowed: A type or tuple of allowed item types [Optional] """ _minlength = 0 _maxlength = None # ### Python initialization and special list interface methods ### def __init__(self, *args, **kwargs): if not hasattr(self, "_get_single_internal"): self._get_single_internal = self._get_single_external if not hasattr(self, "_set_single"): self._set_single = self._set_single_rebuild self._assign_extended_slice = self._assign_extended_slice_rebuild super().__init__(*args, **kwargs) def __getitem__(self, index): "Get the item(s) at the specified index/slice." if isinstance(index, slice): return [ self._get_single_external(i) for i in range(*index.indices(len(self))) ] else: index = self._checkindex(index) return self._get_single_external(index) def __delitem__(self, index): "Delete the item(s) at the specified index/slice." if not isinstance(index, (int, slice)): raise TypeError("%s is not a legal index" % index) # calculate new length and dimensions origLen = len(self) if isinstance(index, int): index = self._checkindex(index) indexRange = [index] else: indexRange = range(*index.indices(origLen)) newLen = origLen - len(indexRange) newItems = ( self._get_single_internal(i) for i in range(origLen) if i not in indexRange ) self._rebuild(newLen, newItems) def __setitem__(self, index, val): "Set the item(s) at the specified index/slice." if isinstance(index, slice): self._set_slice(index, val) else: index = self._checkindex(index) self._check_allowed((val,)) self._set_single(index, val) # ### Special methods for arithmetic operations ### def __add__(self, other): "add another list-like object" return self.__class__([*self, *other]) def __radd__(self, other): "add to another list-like object" return other.__class__([*other, *self]) def __iadd__(self, other): "add another list-like object to self" self.extend(other) return self def __mul__(self, n): "multiply" return self.__class__(list(self) * n) def __rmul__(self, n): "multiply" return self.__class__(list(self) * n) def __imul__(self, n): "multiply" if n <= 0: del self[:] else: cache = list(self) for i in range(n - 1): self.extend(cache) return self def __eq__(self, other): olen = len(other) for i in range(olen): try: c = self[i] == other[i] except IndexError: # self must be shorter return False if not c: return False return len(self) == olen def __lt__(self, other): olen = len(other) for i in range(olen): try: c = self[i] < other[i] except IndexError: # self must be shorter return True if c: return c elif other[i] < self[i]: return False return len(self) < olen # ### Public list interface Methods ### # ## Non-mutating ## def count(self, val): "Standard list count method" count = 0 for i in self: if val == i: count += 1 return count def index(self, val): "Standard list index method" for i in range(0, len(self)): if self[i] == val: return i raise ValueError("%s not found in object" % val) # ## Mutating ## def append(self, val): "Standard list append method" self[len(self) :] = [val] def extend(self, vals): "Standard list extend method" self[len(self) :] = vals def insert(self, index, val): "Standard list insert method" if not isinstance(index, int): raise TypeError("%s is not a legal index" % index) self[index:index] = [val] def pop(self, index=-1): "Standard list pop method" result = self[index] del self[index] return result def remove(self, val): "Standard list remove method" del self[self.index(val)] def reverse(self): "Standard list reverse method" self[:] = self[-1::-1] def sort(self, key=None, reverse=False): "Standard list sort method" self[:] = sorted(self, key=key, reverse=reverse) # ### Private routines ### def _rebuild(self, newLen, newItems): if newLen and newLen < self._minlength: raise ValueError("Must have at least %d items" % self._minlength) if self._maxlength is not None and newLen > self._maxlength: raise ValueError("Cannot have more than %d items" % self._maxlength) self._set_list(newLen, newItems) def _set_single_rebuild(self, index, value): self._set_slice(slice(index, index + 1, 1), [value]) def _checkindex(self, index): length = len(self) if 0 <= index < length: return index if -length <= index < 0: return index + length raise IndexError("invalid index: %s" % index) def _check_allowed(self, items): if hasattr(self, "_allowed"): if False in [isinstance(val, self._allowed) for val in items]: raise TypeError("Invalid type encountered in the arguments.") def _set_slice(self, index, values): "Assign values to a slice of the object" try: valueList = list(values) except TypeError: raise TypeError("can only assign an iterable to a slice") self._check_allowed(valueList) origLen = len(self) start, stop, step = index.indices(origLen) # CAREFUL: index.step and step are not the same! # step will never be None if index.step is None: self._assign_simple_slice(start, stop, valueList) else: self._assign_extended_slice(start, stop, step, valueList) def _assign_extended_slice_rebuild(self, start, stop, step, valueList): "Assign an extended slice by rebuilding entire list" indexList = range(start, stop, step) # extended slice, only allow assigning slice of same size if len(valueList) != len(indexList): raise ValueError( "attempt to assign sequence of size %d " "to extended slice of size %d" % (len(valueList), len(indexList)) ) # we're not changing the length of the sequence newLen = len(self) newVals = dict(zip(indexList, valueList)) def newItems(): for i in range(newLen): if i in newVals: yield newVals[i] else: yield self._get_single_internal(i) self._rebuild(newLen, newItems()) def _assign_extended_slice(self, start, stop, step, valueList): "Assign an extended slice by re-assigning individual items" indexList = range(start, stop, step) # extended slice, only allow assigning slice of same size if len(valueList) != len(indexList): raise ValueError( "attempt to assign sequence of size %d " "to extended slice of size %d" % (len(valueList), len(indexList)) ) for i, val in zip(indexList, valueList): self._set_single(i, val) def _assign_simple_slice(self, start, stop, valueList): "Assign a simple slice; Can assign slice of any length" origLen = len(self) stop = max(start, stop) newLen = origLen - stop + start + len(valueList) def newItems(): for i in range(origLen + 1): if i == start: yield from valueList if i < origLen: if i < start or i >= stop: yield self._get_single_internal(i) self._rebuild(newLen, newItems())
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/mutable_list.py
Python
mit
10,121
from ctypes import c_uint from django.contrib.gis import gdal from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import GEOSGeometry class Point(GEOSGeometry): _minlength = 2 _maxlength = 3 has_cs = True def __init__(self, x=None, y=None, z=None, srid=None): """ The Point object may be initialized with either a tuple, or individual parameters. For example: >>> p = Point((5, 23)) # 2D point, passed in as a tuple >>> p = Point(5, 23, 8) # 3D point, passed in with individual parameters """ if x is None: coords = [] elif isinstance(x, (tuple, list)): # Here a tuple or list was passed in under the `x` parameter. coords = x elif isinstance(x, (float, int)) and isinstance(y, (float, int)): # Here X, Y, and (optionally) Z were passed in individually, as parameters. if isinstance(z, (float, int)): coords = [x, y, z] else: coords = [x, y] else: raise TypeError("Invalid parameters given for Point initialization.") point = self._create_point(len(coords), coords) # Initializing using the address returned from the GEOS # createPoint factory. super().__init__(point, srid=srid) def _to_pickle_wkb(self): return None if self.empty else super()._to_pickle_wkb() def _from_pickle_wkb(self, wkb): return self._create_empty() if wkb is None else super()._from_pickle_wkb(wkb) def _ogr_ptr(self): return ( gdal.geometries.Point._create_empty() if self.empty else super()._ogr_ptr() ) @classmethod def _create_empty(cls): return cls._create_point(None, None) @classmethod def _create_point(cls, ndim, coords): """ Create a coordinate sequence, set X, Y, [Z], and create point """ if not ndim: return capi.create_point(None) if ndim < 2 or ndim > 3: raise TypeError("Invalid point dimension: %s" % ndim) cs = capi.create_cs(c_uint(1), c_uint(ndim)) i = iter(coords) capi.cs_setx(cs, 0, next(i)) capi.cs_sety(cs, 0, next(i)) if ndim == 3: capi.cs_setz(cs, 0, next(i)) return capi.create_point(cs) def _set_list(self, length, items): ptr = self._create_point(length, items) if ptr: srid = self.srid capi.destroy_geom(self.ptr) self._ptr = ptr if srid is not None: self.srid = srid self._post_init() else: # can this happen? raise GEOSException("Geometry resulting from slice deletion was invalid.") def _set_single(self, index, value): self._cs.setOrdinate(index, 0, value) def __iter__(self): "Iterate over coordinates of this Point." for i in range(len(self)): yield self[i] def __len__(self): "Return the number of dimensions for this Point (either 0, 2 or 3)." if self.empty: return 0 if self.hasz: return 3 else: return 2 def _get_single_external(self, index): if index == 0: return self.x elif index == 1: return self.y elif index == 2: return self.z _get_single_internal = _get_single_external @property def x(self): "Return the X component of the Point." return self._cs.getOrdinate(0, 0) @x.setter def x(self, value): "Set the X component of the Point." self._cs.setOrdinate(0, 0, value) @property def y(self): "Return the Y component of the Point." return self._cs.getOrdinate(1, 0) @y.setter def y(self, value): "Set the Y component of the Point." self._cs.setOrdinate(1, 0, value) @property def z(self): "Return the Z component of the Point." return self._cs.getOrdinate(2, 0) if self.hasz else None @z.setter def z(self, value): "Set the Z component of the Point." if not self.hasz: raise GEOSException("Cannot set Z on 2D Point.") self._cs.setOrdinate(2, 0, value) # ### Tuple setting and retrieval routines. ### @property def tuple(self): "Return a tuple of the point." return self._cs.tuple @tuple.setter def tuple(self, tup): "Set the coordinates of the point with the given tuple." self._cs[0] = tup # The tuple and coords properties coords = tuple
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/point.py
Python
mit
4,781
from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.libgeos import GEOM_PTR from django.contrib.gis.geos.linestring import LinearRing class Polygon(GEOSGeometry): _minlength = 1 def __init__(self, *args, **kwargs): """ Initialize on an exterior ring and a sequence of holes (both instances may be either LinearRing instances, or a tuple/list that may be constructed into a LinearRing). Examples of initialization, where shell, hole1, and hole2 are valid LinearRing geometries: >>> from django.contrib.gis.geos import LinearRing, Polygon >>> shell = hole1 = hole2 = LinearRing() >>> poly = Polygon(shell, hole1, hole2) >>> poly = Polygon(shell, (hole1, hole2)) >>> # Example where a tuple parameters are used: >>> poly = Polygon(((0, 0), (0, 10), (10, 10), (10, 0), (0, 0)), ... ((4, 4), (4, 6), (6, 6), (6, 4), (4, 4))) """ if not args: super().__init__(self._create_polygon(0, None), **kwargs) return # Getting the ext_ring and init_holes parameters from the argument list ext_ring, *init_holes = args n_holes = len(init_holes) # If initialized as Polygon(shell, (LinearRing, LinearRing)) # [for backward-compatibility] if n_holes == 1 and isinstance(init_holes[0], (tuple, list)): if not init_holes[0]: init_holes = () n_holes = 0 elif isinstance(init_holes[0][0], LinearRing): init_holes = init_holes[0] n_holes = len(init_holes) polygon = self._create_polygon(n_holes + 1, [ext_ring, *init_holes]) super().__init__(polygon, **kwargs) def __iter__(self): "Iterate over each ring in the polygon." for i in range(len(self)): yield self[i] def __len__(self): "Return the number of rings in this Polygon." return self.num_interior_rings + 1 @classmethod def from_bbox(cls, bbox): "Construct a Polygon from a bounding box (4-tuple)." x0, y0, x1, y1 = bbox for z in bbox: if not isinstance(z, (float, int)): return GEOSGeometry( "POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s))" % (x0, y0, x0, y1, x1, y1, x1, y0, x0, y0) ) return Polygon(((x0, y0), (x0, y1), (x1, y1), (x1, y0), (x0, y0))) # ### These routines are needed for list-like operation w/ListMixin ### def _create_polygon(self, length, items): # Instantiate LinearRing objects if necessary, but don't clone them yet # _construct_ring will throw a TypeError if a parameter isn't a valid ring # If we cloned the pointers here, we wouldn't be able to clean up # in case of error. if not length: return capi.create_empty_polygon() rings = [] for r in items: if isinstance(r, GEOM_PTR): rings.append(r) else: rings.append(self._construct_ring(r)) shell = self._clone(rings.pop(0)) n_holes = length - 1 if n_holes: holes_param = (GEOM_PTR * n_holes)(*[self._clone(r) for r in rings]) else: holes_param = None return capi.create_polygon(shell, holes_param, n_holes) def _clone(self, g): if isinstance(g, GEOM_PTR): return capi.geom_clone(g) else: return capi.geom_clone(g.ptr) def _construct_ring( self, param, msg=( "Parameter must be a sequence of LinearRings or objects that can " "initialize to LinearRings" ), ): "Try to construct a ring from the given parameter." if isinstance(param, LinearRing): return param try: return LinearRing(param) except TypeError: raise TypeError(msg) def _set_list(self, length, items): # Getting the current pointer, replacing with the newly constructed # geometry, and destroying the old geometry. prev_ptr = self.ptr srid = self.srid self.ptr = self._create_polygon(length, items) if srid: self.srid = srid capi.destroy_geom(prev_ptr) def _get_single_internal(self, index): """ Return the ring at the specified index. The first index, 0, will always return the exterior ring. Indices > 0 will return the interior ring at the given index (e.g., poly[1] and poly[2] would return the first and second interior ring, respectively). CAREFUL: Internal/External are not the same as Interior/Exterior! Return a pointer from the existing geometries for use internally by the object's methods. _get_single_external() returns a clone of the same geometry for use by external code. """ if index == 0: return capi.get_extring(self.ptr) else: # Getting the interior ring, have to subtract 1 from the index. return capi.get_intring(self.ptr, index - 1) def _get_single_external(self, index): return GEOSGeometry( capi.geom_clone(self._get_single_internal(index)), srid=self.srid ) _set_single = GEOSGeometry._set_single_rebuild _assign_extended_slice = GEOSGeometry._assign_extended_slice_rebuild # #### Polygon Properties #### @property def num_interior_rings(self): "Return the number of interior rings." # Getting the number of rings return capi.get_nrings(self.ptr) def _get_ext_ring(self): "Get the exterior ring of the Polygon." return self[0] def _set_ext_ring(self, ring): "Set the exterior ring of the Polygon." self[0] = ring # Properties for the exterior ring/shell. exterior_ring = property(_get_ext_ring, _set_ext_ring) shell = exterior_ring @property def tuple(self): "Get the tuple for each ring in this Polygon." return tuple(self[i].tuple for i in range(len(self))) coords = tuple @property def kml(self): "Return the KML representation of this Polygon." inner_kml = "".join( "<innerBoundaryIs>%s</innerBoundaryIs>" % self[i + 1].kml for i in range(self.num_interior_rings) ) return "<Polygon><outerBoundaryIs>%s</outerBoundaryIs>%s</Polygon>" % ( self[0].kml, inner_kml, )
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/polygon.py
Python
mit
6,710
from .base import GEOSBase from .prototypes import prepared as capi class PreparedGeometry(GEOSBase): """ A geometry that is prepared for performing certain operations. At the moment this includes the contains covers, and intersects operations. """ ptr_type = capi.PREPGEOM_PTR destructor = capi.prepared_destroy def __init__(self, geom): # Keeping a reference to the original geometry object to prevent it # from being garbage collected which could then crash the prepared one # See #21662 self._base_geom = geom from .geometry import GEOSGeometry if not isinstance(geom, GEOSGeometry): raise TypeError self.ptr = capi.geos_prepare(geom.ptr) def contains(self, other): return capi.prepared_contains(self.ptr, other.ptr) def contains_properly(self, other): return capi.prepared_contains_properly(self.ptr, other.ptr) def covers(self, other): return capi.prepared_covers(self.ptr, other.ptr) def intersects(self, other): return capi.prepared_intersects(self.ptr, other.ptr) def crosses(self, other): return capi.prepared_crosses(self.ptr, other.ptr) def disjoint(self, other): return capi.prepared_disjoint(self.ptr, other.ptr) def overlaps(self, other): return capi.prepared_overlaps(self.ptr, other.ptr) def touches(self, other): return capi.prepared_touches(self.ptr, other.ptr) def within(self, other): return capi.prepared_within(self.ptr, other.ptr)
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/prepared.py
Python
mit
1,577
""" This module contains all of the GEOS ctypes function prototypes. Each prototype handles the interaction between the GEOS library and Python via ctypes. """ from django.contrib.gis.geos.prototypes.coordseq import ( # NOQA create_cs, cs_clone, cs_getdims, cs_getordinate, cs_getsize, cs_getx, cs_gety, cs_getz, cs_is_ccw, cs_setordinate, cs_setx, cs_sety, cs_setz, get_cs, ) from django.contrib.gis.geos.prototypes.geom import ( # NOQA create_collection, create_empty_polygon, create_linearring, create_linestring, create_point, create_polygon, destroy_geom, geom_clone, geos_get_srid, geos_makevalid, geos_normalize, geos_set_srid, geos_type, geos_typeid, get_dims, get_extring, get_geomn, get_intring, get_nrings, get_num_coords, get_num_geoms, ) from django.contrib.gis.geos.prototypes.misc import * # NOQA from django.contrib.gis.geos.prototypes.predicates import ( # NOQA geos_contains, geos_covers, geos_crosses, geos_disjoint, geos_equals, geos_equalsexact, geos_hasz, geos_intersects, geos_isclosed, geos_isempty, geos_isring, geos_issimple, geos_isvalid, geos_overlaps, geos_relatepattern, geos_touches, geos_within, ) from django.contrib.gis.geos.prototypes.topology import * # NOQA
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/prototypes/__init__.py
Python
mit
1,412
from ctypes import POINTER, c_byte, c_double, c_int, c_uint from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import GEOSException, last_arg_byref # ## Error-checking routines specific to coordinate sequences. ## def check_cs_op(result, func, cargs): "Check the status code of a coordinate sequence operation." if result == 0: raise GEOSException("Could not set value on coordinate sequence") else: return result def check_cs_get(result, func, cargs): "Check the coordinate sequence retrieval." check_cs_op(result, func, cargs) # Object in by reference, return its value. return last_arg_byref(cargs) # ## Coordinate sequence prototype factory classes. ## class CsInt(GEOSFuncFactory): "For coordinate sequence routines that return an integer." argtypes = [CS_PTR, POINTER(c_uint)] restype = c_int errcheck = staticmethod(check_cs_get) class CsOperation(GEOSFuncFactory): "For coordinate sequence operations." restype = c_int def __init__(self, *args, ordinate=False, get=False, **kwargs): if get: # Get routines have double parameter passed-in by reference. errcheck = check_cs_get dbl_param = POINTER(c_double) else: errcheck = check_cs_op dbl_param = c_double if ordinate: # Get/Set ordinate routines have an extra uint parameter. argtypes = [CS_PTR, c_uint, c_uint, dbl_param] else: argtypes = [CS_PTR, c_uint, dbl_param] super().__init__( *args, **{**kwargs, "errcheck": errcheck, "argtypes": argtypes} ) class CsOutput(GEOSFuncFactory): restype = CS_PTR @staticmethod def errcheck(result, func, cargs): if not result: raise GEOSException( "Error encountered checking Coordinate Sequence returned from GEOS " 'C function "%s".' % func.__name__ ) return result # ## Coordinate Sequence ctypes prototypes ## # Coordinate Sequence constructors & cloning. cs_clone = CsOutput("GEOSCoordSeq_clone", argtypes=[CS_PTR]) create_cs = CsOutput("GEOSCoordSeq_create", argtypes=[c_uint, c_uint]) get_cs = CsOutput("GEOSGeom_getCoordSeq", argtypes=[GEOM_PTR]) # Getting, setting ordinate cs_getordinate = CsOperation("GEOSCoordSeq_getOrdinate", ordinate=True, get=True) cs_setordinate = CsOperation("GEOSCoordSeq_setOrdinate", ordinate=True) # For getting, x, y, z cs_getx = CsOperation("GEOSCoordSeq_getX", get=True) cs_gety = CsOperation("GEOSCoordSeq_getY", get=True) cs_getz = CsOperation("GEOSCoordSeq_getZ", get=True) # For setting, x, y, z cs_setx = CsOperation("GEOSCoordSeq_setX") cs_sety = CsOperation("GEOSCoordSeq_setY") cs_setz = CsOperation("GEOSCoordSeq_setZ") # These routines return size & dimensions. cs_getsize = CsInt("GEOSCoordSeq_getSize") cs_getdims = CsInt("GEOSCoordSeq_getDimensions") cs_is_ccw = GEOSFuncFactory( "GEOSCoordSeq_isCCW", restype=c_int, argtypes=[CS_PTR, POINTER(c_byte)] )
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/prototypes/coordseq.py
Python
mit
3,122
""" Error checking functions for GEOS ctypes prototype functions. """ from ctypes import c_void_p, string_at from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.libgeos import GEOSFuncFactory # Getting the `free` routine used to free the memory allocated for # string pointers returned by GEOS. free = GEOSFuncFactory("GEOSFree") free.argtypes = [c_void_p] def last_arg_byref(args): "Return the last C argument's value by reference." return args[-1]._obj.value def check_dbl(result, func, cargs): "Check the status code and returns the double value passed in by reference." # Checking the status code if result != 1: return None # Double passed in by reference, return its value. return last_arg_byref(cargs) def check_geom(result, func, cargs): "Error checking on routines that return Geometries." if not result: raise GEOSException( 'Error encountered checking Geometry returned from GEOS C function "%s".' % func.__name__ ) return result def check_minus_one(result, func, cargs): "Error checking on routines that should not return -1." if result == -1: raise GEOSException( 'Error encountered in GEOS C function "%s".' % func.__name__ ) else: return result def check_predicate(result, func, cargs): "Error checking for unary/binary predicate functions." if result == 1: return True elif result == 0: return False else: raise GEOSException( 'Error encountered on GEOS C predicate function "%s".' % func.__name__ ) def check_sized_string(result, func, cargs): """ Error checking for routines that return explicitly sized strings. This frees the memory allocated by GEOS at the result pointer. """ if not result: raise GEOSException( 'Invalid string pointer returned by GEOS C function "%s"' % func.__name__ ) # A c_size_t object is passed in by reference for the second # argument on these routines, and its needed to determine the # correct size. s = string_at(result, last_arg_byref(cargs)) # Freeing the memory allocated within GEOS free(result) return s def check_string(result, func, cargs): """ Error checking for routines that return strings. This frees the memory allocated by GEOS at the result pointer. """ if not result: raise GEOSException( 'Error encountered checking string return value in GEOS C function "%s".' % func.__name__ ) # Getting the string value at the pointer address. s = string_at(result) # Freeing the memory allocated within GEOS free(result) return s
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/prototypes/errcheck.py
Python
mit
2,788
from ctypes import POINTER, c_char_p, c_int, c_ubyte, c_uint from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import ( check_geom, check_minus_one, check_string, ) # This is the return type used by binary output (WKB, HEX) routines. c_uchar_p = POINTER(c_ubyte) # We create a simple subclass of c_char_p here because when the response # type is set to c_char_p, you get a _Python_ string and there's no way # to access the string's address inside the error checking function. # In other words, you can't free the memory allocated inside GEOS. Previously, # the return type would just be omitted and the integer address would be # used -- but this allows us to be specific in the function definition and # keeps the reference so it may be free'd. class geos_char_p(c_char_p): pass # ### ctypes factory classes ### class GeomOutput(GEOSFuncFactory): "For GEOS routines that return a geometry." restype = GEOM_PTR errcheck = staticmethod(check_geom) class IntFromGeom(GEOSFuncFactory): "Argument is a geometry, return type is an integer." argtypes = [GEOM_PTR] restype = c_int errcheck = staticmethod(check_minus_one) class StringFromGeom(GEOSFuncFactory): "Argument is a Geometry, return type is a string." argtypes = [GEOM_PTR] restype = geos_char_p errcheck = staticmethod(check_string) # ### ctypes prototypes ### # The GEOS geometry type, typeid, num_coordinates and number of geometries geos_makevalid = GeomOutput("GEOSMakeValid", argtypes=[GEOM_PTR]) geos_normalize = IntFromGeom("GEOSNormalize") geos_type = StringFromGeom("GEOSGeomType") geos_typeid = IntFromGeom("GEOSGeomTypeId") get_dims = GEOSFuncFactory("GEOSGeom_getDimensions", argtypes=[GEOM_PTR], restype=c_int) get_num_coords = IntFromGeom("GEOSGetNumCoordinates") get_num_geoms = IntFromGeom("GEOSGetNumGeometries") # Geometry creation factories create_point = GeomOutput("GEOSGeom_createPoint", argtypes=[CS_PTR]) create_linestring = GeomOutput("GEOSGeom_createLineString", argtypes=[CS_PTR]) create_linearring = GeomOutput("GEOSGeom_createLinearRing", argtypes=[CS_PTR]) # Polygon and collection creation routines need argument types defined # for compatibility with some platforms, e.g. macOS ARM64. With argtypes # defined, arrays are automatically cast and byref() calls are not needed. create_polygon = GeomOutput( "GEOSGeom_createPolygon", argtypes=[GEOM_PTR, POINTER(GEOM_PTR), c_uint], ) create_empty_polygon = GeomOutput("GEOSGeom_createEmptyPolygon", argtypes=[]) create_collection = GeomOutput( "GEOSGeom_createCollection", argtypes=[c_int, POINTER(GEOM_PTR), c_uint], ) # Ring routines get_extring = GeomOutput("GEOSGetExteriorRing", argtypes=[GEOM_PTR]) get_intring = GeomOutput("GEOSGetInteriorRingN", argtypes=[GEOM_PTR, c_int]) get_nrings = IntFromGeom("GEOSGetNumInteriorRings") # Collection Routines get_geomn = GeomOutput("GEOSGetGeometryN", argtypes=[GEOM_PTR, c_int]) # Cloning geom_clone = GEOSFuncFactory("GEOSGeom_clone", argtypes=[GEOM_PTR], restype=GEOM_PTR) # Destruction routine. destroy_geom = GEOSFuncFactory("GEOSGeom_destroy", argtypes=[GEOM_PTR]) # SRID routines geos_get_srid = GEOSFuncFactory("GEOSGetSRID", argtypes=[GEOM_PTR], restype=c_int) geos_set_srid = GEOSFuncFactory("GEOSSetSRID", argtypes=[GEOM_PTR, c_int])
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/prototypes/geom.py
Python
mit
3,398
import threading from ctypes import POINTER, Structure, byref, c_byte, c_char_p, c_int, c_size_t from django.contrib.gis.geos.base import GEOSBase from django.contrib.gis.geos.libgeos import ( GEOM_PTR, GEOSFuncFactory, geos_version_tuple, ) from django.contrib.gis.geos.prototypes.errcheck import ( check_geom, check_sized_string, check_string, ) from django.contrib.gis.geos.prototypes.geom import c_uchar_p, geos_char_p from django.utils.encoding import force_bytes # ### The WKB/WKT Reader/Writer structures and pointers ### class WKTReader_st(Structure): pass class WKTWriter_st(Structure): pass class WKBReader_st(Structure): pass class WKBWriter_st(Structure): pass WKT_READ_PTR = POINTER(WKTReader_st) WKT_WRITE_PTR = POINTER(WKTWriter_st) WKB_READ_PTR = POINTER(WKBReader_st) WKB_WRITE_PTR = POINTER(WKBReader_st) # WKTReader routines wkt_reader_create = GEOSFuncFactory("GEOSWKTReader_create", restype=WKT_READ_PTR) wkt_reader_destroy = GEOSFuncFactory("GEOSWKTReader_destroy", argtypes=[WKT_READ_PTR]) wkt_reader_read = GEOSFuncFactory( "GEOSWKTReader_read", argtypes=[WKT_READ_PTR, c_char_p], restype=GEOM_PTR, errcheck=check_geom, ) # WKTWriter routines wkt_writer_create = GEOSFuncFactory("GEOSWKTWriter_create", restype=WKT_WRITE_PTR) wkt_writer_destroy = GEOSFuncFactory("GEOSWKTWriter_destroy", argtypes=[WKT_WRITE_PTR]) wkt_writer_write = GEOSFuncFactory( "GEOSWKTWriter_write", argtypes=[WKT_WRITE_PTR, GEOM_PTR], restype=geos_char_p, errcheck=check_string, ) wkt_writer_get_outdim = GEOSFuncFactory( "GEOSWKTWriter_getOutputDimension", argtypes=[WKT_WRITE_PTR], restype=c_int ) wkt_writer_set_outdim = GEOSFuncFactory( "GEOSWKTWriter_setOutputDimension", argtypes=[WKT_WRITE_PTR, c_int] ) wkt_writer_set_trim = GEOSFuncFactory( "GEOSWKTWriter_setTrim", argtypes=[WKT_WRITE_PTR, c_byte] ) wkt_writer_set_precision = GEOSFuncFactory( "GEOSWKTWriter_setRoundingPrecision", argtypes=[WKT_WRITE_PTR, c_int] ) # WKBReader routines wkb_reader_create = GEOSFuncFactory("GEOSWKBReader_create", restype=WKB_READ_PTR) wkb_reader_destroy = GEOSFuncFactory("GEOSWKBReader_destroy", argtypes=[WKB_READ_PTR]) class WKBReadFunc(GEOSFuncFactory): # Although the function definitions take `const unsigned char *` # as their parameter, we use c_char_p here so the function may # take Python strings directly as parameters. Inside Python there # is not a difference between signed and unsigned characters, so # it is not a problem. argtypes = [WKB_READ_PTR, c_char_p, c_size_t] restype = GEOM_PTR errcheck = staticmethod(check_geom) wkb_reader_read = WKBReadFunc("GEOSWKBReader_read") wkb_reader_read_hex = WKBReadFunc("GEOSWKBReader_readHEX") # WKBWriter routines wkb_writer_create = GEOSFuncFactory("GEOSWKBWriter_create", restype=WKB_WRITE_PTR) wkb_writer_destroy = GEOSFuncFactory("GEOSWKBWriter_destroy", argtypes=[WKB_WRITE_PTR]) # WKB Writing prototypes. class WKBWriteFunc(GEOSFuncFactory): argtypes = [WKB_WRITE_PTR, GEOM_PTR, POINTER(c_size_t)] restype = c_uchar_p errcheck = staticmethod(check_sized_string) wkb_writer_write = WKBWriteFunc("GEOSWKBWriter_write") wkb_writer_write_hex = WKBWriteFunc("GEOSWKBWriter_writeHEX") # WKBWriter property getter/setter prototypes. class WKBWriterGet(GEOSFuncFactory): argtypes = [WKB_WRITE_PTR] restype = c_int class WKBWriterSet(GEOSFuncFactory): argtypes = [WKB_WRITE_PTR, c_int] wkb_writer_get_byteorder = WKBWriterGet("GEOSWKBWriter_getByteOrder") wkb_writer_set_byteorder = WKBWriterSet("GEOSWKBWriter_setByteOrder") wkb_writer_get_outdim = WKBWriterGet("GEOSWKBWriter_getOutputDimension") wkb_writer_set_outdim = WKBWriterSet("GEOSWKBWriter_setOutputDimension") wkb_writer_get_include_srid = WKBWriterGet( "GEOSWKBWriter_getIncludeSRID", restype=c_byte ) wkb_writer_set_include_srid = WKBWriterSet( "GEOSWKBWriter_setIncludeSRID", argtypes=[WKB_WRITE_PTR, c_byte] ) # ### Base I/O Class ### class IOBase(GEOSBase): "Base class for GEOS I/O objects." def __init__(self): # Getting the pointer with the constructor. self.ptr = self._constructor() # Loading the real destructor function at this point as doing it in # __del__ is too late (import error). self.destructor.func # ### Base WKB/WKT Reading and Writing objects ### # Non-public WKB/WKT reader classes for internal use because # their `read` methods return _pointers_ instead of GEOSGeometry # objects. class _WKTReader(IOBase): _constructor = wkt_reader_create ptr_type = WKT_READ_PTR destructor = wkt_reader_destroy def read(self, wkt): if not isinstance(wkt, (bytes, str)): raise TypeError return wkt_reader_read(self.ptr, force_bytes(wkt)) class _WKBReader(IOBase): _constructor = wkb_reader_create ptr_type = WKB_READ_PTR destructor = wkb_reader_destroy def read(self, wkb): "Return a _pointer_ to C GEOS Geometry object from the given WKB." if isinstance(wkb, memoryview): wkb_s = bytes(wkb) return wkb_reader_read(self.ptr, wkb_s, len(wkb_s)) elif isinstance(wkb, bytes): return wkb_reader_read_hex(self.ptr, wkb, len(wkb)) elif isinstance(wkb, str): wkb_s = wkb.encode() return wkb_reader_read_hex(self.ptr, wkb_s, len(wkb_s)) else: raise TypeError # ### WKB/WKT Writer Classes ### class WKTWriter(IOBase): _constructor = wkt_writer_create ptr_type = WKT_WRITE_PTR destructor = wkt_writer_destroy _trim = False _precision = None def __init__(self, dim=2, trim=False, precision=None): super().__init__() if bool(trim) != self._trim: self.trim = trim if precision is not None: self.precision = precision self.outdim = dim def write(self, geom): "Return the WKT representation of the given geometry." return wkt_writer_write(self.ptr, geom.ptr) @property def outdim(self): return wkt_writer_get_outdim(self.ptr) @outdim.setter def outdim(self, new_dim): if new_dim not in (2, 3): raise ValueError("WKT output dimension must be 2 or 3") wkt_writer_set_outdim(self.ptr, new_dim) @property def trim(self): return self._trim @trim.setter def trim(self, flag): if bool(flag) != self._trim: self._trim = bool(flag) wkt_writer_set_trim(self.ptr, self._trim) @property def precision(self): return self._precision @precision.setter def precision(self, precision): if (not isinstance(precision, int) or precision < 0) and precision is not None: raise AttributeError( "WKT output rounding precision must be non-negative integer or None." ) if precision != self._precision: self._precision = precision wkt_writer_set_precision(self.ptr, -1 if precision is None else precision) class WKBWriter(IOBase): _constructor = wkb_writer_create ptr_type = WKB_WRITE_PTR destructor = wkb_writer_destroy geos_version = geos_version_tuple() def __init__(self, dim=2): super().__init__() self.outdim = dim def _handle_empty_point(self, geom): from django.contrib.gis.geos import Point if isinstance(geom, Point) and geom.empty: if self.srid: # PostGIS uses POINT(NaN NaN) for WKB representation of empty # points. Use it for EWKB as it's a PostGIS specific format. # https://trac.osgeo.org/postgis/ticket/3181 geom = Point(float("NaN"), float("NaN"), srid=geom.srid) else: raise ValueError("Empty point is not representable in WKB.") return geom def write(self, geom): "Return the WKB representation of the given geometry." from django.contrib.gis.geos import Polygon geom = self._handle_empty_point(geom) wkb = wkb_writer_write(self.ptr, geom.ptr, byref(c_size_t())) if self.geos_version < (3, 6, 1) and isinstance(geom, Polygon) and geom.empty: # Fix GEOS output for empty polygon. # See https://trac.osgeo.org/geos/ticket/680. wkb = wkb[:-8] + b"\0" * 4 return memoryview(wkb) def write_hex(self, geom): "Return the HEXEWKB representation of the given geometry." from django.contrib.gis.geos.polygon import Polygon geom = self._handle_empty_point(geom) wkb = wkb_writer_write_hex(self.ptr, geom.ptr, byref(c_size_t())) if self.geos_version < (3, 6, 1) and isinstance(geom, Polygon) and geom.empty: wkb = wkb[:-16] + b"0" * 8 return wkb # ### WKBWriter Properties ### # Property for getting/setting the byteorder. def _get_byteorder(self): return wkb_writer_get_byteorder(self.ptr) def _set_byteorder(self, order): if order not in (0, 1): raise ValueError( "Byte order parameter must be 0 (Big Endian) or 1 (Little Endian)." ) wkb_writer_set_byteorder(self.ptr, order) byteorder = property(_get_byteorder, _set_byteorder) # Property for getting/setting the output dimension. @property def outdim(self): return wkb_writer_get_outdim(self.ptr) @outdim.setter def outdim(self, new_dim): if new_dim not in (2, 3): raise ValueError("WKB output dimension must be 2 or 3") wkb_writer_set_outdim(self.ptr, new_dim) # Property for getting/setting the include srid flag. @property def srid(self): return bool(wkb_writer_get_include_srid(self.ptr)) @srid.setter def srid(self, include): wkb_writer_set_include_srid(self.ptr, bool(include)) # `ThreadLocalIO` object holds instances of the WKT and WKB reader/writer # objects that are local to the thread. The `GEOSGeometry` internals # access these instances by calling the module-level functions, defined # below. class ThreadLocalIO(threading.local): wkt_r = None wkt_w = None wkb_r = None wkb_w = None ewkb_w = None thread_context = ThreadLocalIO() # These module-level routines return the I/O object that is local to the # thread. If the I/O object does not exist yet it will be initialized. def wkt_r(): thread_context.wkt_r = thread_context.wkt_r or _WKTReader() return thread_context.wkt_r def wkt_w(dim=2, trim=False, precision=None): if not thread_context.wkt_w: thread_context.wkt_w = WKTWriter(dim=dim, trim=trim, precision=precision) else: thread_context.wkt_w.outdim = dim thread_context.wkt_w.trim = trim thread_context.wkt_w.precision = precision return thread_context.wkt_w def wkb_r(): thread_context.wkb_r = thread_context.wkb_r or _WKBReader() return thread_context.wkb_r def wkb_w(dim=2): if not thread_context.wkb_w: thread_context.wkb_w = WKBWriter(dim=dim) else: thread_context.wkb_w.outdim = dim return thread_context.wkb_w def ewkb_w(dim=2): if not thread_context.ewkb_w: thread_context.ewkb_w = WKBWriter(dim=dim) thread_context.ewkb_w.srid = True else: thread_context.ewkb_w.outdim = dim return thread_context.ewkb_w
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/prototypes/io.py
Python
mit
11,489
""" This module is for the miscellaneous GEOS routines, particularly the ones that return the area, distance, and length. """ from ctypes import POINTER, c_double, c_int from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import check_dbl, check_string from django.contrib.gis.geos.prototypes.geom import geos_char_p __all__ = ["geos_area", "geos_distance", "geos_length", "geos_isvalidreason"] class DblFromGeom(GEOSFuncFactory): """ Argument is a Geometry, return type is double that is passed in by reference as the last argument. """ restype = c_int # Status code returned errcheck = staticmethod(check_dbl) # ### ctypes prototypes ### # Area, distance, and length prototypes. geos_area = DblFromGeom("GEOSArea", argtypes=[GEOM_PTR, POINTER(c_double)]) geos_distance = DblFromGeom( "GEOSDistance", argtypes=[GEOM_PTR, GEOM_PTR, POINTER(c_double)] ) geos_length = DblFromGeom("GEOSLength", argtypes=[GEOM_PTR, POINTER(c_double)]) geos_isvalidreason = GEOSFuncFactory( "GEOSisValidReason", restype=geos_char_p, errcheck=check_string, argtypes=[GEOM_PTR] )
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/prototypes/misc.py
Python
mit
1,168
""" This module houses the GEOS ctypes prototype functions for the unary and binary predicate operations on geometries. """ from ctypes import c_byte, c_char_p, c_double from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import check_predicate # ## Binary & unary predicate factories ## class UnaryPredicate(GEOSFuncFactory): "For GEOS unary predicate functions." argtypes = [GEOM_PTR] restype = c_byte errcheck = staticmethod(check_predicate) class BinaryPredicate(UnaryPredicate): "For GEOS binary predicate functions." argtypes = [GEOM_PTR, GEOM_PTR] # ## Unary Predicates ## geos_hasz = UnaryPredicate("GEOSHasZ") geos_isclosed = UnaryPredicate("GEOSisClosed") geos_isempty = UnaryPredicate("GEOSisEmpty") geos_isring = UnaryPredicate("GEOSisRing") geos_issimple = UnaryPredicate("GEOSisSimple") geos_isvalid = UnaryPredicate("GEOSisValid") # ## Binary Predicates ## geos_contains = BinaryPredicate("GEOSContains") geos_covers = BinaryPredicate("GEOSCovers") geos_crosses = BinaryPredicate("GEOSCrosses") geos_disjoint = BinaryPredicate("GEOSDisjoint") geos_equals = BinaryPredicate("GEOSEquals") geos_equalsexact = BinaryPredicate( "GEOSEqualsExact", argtypes=[GEOM_PTR, GEOM_PTR, c_double] ) geos_intersects = BinaryPredicate("GEOSIntersects") geos_overlaps = BinaryPredicate("GEOSOverlaps") geos_relatepattern = BinaryPredicate( "GEOSRelatePattern", argtypes=[GEOM_PTR, GEOM_PTR, c_char_p] ) geos_touches = BinaryPredicate("GEOSTouches") geos_within = BinaryPredicate("GEOSWithin")
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/prototypes/predicates.py
Python
mit
1,599
from ctypes import c_byte from django.contrib.gis.geos.libgeos import GEOM_PTR, PREPGEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import check_predicate # Prepared geometry constructor and destructors. geos_prepare = GEOSFuncFactory("GEOSPrepare", argtypes=[GEOM_PTR], restype=PREPGEOM_PTR) prepared_destroy = GEOSFuncFactory("GEOSPreparedGeom_destroy", argtypes=[PREPGEOM_PTR]) # Prepared geometry binary predicate support. class PreparedPredicate(GEOSFuncFactory): argtypes = [PREPGEOM_PTR, GEOM_PTR] restype = c_byte errcheck = staticmethod(check_predicate) prepared_contains = PreparedPredicate("GEOSPreparedContains") prepared_contains_properly = PreparedPredicate("GEOSPreparedContainsProperly") prepared_covers = PreparedPredicate("GEOSPreparedCovers") prepared_crosses = PreparedPredicate("GEOSPreparedCrosses") prepared_disjoint = PreparedPredicate("GEOSPreparedDisjoint") prepared_intersects = PreparedPredicate("GEOSPreparedIntersects") prepared_overlaps = PreparedPredicate("GEOSPreparedOverlaps") prepared_touches = PreparedPredicate("GEOSPreparedTouches") prepared_within = PreparedPredicate("GEOSPreparedWithin")
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/prototypes/prepared.py
Python
mit
1,175
import threading from django.contrib.gis.geos.base import GEOSBase from django.contrib.gis.geos.libgeos import CONTEXT_PTR, error_h, lgeos, notice_h class GEOSContextHandle(GEOSBase): """Represent a GEOS context handle.""" ptr_type = CONTEXT_PTR destructor = lgeos.finishGEOS_r def __init__(self): # Initializing the context handler for this thread with # the notice and error handler. self.ptr = lgeos.initGEOS_r(notice_h, error_h) # Defining a thread-local object and creating an instance # to hold a reference to GEOSContextHandle for this thread. class GEOSContext(threading.local): handle = None thread_context = GEOSContext() class GEOSFunc: """ Serve as a wrapper for GEOS C Functions. Use thread-safe function variants when available. """ def __init__(self, func_name): # GEOS thread-safe function signatures end with '_r' and take an # additional context handle parameter. self.cfunc = getattr(lgeos, func_name + "_r") # Create a reference to thread_context so it's not garbage-collected # before an attempt to call this object. self.thread_context = thread_context def __call__(self, *args): # Create a context handle if one doesn't exist for this thread. self.thread_context.handle = self.thread_context.handle or GEOSContextHandle() # Call the threaded GEOS routine with the pointer of the context handle # as the first argument. return self.cfunc(self.thread_context.handle.ptr, *args) def __str__(self): return self.cfunc.__name__ # argtypes property def _get_argtypes(self): return self.cfunc.argtypes def _set_argtypes(self, argtypes): self.cfunc.argtypes = [CONTEXT_PTR, *argtypes] argtypes = property(_get_argtypes, _set_argtypes) # restype property def _get_restype(self): return self.cfunc.restype def _set_restype(self, restype): self.cfunc.restype = restype restype = property(_get_restype, _set_restype) # errcheck property def _get_errcheck(self): return self.cfunc.errcheck def _set_errcheck(self, errcheck): self.cfunc.errcheck = errcheck errcheck = property(_get_errcheck, _set_errcheck)
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/prototypes/threadsafe.py
Python
mit
2,302
""" This module houses the GEOS ctypes prototype functions for the topological operations on geometries. """ from ctypes import c_double, c_int from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import ( check_geom, check_minus_one, check_string, ) from django.contrib.gis.geos.prototypes.geom import geos_char_p class Topology(GEOSFuncFactory): "For GEOS unary topology functions." argtypes = [GEOM_PTR] restype = GEOM_PTR errcheck = staticmethod(check_geom) # Topology Routines geos_boundary = Topology("GEOSBoundary") geos_buffer = Topology("GEOSBuffer", argtypes=[GEOM_PTR, c_double, c_int]) geos_bufferwithstyle = Topology( "GEOSBufferWithStyle", argtypes=[GEOM_PTR, c_double, c_int, c_int, c_int, c_double] ) geos_centroid = Topology("GEOSGetCentroid") geos_convexhull = Topology("GEOSConvexHull") geos_difference = Topology("GEOSDifference", argtypes=[GEOM_PTR, GEOM_PTR]) geos_envelope = Topology("GEOSEnvelope") geos_intersection = Topology("GEOSIntersection", argtypes=[GEOM_PTR, GEOM_PTR]) geos_linemerge = Topology("GEOSLineMerge") geos_pointonsurface = Topology("GEOSPointOnSurface") geos_preservesimplify = Topology( "GEOSTopologyPreserveSimplify", argtypes=[GEOM_PTR, c_double] ) geos_simplify = Topology("GEOSSimplify", argtypes=[GEOM_PTR, c_double]) geos_symdifference = Topology("GEOSSymDifference", argtypes=[GEOM_PTR, GEOM_PTR]) geos_union = Topology("GEOSUnion", argtypes=[GEOM_PTR, GEOM_PTR]) geos_unary_union = GEOSFuncFactory( "GEOSUnaryUnion", argtypes=[GEOM_PTR], restype=GEOM_PTR ) # GEOSRelate returns a string, not a geometry. geos_relate = GEOSFuncFactory( "GEOSRelate", argtypes=[GEOM_PTR, GEOM_PTR], restype=geos_char_p, errcheck=check_string, ) # Linear referencing routines geos_project = GEOSFuncFactory( "GEOSProject", argtypes=[GEOM_PTR, GEOM_PTR], restype=c_double, errcheck=check_minus_one, ) geos_interpolate = Topology("GEOSInterpolate", argtypes=[GEOM_PTR, c_double]) geos_project_normalized = GEOSFuncFactory( "GEOSProjectNormalized", argtypes=[GEOM_PTR, GEOM_PTR], restype=c_double, errcheck=check_minus_one, ) geos_interpolate_normalized = Topology( "GEOSInterpolateNormalized", argtypes=[GEOM_PTR, c_double] )
castiel248/Convert
Lib/site-packages/django/contrib/gis/geos/prototypes/topology.py
Python
mit
2,327
# This file is distributed under the same license as the Django package. # # Translators: msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-03-18 09:16+0100\n" "PO-Revision-Date: 2015-03-18 08:35+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Afrikaans (http://www.transifex.com/projects/p/django/" "language/af/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: af\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "" msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "" msgid "Line string" msgstr "" msgid "Polygon" msgstr "" msgid "Multi-point" msgstr "" msgid "Multi-line string" msgstr "" msgid "Multi polygon" msgstr "" msgid "Geometry collection" msgstr "" msgid "Extent Aggregate Field" msgstr "" msgid "No geometry value provided." msgstr "" msgid "Invalid geometry value." msgstr "" msgid "Invalid geometry type." msgstr "" msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Google Maps via GeoDjango" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "" #, python-format msgid "Slug %r isn't registered." msgstr ""
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/af/LC_MESSAGES/django.po
po
mit
1,478
# This file is distributed under the same license as the Django package. # # Translators: # Bashar Al-Abdulhadi, 2015-2016 # Bashar Al-Abdulhadi, 2014 # Eyad Toma <d.eyad.t@gmail.com>, 2013 # Jannis Leidel <jannis@leidel.info>, 2011 # Muaaz Alsaied, 2020 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2020-04-02 11:32+0000\n" "Last-Translator: Muaaz Alsaied\n" "Language-Team: Arabic (http://www.transifex.com/django/django/language/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ar\n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" msgid "GIS" msgstr "نظم المعلومات الجغرافية GIS" msgid "The base GIS field." msgstr "حقل نظم المعلومات الجغرافية الرئيسي" msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "قاعدة حقل Geometry -- مُرتبط بنوع مواصفات OpenGIS الهندسية." msgid "Point" msgstr "نقطة إحداثية" msgid "Line string" msgstr "سطر تسلسل أحرف" msgid "Polygon" msgstr "مُضلّع إحداثي" msgid "Multi-point" msgstr "نقاط إحداثية" msgid "Multi-line string" msgstr "تسلسل أحرف متعدد الأسطر" msgid "Multi polygon" msgstr "مجموعة مُضلعات إحداثية" msgid "Geometry collection" msgstr "مجموعة إحداثية" msgid "Extent Aggregate Field" msgstr "حقل مجموع التحصيل" msgid "Raster Field" msgstr "حقل خطوط المسح التسامتي" msgid "No geometry value provided." msgstr "لم تُدخل أي أحداثيات." msgid "Invalid geometry value." msgstr "الإحداثيات غير صحيحة." msgid "Invalid geometry type." msgstr "نوع الإحداثيات غير صحيح." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "حدث خطأ أثناء تحويل geometry إلى حقل SRID." msgid "Delete all Features" msgstr "حذف جميع المميزات" msgid "WKT debugging window:" msgstr "نافذة تدقيق WKT:" msgid "Debugging window (serialized value)" msgstr "نافذة التدقيق (قيمة تسلسلية)" msgid "No feeds are registered." msgstr "لا موجز مسجّل" #, python-format msgid "Slug %r isn’t registered." msgstr "Slug %r غير مسجّل."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/ar/LC_MESSAGES/django.po
po
mit
2,569
# This file is distributed under the same license as the Django package. # # Translators: # Riterix <infosrabah@gmail.com>, 2019 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2019-12-14 22:46+0000\n" "Last-Translator: Riterix <infosrabah@gmail.com>\n" "Language-Team: Arabic (Algeria) (http://www.transifex.com/django/django/" "language/ar_DZ/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ar_DZ\n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" msgid "GIS" msgstr "نظم المعلومات الجغرافية GIS" msgid "The base GIS field." msgstr "حقل نظم المعلومات الجغرافية الرئيسي" msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "قاعدة الحقل الهندسي ترتكز لمواصفات نوع OpenGIS (نظم المعلومات الجغرافية " "المفتوحة) الهندسية." msgid "Point" msgstr "نقطة إحداثية" msgid "Line string" msgstr "سطر تسلسل أحرف" msgid "Polygon" msgstr "مُضلّع إحداثي" msgid "Multi-point" msgstr "نقاط إحداثية" msgid "Multi-line string" msgstr "تسلسل أحرف متعدد الأسطر" msgid "Multi polygon" msgstr "مجموعة مُضلعات إحداثية" msgid "Geometry collection" msgstr "مجموعة إحداثية" msgid "Extent Aggregate Field" msgstr "حقل مجموع التحصيل\"" msgid "Raster Field" msgstr "حقل خطوط المسح التسامتي" msgid "No geometry value provided." msgstr "لم تُدخل أي أحداثيات." msgid "Invalid geometry value." msgstr "الإحداثيات غير صحيحة." msgid "Invalid geometry type." msgstr "نوع الإحداثيات غير صحيح." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "حدث خطأ أثناء تحويل geometry إلى حقل SRID." msgid "Delete all Features" msgstr "حذف جميع المميزات" msgid "WKT debugging window:" msgstr "نافذة تدقيق WKT:" msgid "Debugging window (serialized value)" msgstr "نافذة التدقيق (قيمة تسلسلية)" msgid "No feeds are registered." msgstr "لا موجز مسجّل" #, python-format msgid "Slug %r isn’t registered." msgstr "Slug %r غير مسجّل"
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/ar_DZ/LC_MESSAGES/django.po
po
mit
2,555
# This file is distributed under the same license as the Django package. # # Translators: # Ḷḷumex03 <tornes@opmbx.org>, 2014 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2017-09-23 19:51+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Asturian (http://www.transifex.com/django/django/language/" "ast/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ast\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "" msgid "The base GIS field." msgstr "" msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "Puntu" msgid "Line string" msgstr "" msgid "Polygon" msgstr "Polígonu" msgid "Multi-point" msgstr "" msgid "Multi-line string" msgstr "" msgid "Multi polygon" msgstr "" msgid "Geometry collection" msgstr "" msgid "Extent Aggregate Field" msgstr "" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "Nun s'apurrió'l valor de xeometría." msgid "Invalid geometry value." msgstr "Valor de xeometría inválidu." msgid "Invalid geometry type." msgstr "Triba de xeometría inválida." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "Nun hai feeds rexistraos" #, python-format msgid "Slug %r isn't registered." msgstr ""
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/ast/LC_MESSAGES/django.po
po
mit
1,684
# This file is distributed under the same license as the Django package. # # Translators: # Ali Ismayilov <ali@ismailov.info>, 2011 # Emin Mastizada <emin@linux.com>, 2018,2020 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2020-01-12 07:23+0000\n" "Last-Translator: Emin Mastizada <emin@linux.com>\n" "Language-Team: Azerbaijani (http://www.transifex.com/django/django/language/" "az/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: az\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "Təməl GIS sahəsi (field)." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Təməl Həndəsə sahəsi — OpenGIS Specification Geometry növünə işarətlənir." msgid "Point" msgstr "Nöqtə" msgid "Line string" msgstr "Xətt" msgid "Polygon" msgstr "Poliqon" msgid "Multi-point" msgstr "Nöqtələr" msgid "Multi-line string" msgstr "Xətlər" msgid "Multi polygon" msgstr "Poliqonlar" msgid "Geometry collection" msgstr "Fiqurlar çoxluğu" msgid "Extent Aggregate Field" msgstr "Aqreqat Sahəsini Genişləndir" msgid "Raster Field" msgstr "Rastr Sahəsi" msgid "No geometry value provided." msgstr "Həndəsi qiyməti verilməyib." msgid "Invalid geometry value." msgstr "Həndəsi qiyməti düzgün deyil." msgid "Invalid geometry type." msgstr "Həndəsi tipi düzgün deyil." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Fiquru vərəqənin fiqur sahəsinin SRID qiymətinə çevirərkən xəta baş verdi." msgid "Delete all Features" msgstr "Bütün Xüsusiyyətləri sil" msgid "WKT debugging window:" msgstr "WKT sazlama pəncərəsi:" msgid "Debugging window (serialized value)" msgstr "Sazlama pəncərəsi (seriallaşdırılmış dəyər)" msgid "No feeds are registered." msgstr "Qeyd edilmiş axın yoxdur." #, python-format msgid "Slug %r isn’t registered." msgstr "%r slug-ı qeyd edilməyib."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/az/LC_MESSAGES/django.po
po
mit
2,172
# This file is distributed under the same license as the Django package. # # Translators: # Viktar Palstsiuk <vipals@gmail.com>, 2014-2015 # znotdead <zhirafchik@gmail.com>, 2016,2019 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2019-10-16 18:23+0000\n" "Last-Translator: znotdead <zhirafchik@gmail.com>\n" "Language-Team: Belarusian (http://www.transifex.com/django/django/language/" "be/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: be\n" "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n" "%100>=11 && n%100<=14)? 2 : 3);\n" msgid "GIS" msgstr "ГІС" msgid "The base GIS field." msgstr "Галоўнае поле ГІС." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Галоўнае геаметрычнае поле — адлюстроўвае геамэтрычныя віды паводле " "спэцыфікацыі «OpenGIS»." msgid "Point" msgstr "Пункт" msgid "Line string" msgstr "Ломаная" msgid "Polygon" msgstr "Шматкутнік" msgid "Multi-point" msgstr "Набор пунктаў" msgid "Multi-line string" msgstr "Набор ломаных" msgid "Multi polygon" msgstr "Набор шматкутнікаў" msgid "Geometry collection" msgstr "Набор ґеамэтрычных аб’ектаў" msgid "Extent Aggregate Field" msgstr "Поле аб'яднанай плошчы" msgid "Raster Field" msgstr "Растравае поле" msgid "No geometry value provided." msgstr "Не пазначылі значэньне ґеамэтрыі." msgid "Invalid geometry value." msgstr "Хібнае значэньне ґеамэтрыі." msgid "Invalid geometry type." msgstr "Хібны від ґеамэтрыі." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "Не ўдалося ператварыць ґеамэтрыю ў SRID." msgid "Delete all Features" msgstr "Выдаліць усе аб’екты" msgid "WKT debugging window:" msgstr "Акно адладкі WKT:" msgid "Debugging window (serialized value)" msgstr "Акно адладкі (сэрыялізаванае значэньне)" msgid "No feeds are registered." msgstr "Няма запісаных стужак." #, python-format msgid "Slug %r isn’t registered." msgstr "Біркі %r няма ў запісаных."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/be/LC_MESSAGES/django.po
po
mit
2,654
# This file is distributed under the same license as the Django package. # # Translators: # Georgi Kostadinov <grgkostadinov@gmail.com>, 2012 # Todor Lubenov <tlubenov@gmail.com>, 2016,2020 # Todor Lubenov <tlubenov@gmail.com>, 2011,2015,2021 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2021-02-28 07:20+0000\n" "Last-Translator: Todor Lubenov <tlubenov@gmail.com>\n" "Language-Team: Bulgarian (http://www.transifex.com/django/django/language/" "bg/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: bg\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "Базово ГИС поле." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Базово Геометричнно поле — карти от OpenGIS Specification Geometry тип." msgid "Point" msgstr "Точка" msgid "Line string" msgstr "Линеен елемент" msgid "Polygon" msgstr "Полигон" msgid "Multi-point" msgstr "Комплексна-точка" msgid "Multi-line string" msgstr "Комплексен-линеен елемент" msgid "Multi polygon" msgstr "Комплексен полигон" msgid "Geometry collection" msgstr "Геометрична колекция" msgid "Extent Aggregate Field" msgstr "Разшири Полето за обединяване" msgid "Raster Field" msgstr "Растерно Поле" msgid "No geometry value provided." msgstr "Няма предоставена геометрична стойност." msgid "Invalid geometry value." msgstr "Невалидна геометрична стойност." msgid "Invalid geometry type." msgstr "Невалиден геометричен тип." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Възникна грешка при трансформиране на геометрията на SRID от полето " "геометрия." msgid "Delete all Features" msgstr "Изтрий всички обекти" msgid "WKT debugging window:" msgstr "WKT прозорец за проверка:" msgid "Debugging window (serialized value)" msgstr "Debugging прозорец (сериализирана стойност)" msgid "No feeds are registered." msgstr "Няма регистрирани фийда." #, python-format msgid "Slug %r isn’t registered." msgstr "Slug %r не е регистриран."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/bg/LC_MESSAGES/django.po
po
mit
2,654
# This file is distributed under the same license as the Django package. # # Translators: # Jannis Leidel <jannis@leidel.info>, 2011 # Tahmid Rafi <rafi.tahmid@gmail.com>, 2014 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2017-09-19 16:40+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Bengali (http://www.transifex.com/django/django/language/" "bn/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: bn\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "জিআইএস" msgid "The base GIS field." msgstr "" msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "বিন্দু" msgid "Line string" msgstr "" msgid "Polygon" msgstr "বহুভুজ" msgid "Multi-point" msgstr "" msgid "Multi-line string" msgstr "" msgid "Multi polygon" msgstr "" msgid "Geometry collection" msgstr "" msgid "Extent Aggregate Field" msgstr "" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "কোন জ্যামিতিক মান দেয়া হয়নি।" msgid "Invalid geometry value." msgstr "জ্যামিতিক মানটি বৈধ নয়।" msgid "Invalid geometry type." msgstr "জ্যামিতিক নমুনাটি বৈধ নয়।" msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "" #, python-format msgid "Slug %r isn't registered." msgstr "%r স্লাগটি রেজিস্টারকৃত নয়।"
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/bn/LC_MESSAGES/django.po
po
mit
1,929
# This file is distributed under the same license as the Django package. # # Translators: # Fulup <fulup.jakez@gmail.com>, 2012 # Irriep Nala Novram <allannkorh@yahoo.fr>, 2019 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2019-03-12 14:10+0000\n" "Last-Translator: Irriep Nala Novram <allannkorh@yahoo.fr>\n" "Language-Team: Breton (http://www.transifex.com/django/django/language/br/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: br\n" "Plural-Forms: nplurals=5; plural=((n%10 == 1) && (n%100 != 11) && (n%100 !" "=71) && (n%100 !=91) ? 0 :(n%10 == 2) && (n%100 != 12) && (n%100 !=72) && (n" "%100 !=92) ? 1 :(n%10 ==3 || n%10==4 || n%10==9) && (n%100 < 10 || n% 100 > " "19) && (n%100 < 70 || n%100 > 79) && (n%100 < 90 || n%100 > 99) ? 2 :(n != 0 " "&& n % 1000000 == 0) ? 3 : 4);\n" msgid "GIS" msgstr "" msgid "The base GIS field." msgstr "" msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "Pik" msgid "Line string" msgstr "Chadenn segmant" msgid "Polygon" msgstr "Poligon" msgid "Multi-point" msgstr "Liespik" msgid "Multi-line string" msgstr "Lies chadenn segmant" msgid "Multi polygon" msgstr "Liespoligon" msgid "Geometry collection" msgstr "Dastumad mentoniezh" msgid "Extent Aggregate Field" msgstr "" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "Talvoudegezh mentoniezh roet ebet." msgid "Invalid geometry value." msgstr "Talvoudegezh mentoniezh direizh." msgid "Invalid geometry type." msgstr "Doare mentoniezh direizh." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Ur fazi a zo c'hoarvezet da vare treuzfurmadur an objed mentoniezhel e-barzh " "ar vaezienn stumm mentoniezhel SRID." msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "" #, python-format msgid "Slug %r isn't registered." msgstr "Neket enrollet ar \"slug\" %r."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/br/LC_MESSAGES/django.po
po
mit
2,220
# This file is distributed under the same license as the Django package. # # Translators: # Jannis Leidel <jannis@leidel.info>, 2011 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2017-09-19 16:40+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Bosnian (http://www.transifex.com/django/django/language/" "bs/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: bs\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" msgid "GIS" msgstr "" msgid "The base GIS field." msgstr "" msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "Tačka" msgid "Line string" msgstr "Linijska nit" msgid "Polygon" msgstr "Poligon" msgid "Multi-point" msgstr "Multi-point" msgid "Multi-line string" msgstr "Višelinijska nit" msgid "Multi polygon" msgstr "Multi poligon" msgid "Geometry collection" msgstr "Geometrijska kolekcija" msgid "Extent Aggregate Field" msgstr "" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "Niste zadali parametre za geometriju." msgid "Invalid geometry value." msgstr "Neispravan parametar za geometriju." msgid "Invalid geometry type." msgstr "Nepostojeći tip geometrije." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Došlo je do greške tokom pretvaranje geometrije u SRID geometrijskom polja " "obrazca." msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "" #, python-format msgid "Slug %r isn't registered." msgstr ""
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/bs/LC_MESSAGES/django.po
po
mit
1,905
# This file is distributed under the same license as the Django package. # # Translators: # Antoni Aloy <aaloy@apsl.net>, 2012,2015 # Carles Barrobés <carles@barrobes.com>, 2012,2014 # duub qnnp, 2015 # Jannis Leidel <jannis@leidel.info>, 2011 # Manel Clos <manelclos@gmail.com>, 2020 # Roger Pons <rogerpons@gmail.com>, 2015 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2020-04-28 20:24+0000\n" "Last-Translator: Manel Clos <manelclos@gmail.com>\n" "Language-Team: Catalan (http://www.transifex.com/django/django/language/" "ca/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ca\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "El camp base de GIS" msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "El camp base Geometry -- correspon al tipus Geometry de l'especificació " "OpenGIS." msgid "Point" msgstr "Punt" msgid "Line string" msgstr "Cadena de línies" msgid "Polygon" msgstr "Polígon" msgid "Multi-point" msgstr "Multi-punt" msgid "Multi-line string" msgstr "Cadena de multi-línies" msgid "Multi polygon" msgstr "Multi polígon" msgid "Geometry collection" msgstr "Col·leció de geometria" msgid "Extent Aggregate Field" msgstr "Estén camp agregat" msgid "Raster Field" msgstr "Camp de mapa de bits" msgid "No geometry value provided." msgstr "No s'ha indicat cap valor de geometria." msgid "Invalid geometry value." msgstr "Valor de geometria invàlid." msgid "Invalid geometry type." msgstr "Tipus de geometria invàlid." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "S'ha produït un error en transformar la geometria al SRID del camp de " "geometria del formulari." msgid "Delete all Features" msgstr "Elimina totes les característiques" msgid "WKT debugging window:" msgstr "Fines de de depuració WKT" msgid "Debugging window (serialized value)" msgstr "Finestra de depuració (valor serialitzat)" msgid "No feeds are registered." msgstr "No s'han registrat canal de contingut" #, python-format msgid "Slug %r isn’t registered." msgstr "El 'slug' %r no està registrat"
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/ca/LC_MESSAGES/django.po
po
mit
2,359
# This file is distributed under the same license as the Django package. # # Translators: # kosar tofiq <kosar.belana@gmail.com>, 2020 # Swara <swara09@gmail.com>, 2022 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2023-04-24 18:45+0000\n" "Last-Translator: Swara <swara09@gmail.com>, 2022\n" "Language-Team: Central Kurdish (http://www.transifex.com/django/django/" "language/ckb/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ckb\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "خانەی بنەڕەتی GIS." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "خانەی بنەڕەتی ئەندازەیی - نەخشەکان بۆ جۆری تایبەتمەندیە ئەندازەییەکانی " "OpenGIS." msgid "Point" msgstr "خاڵ" msgid "Line string" msgstr "هێڵی ڕیزبه‌ند" msgid "Polygon" msgstr "فرەگۆشە" msgid "Multi-point" msgstr "فرەخاڵ" msgid "Multi-line string" msgstr "ڕیزبەندی فرەهێڵ" msgid "Multi polygon" msgstr "فرەگۆشە" msgid "Geometry collection" msgstr "کۆکراوەی ئەندازەیی" msgid "Extent Aggregate Field" msgstr "خانەی کۆکراوەی فراوان" msgid "Raster Field" msgstr "خانەی ڕاستەر" msgid "No geometry value provided." msgstr "هیچ بەهایەکی ئەندازەیی دابیننەکراوە." msgid "Invalid geometry value." msgstr "بەهای ئەندازەیی نادروستە." msgid "Invalid geometry type." msgstr "جۆری ئەندازەیی نادروستە." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "هەڵەیەک ڕوویدا لە کاتی گۆڕینی ئەندازەییەکە بۆ SRID ی خانەی فۆڕمی ئەندازەیی." msgid "Delete all Features" msgstr "سڕینەوەی هەموو تایبتمەندیەکان" msgid "WKT debugging window:" msgstr "پەنجەرەی هەڵدۆزینەوەی WKT" msgid "Debugging window (serialized value)" msgstr "پەنجەرەی هەڵەدۆزینەوە (بەهای زنجیرەیی)" msgid "No feeds are registered." msgstr "هیچ پێدانێک تۆمارنەکراوە." #, python-format msgid "Slug %r isn’t registered." msgstr "سلەگی %r تۆمارنەکراوە."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/ckb/LC_MESSAGES/django.po
po
mit
2,528
# This file is distributed under the same license as the Django package. # # Translators: # Jannis Leidel <jannis@leidel.info>, 2011 # Vláďa Macek <macek@sandbox.cz>, 2012,2014 # Vláďa Macek <macek@sandbox.cz>, 2015,2019 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2019-09-19 09:23+0000\n" "Last-Translator: Vláďa Macek <macek@sandbox.cz>\n" "Language-Team: Czech (http://www.transifex.com/django/django/language/cs/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs\n" "Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n " "<= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "Základní pole GIS" msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Základní geometrické datové pole — mapuje se na typ OpenGIS Specification " "Geometry." msgid "Point" msgstr "Bod" msgid "Line string" msgstr "Úsek čáry" msgid "Polygon" msgstr "Polygon" msgid "Multi-point" msgstr "Mnohonásobný bod" msgid "Multi-line string" msgstr "Mnohonásobný úsek čáry" msgid "Multi polygon" msgstr "Mnohonásobný polygon" msgid "Geometry collection" msgstr "Kolekce geometrií" msgid "Extent Aggregate Field" msgstr "Pole Extent Aggregate" msgid "Raster Field" msgstr "Pole Raster" msgid "No geometry value provided." msgstr "Hodnota geometrie nezadána." msgid "Invalid geometry value." msgstr "Neplatná hodnota geometrie." msgid "Invalid geometry type." msgstr "Neplatný typ geometrie." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Nastala chyba při transformaci geometrie na identifikátor SRID geometrického " "formulářového pole." msgid "Delete all Features" msgstr "Odstranit všechny vlastnosti" msgid "WKT debugging window:" msgstr "Ladicí okno WKT:" msgid "Debugging window (serialized value)" msgstr "Ladicí okno (serializovaná hodnota)" msgid "No feeds are registered." msgstr "Žádné dávky nejsou registrované." #, python-format msgid "Slug %r isn’t registered." msgstr "Identifikátor %r není registrován."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/cs/LC_MESSAGES/django.po
po
mit
2,321
# This file is distributed under the same license as the Django package. # # Translators: # Maredudd ap Gwyndaf <maredudd@maredudd.com>, 2014 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2017-09-23 19:51+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Welsh (http://www.transifex.com/django/django/language/cy/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cy\n" "Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != " "11) ? 2 : 3;\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "" msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "Pwynt" msgid "Line string" msgstr "Llinyn llinell" msgid "Polygon" msgstr "Polygon" msgid "Multi-point" msgstr "Aml-bwynt" msgid "Multi-line string" msgstr "Llinyn aml-linell" msgid "Multi polygon" msgstr "Aml-bolygon" msgid "Geometry collection" msgstr "Casgliad geometreg" msgid "Extent Aggregate Field" msgstr "" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "Ni ddarparwyd gwerth geometreg" msgid "Invalid geometry value." msgstr "Gwerth geometreg annilys" msgid "Invalid geometry type." msgstr "Math geometreg annilys" msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Roedd gwall tra'n trawsnewid y geometreg i SRID y maes ffurflen geometreg." msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "Does dim un llif wedi ei gofrestru." #, python-format msgid "Slug %r isn't registered." msgstr "Malwen %r heb ei gofrestru."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/cy/LC_MESSAGES/django.po
po
mit
1,900
# This file is distributed under the same license as the Django package. # # Translators: # Erik Wognsen <r4mses@gmail.com>, 2012,2014-2015,2019 # Finn Gruwier Larsen, 2011 # Jannis Leidel <jannis@leidel.info>, 2011 # Kristian Øllegaard <kristian@oellegaard.com>, 2012 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2019-09-17 18:08+0000\n" "Last-Translator: Erik Wognsen <r4mses@gmail.com>\n" "Language-Team: Danish (http://www.transifex.com/django/django/language/da/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: da\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "Basis-GIS-feltet." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "Basisgeometrifeltet — mapper til OpenGIS Specification Geometry-typen." msgid "Point" msgstr "Punkt" msgid "Line string" msgstr "Linjesegment" msgid "Polygon" msgstr "Polygon" msgid "Multi-point" msgstr "Multipunkt" msgid "Multi-line string" msgstr "Multilinjesegment" msgid "Multi polygon" msgstr "Multipolygon" msgid "Geometry collection" msgstr "Geometrisamling" msgid "Extent Aggregate Field" msgstr "Extent Aggregate-felt" msgid "Raster Field" msgstr "Raster-felt" msgid "No geometry value provided." msgstr "Ingen værdi givet for geometri." msgid "Invalid geometry value." msgstr "Ugyldig geometriværdi." msgid "Invalid geometry type." msgstr "Ugyldig gemometritype." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Der opstod en fejl ved transformation af geometrien til formularfeltets SRID" msgid "Delete all Features" msgstr "Slet alle Features" msgid "WKT debugging window:" msgstr "WKT-fejlsøgningsvindue:" msgid "Debugging window (serialized value)" msgstr "Fejlsøgninsvindue (serialiseret værdi)" msgid "No feeds are registered." msgstr "Ingen feeds registrerede." #, python-format msgid "Slug %r isn’t registered." msgstr "\"Slug\" %r er ikke registreret."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/da/LC_MESSAGES/django.po
po
mit
2,179
# This file is distributed under the same license as the Django package. # # Translators: # André Hagenbruch, 2012 # Jannis Leidel <jannis@leidel.info>, 2011-2012,2014-2015,2020 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2020-01-17 23:01+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: German (http://www.transifex.com/django/django/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "Das Basis-GIS-Feld." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Das Basis-GIS-Feld – verwendet den Geometrie-Typ der OpenGIS-Spezifikation." msgid "Point" msgstr "Punkt" msgid "Line string" msgstr "Linienzug" msgid "Polygon" msgstr "Polygon" msgid "Multi-point" msgstr "Mehrere Punkte" msgid "Multi-line string" msgstr "Mehrere Linienzüge" msgid "Multi polygon" msgstr "Mehrere Polygone" msgid "Geometry collection" msgstr "Sammlung geometrischer Objekte" msgid "Extent Aggregate Field" msgstr "Ausmaße-Aggregat-Feld" msgid "Raster Field" msgstr "Raster-Feld" msgid "No geometry value provided." msgstr "Kein geometrischer Wert gegeben." msgid "Invalid geometry value." msgstr "Ungültiger geometrischer Wert." msgid "Invalid geometry type." msgstr "Ungültiger geometrischer Typ." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Ein Fehler ist beim Umwandeln der Geometrie-Werte in die SRID des Geometrie-" "Formularfeldes aufgetreten." msgid "Delete all Features" msgstr "Alles löschen" msgid "WKT debugging window:" msgstr "WKT-Debugging-Fenster:" msgid "Debugging window (serialized value)" msgstr "Debugging-Fenster (serialisierter Wert)" msgid "No feeds are registered." msgstr "Keine Feeds registriert." #, python-format msgid "Slug %r isn’t registered." msgstr "Kürzel %r ist nicht registriert."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/de/LC_MESSAGES/django.po
po
mit
2,163
# This file is distributed under the same license as the Django package. # # Translators: # Michael Wolf <milupo@sorbzilla.de>, 2016,2020 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2020-02-25 16:08+0000\n" "Last-Translator: Michael Wolf <milupo@sorbzilla.de>\n" "Language-Team: Lower Sorbian (http://www.transifex.com/django/django/" "language/dsb/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: dsb\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" "%100==4 ? 2 : 3);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "Bazowe pólo GIS." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Bazowe geometrijowe pólo -- wužywa geometrijowy typ specifikacije OpenGIS." msgid "Point" msgstr "Dypk" msgid "Line string" msgstr "Cera" msgid "Polygon" msgstr "Wjelerožk" msgid "Multi-point" msgstr "Někotare dypki" msgid "Multi-line string" msgstr "Někotare cery" msgid "Multi polygon" msgstr "Někotare wjelerožki" msgid "Geometry collection" msgstr "Geometrijowa zběrka" msgid "Extent Aggregate Field" msgstr "Pólo „Extent Aggregate" msgid "Raster Field" msgstr "Rasterowe pólo" msgid "No geometry value provided." msgstr "Žedna geometrijowa gódnota pódana." msgid "Invalid geometry value." msgstr "Njepłaśiwa geometrijowa gódnota." msgid "Invalid geometry type." msgstr "Njepłaśiwy geometrijowy typ." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Zmólka jo se nastała, gaž geometrija jo se do SRID póla geometrijowego " "formulara pśetwóriła." msgid "Delete all Features" msgstr "Wšykne funkcije lašowaś" msgid "WKT debugging window:" msgstr "Wokno pytanja zmólkow WKT:" msgid "Debugging window (serialized value)" msgstr "Wokno pytanja zmólkow (serializěrowana gódnota)" msgid "No feeds are registered." msgstr "Žedne kanale njejsu zregistrěrowane." #, python-format msgid "Slug %r isn’t registered." msgstr "Adresowe mě %r njejo zregistrěrowane."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/dsb/LC_MESSAGES/django.po
po
mit
2,234
# This file is distributed under the same license as the Django package. # # Translators: # Anastasiadis Stavros <anastasiadis.st00@gmail.com>, 2014 # Dimitris Glezos <glezos@transifex.com>, 2011 # Elena Andreou <helenaandreou.ha@gmail.com>, 2016 # Fotis Athineos <fotis@transifex.com>, 2021 # Kostas Papadimitriou <vinilios@gmail.com>, 2012 # Nick Mavrakis <mavrakis.n@gmail.com>, 2016 # Pãnoș <panos.laganakos@gmail.com>, 2016 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2021-08-04 06:23+0000\n" "Last-Translator: Fotis Athineos <fotis@transifex.com>\n" "Language-Team: Greek (http://www.transifex.com/django/django/language/el/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: el\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr " Γεωγραφικά Συστήματα Πληροφορίας" msgid "The base GIS field." msgstr "Το βασικό GIS πεδίο." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Το βασικό Γεωμετρικό πεδίο — αντιστοιχεί στον τύπο της Γεωμετρικής " "Προδιαγραφής OpenGIS." msgid "Point" msgstr "Σημείο" msgid "Line string" msgstr "Γραμμή string" msgid "Polygon" msgstr "Πολύγωνο" msgid "Multi-point" msgstr "Πολλαπλό σημείο" msgid "Multi-line string" msgstr "Multi-line string" msgid "Multi polygon" msgstr "Πολλαπλό πολύγωνο" msgid "Geometry collection" msgstr "Συλλογή γεωμετριών" msgid "Extent Aggregate Field" msgstr "Πεδίο Extent Aggregate" msgid "Raster Field" msgstr "Πεδίο Raster" msgid "No geometry value provided." msgstr "Δε δόθηκε τιμή γεωμετρίας." msgid "Invalid geometry value." msgstr "Άκυρη γεωμετρική τιμή." msgid "Invalid geometry type." msgstr "Άκυρος γεωμετρικός τύπος." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Παρουσιάστηκε σφάλμα κατά τη μετατροπή της γεωμετρίας στο SRID του πεδίου " "της φόρμας γεωμετρίας." msgid "Delete all Features" msgstr "Διαγραφή όλων των αντικειμένων" msgid "WKT debugging window:" msgstr "Παράθυρο αποσφαλμάτωσης WKT" msgid "Debugging window (serialized value)" msgstr "Παράθυρο αποσφαλμάτωσης (σειριακή τιμή)" msgid "No feeds are registered." msgstr "Δεν υπάρχουν εγγεγραμμένες ροές ειδήσεων." #, python-format msgid "Slug %r isn’t registered." msgstr "Το slug %r δεν έχει καταχωρηθεί."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/el/LC_MESSAGES/django.po
po
mit
2,937
# This file is distributed under the same license as the Django package. # msgid "" msgstr "" "Project-Id-Version: Django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2010-05-13 15:35+0200\n" "Last-Translator: Django team\n" "Language-Team: English <en@li.org>\n" "Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: contrib/gis/apps.py:8 msgid "GIS" msgstr "" #: contrib/gis/db/models/fields.py:64 msgid "The base GIS field." msgstr "" #: contrib/gis/db/models/fields.py:201 msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" #: contrib/gis/db/models/fields.py:285 msgid "Point" msgstr "" #: contrib/gis/db/models/fields.py:292 msgid "Line string" msgstr "" #: contrib/gis/db/models/fields.py:299 msgid "Polygon" msgstr "" #: contrib/gis/db/models/fields.py:306 msgid "Multi-point" msgstr "" #: contrib/gis/db/models/fields.py:313 msgid "Multi-line string" msgstr "" #: contrib/gis/db/models/fields.py:320 msgid "Multi polygon" msgstr "" #: contrib/gis/db/models/fields.py:327 msgid "Geometry collection" msgstr "" #: contrib/gis/db/models/fields.py:333 msgid "Extent Aggregate Field" msgstr "" #: contrib/gis/db/models/fields.py:348 msgid "Raster Field" msgstr "" #: contrib/gis/forms/fields.py:19 msgid "No geometry value provided." msgstr "" #: contrib/gis/forms/fields.py:20 msgid "Invalid geometry value." msgstr "" #: contrib/gis/forms/fields.py:21 msgid "Invalid geometry type." msgstr "" #: contrib/gis/forms/fields.py:22 msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" #: contrib/gis/templates/gis/admin/openlayers.html:35 #: contrib/gis/templates/gis/openlayers.html:12 msgid "Delete all Features" msgstr "" #: contrib/gis/templates/gis/admin/openlayers.html:37 msgid "WKT debugging window:" msgstr "" #: contrib/gis/templates/gis/openlayers.html:13 msgid "Debugging window (serialized value)" msgstr "" #: contrib/gis/views.py:8 msgid "No feeds are registered." msgstr "" #: contrib/gis/views.py:14 #, python-format msgid "Slug %r isn’t registered." msgstr ""
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/en/LC_MESSAGES/django.po
po
mit
2,225
# This file is distributed under the same license as the Django package. # # Translators: msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-03-18 09:16+0100\n" "PO-Revision-Date: 2015-03-18 08:35+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: English (Australia) (http://www.transifex.com/projects/p/" "django/language/en_AU/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: en_AU\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "" msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "" msgid "Line string" msgstr "" msgid "Polygon" msgstr "" msgid "Multi-point" msgstr "" msgid "Multi-line string" msgstr "" msgid "Multi polygon" msgstr "" msgid "Geometry collection" msgstr "" msgid "Extent Aggregate Field" msgstr "" msgid "No geometry value provided." msgstr "" msgid "Invalid geometry value." msgstr "" msgid "Invalid geometry type." msgstr "" msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Google Maps via GeoDjango" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "" #, python-format msgid "Slug %r isn't registered." msgstr ""
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/en_AU/LC_MESSAGES/django.po
po
mit
1,494
# This file is distributed under the same license as the Django package. # # Translators: # jon_atkinson <jon@jonatkinson.co.uk>, 2011 # Ross Poulton <ross@rossp.org>, 2012 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2017-09-19 16:40+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: English (United Kingdom) (http://www.transifex.com/django/" "django/language/en_GB/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: en_GB\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "" msgid "The base GIS field." msgstr "" msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "Point" msgid "Line string" msgstr "Line string" msgid "Polygon" msgstr "Polygon" msgid "Multi-point" msgstr "Multi-point" msgid "Multi-line string" msgstr "Multi-line string" msgid "Multi polygon" msgstr "Multi polygon" msgid "Geometry collection" msgstr "Geometry collection" msgid "Extent Aggregate Field" msgstr "" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "No geometry value provided." msgid "Invalid geometry value." msgstr "Invalid geometry value." msgid "Invalid geometry type." msgstr "Invalid geometry type." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "No feeds are registered." #, python-format msgid "Slug %r isn't registered." msgstr "Slug %r isn't registered."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/en_GB/LC_MESSAGES/django.po
po
mit
1,910
# This file is distributed under the same license as the Django package. # # Translators: # Baptiste Darthenay <baptiste+transifex@darthenay.fr>, 2012 # Baptiste Darthenay <baptiste+transifex@darthenay.fr>, 2014-2015 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2017-09-19 16:40+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Esperanto (http://www.transifex.com/django/django/language/" "eo/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: eo\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "La baza GIS kampo." msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "La baza Geometry kampo - korelas al la OpenGIS Specifa Geometrio tipo." msgid "Point" msgstr "Punkto" msgid "Line string" msgstr "Liniŝnuro" msgid "Polygon" msgstr "Plurangulo" msgid "Multi-point" msgstr "Multpunkto" msgid "Multi-line string" msgstr "Multlinia ŝnuro" msgid "Multi polygon" msgstr "Multplurangulo" msgid "Geometry collection" msgstr "Geometriaro" msgid "Extent Aggregate Field" msgstr "Etenda kunmetita kampo" msgid "Raster Field" msgstr "Rastruma kampo" msgid "No geometry value provided." msgstr "Neniu geometria valoro provizas." msgid "Invalid geometry value." msgstr "Malvalida geometria valoro." msgid "Invalid geometry type." msgstr "Malvalida geometria tipo." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Eraro okazis dum transformi la geometrion al la SRID de la geometria forma " "kampo." msgid "Delete all Features" msgstr "Forigi ĉiuj trajtoj" msgid "WKT debugging window:" msgstr "WKT elcimigita fenestro:" msgid "Debugging window (serialized value)" msgstr "Elcimigita fenestro (seriigita valoro)" msgid "No feeds are registered." msgstr "Neniu fluo estas registrita." #, python-format msgid "Slug %r isn't registered." msgstr "Ĵetonvorto %r ne estas registrita."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/eo/LC_MESSAGES/django.po
po
mit
2,155
# This file is distributed under the same license as the Django package. # # Translators: # Antoni Aloy <aaloy@apsl.net>, 2012,2015-2016,2019 # Ernesto Avilés, 2015 # Ernesto Avilés, 2020 # Igor Támara <igor@tamarapatino.org>, 2015 # Jannis Leidel <jannis@leidel.info>, 2011 # Josue Naaman Nistal Guerra <josuenistal@hotmail.com>, 2014 # Marc Garcia <garcia.marc@gmail.com>, 2011 # Uriel Medina <urimeba511@gmail.com>, 2020 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2020-09-25 17:36+0000\n" "Last-Translator: Uriel Medina <urimeba511@gmail.com>\n" "Language-Team: Spanish (http://www.transifex.com/django/django/language/" "es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "El campo GIS base." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "El campo base Geometry — coincide con el tipo OpenGIS Specification Geometry." msgid "Point" msgstr "Punto" msgid "Line string" msgstr "Cadena de línea" msgid "Polygon" msgstr "Polígono" msgid "Multi-point" msgstr "Punto múltiple" msgid "Multi-line string" msgstr "Cadena de línea múltiple" msgid "Multi polygon" msgstr "Polígono múltiple" msgid "Geometry collection" msgstr "Colección de \"Geometry\"" msgid "Extent Aggregate Field" msgstr "Extensión de campo agregado" msgid "Raster Field" msgstr "Campo Raster" msgid "No geometry value provided." msgstr "No se indico ningún valor de geometría." msgid "Invalid geometry value." msgstr "Valor de geometría inválido." msgid "Invalid geometry type." msgstr "Tipo de geometría inválido." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Ocurrió un error al transformar la geometria al SRID de la geometria del " "campo de formulario." msgid "Delete all Features" msgstr "Borrar todos los elementos" msgid "WKT debugging window:" msgstr "Ventana de depuración WKT" msgid "Debugging window (serialized value)" msgstr "Ventana de depuración (valores serializados)" msgid "No feeds are registered." msgstr "No se han registrado canales de contenido." #, python-format msgid "Slug %r isn’t registered." msgstr "El slug %r no está registrado."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/es/LC_MESSAGES/django.po
po
mit
2,476
# This file is distributed under the same license as the Django package. # # Translators: # Jannis Leidel <jannis@leidel.info>, 2011 # Ramiro Morales, 2012,2014-2015,2019 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2019-10-01 10:26+0000\n" "Last-Translator: Ramiro Morales\n" "Language-Team: Spanish (Argentina) (http://www.transifex.com/django/django/" "language/es_AR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es_AR\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "SIG" msgid "The base GIS field." msgstr "El campo GIS base" msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "El campo Geometry base — corresponde al tipo Geometry de la especificación " "OpenGIS." msgid "Point" msgstr "Punto" msgid "Line string" msgstr "Secuencia de líneas" msgid "Polygon" msgstr "Polígono" msgid "Multi-point" msgstr "Multi-punto" msgid "Multi-line string" msgstr "Cadena multi-línea" msgid "Multi polygon" msgstr "Multi polígono" msgid "Geometry collection" msgstr "Colección de Geometry's" msgid "Extent Aggregate Field" msgstr "Campo Extent Aggregate" msgid "Raster Field" msgstr "Campo Raster" msgid "No geometry value provided." msgstr "No se ha proporcionado un valor de geometría." msgid "Invalid geometry value." msgstr "Valor de geometría no válido." msgid "Invalid geometry type." msgstr "Tipo de geometría no válido." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Ha ocurrido un error mientras se transformaba la geometría al SRID del campo " "de formulario de la misma." msgid "Delete all Features" msgstr "Eliminar todas las Features" msgid "WKT debugging window:" msgstr "Ventana de depuración WTK:" msgid "Debugging window (serialized value)" msgstr "Ventana de depuración (valor serializado)" msgid "No feeds are registered." msgstr "No se han registrado feeds." #, python-format msgid "Slug %r isn’t registered." msgstr "El slug %r no está registrado."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/es_AR/LC_MESSAGES/django.po
po
mit
2,208
# This file is distributed under the same license as the Django package. # # Translators: # Antoni Aloy <aaloy@apsl.net>, 2012,2015 # Ernesto Avilés Vázquez <whippiii@gmail.com>, 2015 # Igor Támara <igor@tamarapatino.org>, 2015 # Jannis Leidel <jannis@leidel.info>, 2011 # Josue Naaman Nistal Guerra <josuenistal@hotmail.com>, 2014 # Marc Garcia <garcia.marc@gmail.com>, 2011 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2017-09-20 03:01+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Spanish (Colombia) (http://www.transifex.com/django/django/" "language/es_CO/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es_CO\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "El campo GIS base." msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "Punto" msgid "Line string" msgstr "Cadena de línea" msgid "Polygon" msgstr "Polígono" msgid "Multi-point" msgstr "Punto múltiple" msgid "Multi-line string" msgstr "Cadena de línea múltiple" msgid "Multi polygon" msgstr "Polígono múltiple" msgid "Geometry collection" msgstr "Colección de \"Geometry\"" msgid "Extent Aggregate Field" msgstr "Extensión de campo agregado" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "No se indico ningún valor de geometría." msgid "Invalid geometry value." msgstr "Valor de geometría inválido." msgid "Invalid geometry type." msgstr "Tipo de geometría inválido." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Ocurrió un error al transformar la geometria al SRID de la geometria del " "campo de formulario." msgid "Delete all Features" msgstr "Borrar todos los elementos" msgid "WKT debugging window:" msgstr "Ventana de depuración WKT" msgid "Debugging window (serialized value)" msgstr "Ventana de depuración (valores serializados)" msgid "No feeds are registered." msgstr "No se han registrado canales de contenido." #, python-format msgid "Slug %r isn't registered." msgstr "El slug %r no está registrado."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/es_CO/LC_MESSAGES/django.po
po
mit
2,347
# This file is distributed under the same license as the Django package. # # Translators: # Abraham Estrada, 2011-2012 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2017-09-19 16:40+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Spanish (Mexico) (http://www.transifex.com/django/django/" "language/es_MX/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es_MX\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "" msgid "The base GIS field." msgstr "" msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "Punto" msgid "Line string" msgstr "Secuencia de líneas" msgid "Polygon" msgstr "Polígono" msgid "Multi-point" msgstr "Multi-punto" msgid "Multi-line string" msgstr "Cadena multi-línea" msgid "Multi polygon" msgstr "Multi polígonos" msgid "Geometry collection" msgstr "Colección de geometrías" msgid "Extent Aggregate Field" msgstr "" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "No se ha proporcionado un valor de geometría." msgid "Invalid geometry value." msgstr "Valor de geometría no válido." msgid "Invalid geometry type." msgstr "Tipo de geometría no válido." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Ha ocurrido un error mientras se transformaba la geometría al SRID del campo " "de formulario de la misma." msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "No hay feeds registrados." #, python-format msgid "Slug %r isn't registered." msgstr "El slug %r no está registrado."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/es_MX/LC_MESSAGES/django.po
po
mit
1,928
# This file is distributed under the same license as the Django package. # # Translators: msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-03-18 09:16+0100\n" "PO-Revision-Date: 2015-03-18 08:35+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Spanish (Venezuela) (http://www.transifex.com/projects/p/" "django/language/es_VE/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es_VE\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "" msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "" msgid "Line string" msgstr "" msgid "Polygon" msgstr "" msgid "Multi-point" msgstr "" msgid "Multi-line string" msgstr "" msgid "Multi polygon" msgstr "" msgid "Geometry collection" msgstr "" msgid "Extent Aggregate Field" msgstr "" msgid "No geometry value provided." msgstr "" msgid "Invalid geometry value." msgstr "" msgid "Invalid geometry type." msgstr "" msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Google Maps via GeoDjango" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "" #, python-format msgid "Slug %r isn't registered." msgstr ""
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/es_VE/LC_MESSAGES/django.po
po
mit
1,494
# This file is distributed under the same license as the Django package. # # Translators: # eallik <eallik@gmail.com>, 2011 # Jannis Leidel <jannis@leidel.info>, 2011 # Janno Liivak <jannolii@gmail.com>, 2013-2015 # madisvain <madisvain@gmail.com>, 2011 # Martin Pajuste <martinpajuste@gmail.com>, 2015 # Ragnar Rebase <rrebase@gmail.com>, 2019 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2019-12-28 02:37+0000\n" "Last-Translator: Ragnar Rebase <rrebase@gmail.com>\n" "Language-Team: Estonian (http://www.transifex.com/django/django/language/" "et/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: et\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "Baas GIS väli." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Baas Geomeetria väli -- ühildub OpenGIS Spetsifikatsiooni Geomeetria tüübiga." msgid "Point" msgstr "Punkt" msgid "Line string" msgstr "Üherea tekst" msgid "Polygon" msgstr "Polügon" msgid "Multi-point" msgstr "Multi-punkt" msgid "Multi-line string" msgstr "Mitmerealine string" msgid "Multi polygon" msgstr "Multi-polügon" msgid "Geometry collection" msgstr "Geomeetriakogum" msgid "Extent Aggregate Field" msgstr "Laiendi Agregeeritud Väli" msgid "Raster Field" msgstr "Rastri Väli" msgid "No geometry value provided." msgstr "Geomeetriline väärtus puudub." msgid "Invalid geometry value." msgstr "Vigane geomeetriline väärtus." msgid "Invalid geometry type." msgstr "Vigane geomeetriline tüüp." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "Geomeetria teisendamisel geomeetria vormivälja SRID-ks tekkis viga." msgid "Delete all Features" msgstr "Kustuta kõik Vahendid" msgid "WKT debugging window:" msgstr "WKT silumisaken:" msgid "Debugging window (serialized value)" msgstr "Siluri aken (järjestikväärtus)" msgid "No feeds are registered." msgstr "Ühtegi voogu pole registreeritud." #, python-format msgid "Slug %r isn’t registered." msgstr "Nälk %r ei ole registeeritud."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/et/LC_MESSAGES/django.po
po
mit
2,282
# This file is distributed under the same license as the Django package. # # Translators: # Aitzol Naberan <anaberan@codesyntax.com>, 2011-2012 # Eneko Illarramendi <eneko@illarra.com>, 2017 # Urtzi Odriozola <urtzi.odriozola@gmail.com>, 2017,2021 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2021-03-18 15:45+0000\n" "Last-Translator: Urtzi Odriozola <urtzi.odriozola@gmail.com>\n" "Language-Team: Basque (http://www.transifex.com/django/django/language/eu/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: eu\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "Oinarrizko GIS eremua." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Oinarrizko Geometria eremua — OpenGIS zehaztapeneko Geomtry motarentzat mapak" msgid "Point" msgstr "Puntua" msgid "Line string" msgstr "Lerro string-a" msgid "Polygon" msgstr "Poligonoa" msgid "Multi-point" msgstr "Puntu anitz" msgid "Multi-line string" msgstr "Lerro-anitzeko string-a" msgid "Multi polygon" msgstr "Multi poligonoa" msgid "Geometry collection" msgstr "Geometria bilduma" msgid "Extent Aggregate Field" msgstr "Eremu agregatu hedatua" msgid "Raster Field" msgstr "Raster eremua" msgid "No geometry value provided." msgstr "Ez fa geometria baliorik eman." msgid "Invalid geometry value." msgstr "Geometria balio okera." msgid "Invalid geometry type." msgstr "Geometria mota okerra." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "Errore bat gertatu da geometria bere form eremuaren SRIDra biurtzean." msgid "Delete all Features" msgstr "Ezabatu ezaugarri guztiak" msgid "WKT debugging window:" msgstr "WKT arazketa leihoa:" msgid "Debugging window (serialized value)" msgstr "Arazketa leihoa (balio serializatua)" msgid "No feeds are registered." msgstr "Ez dago jariorik erregistratuta." #, python-format msgid "Slug %r isn’t registered." msgstr "%r sluga ez dago erregistratuta."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/eu/LC_MESSAGES/django.po
po
mit
2,197
# This file is distributed under the same license as the Django package. # # Translators: # Ali Nikneshan <ali@nikneshan.com>, 2012-2013,2020 # Alireza Savand <alireza.savand@gmail.com>, 2013 # Ali Vakilzade <ali.vakilzade@gmail.com>, 2015 # Jannis Leidel <jannis@leidel.info>, 2011 # Pouya Abbassi, 2016 # Saeed <sd.javadi@gmail.com>, 2011 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2020-11-06 08:17+0000\n" "Last-Translator: Ali Nikneshan <ali@nikneshan.com>\n" "Language-Team: Persian (http://www.transifex.com/django/django/language/" "fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fa\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "GIS" msgstr "جی‌آی‌اس" msgid "The base GIS field." msgstr "پایه‌ی سیستم اطلاعات جغرافیایی میدانی." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "پایه‌ی فیلد هندسی --نوع خاص هندسه‌ی نقشه‌ها‌ی نوع OpenGIS" msgid "Point" msgstr "نقطه" msgid "Line string" msgstr "رشته خط" msgid "Polygon" msgstr "چندضلعی" msgid "Multi-point" msgstr "چند نقطه ای" msgid "Multi-line string" msgstr "چند خط رشته" msgid "Multi polygon" msgstr "چندین چند ضلعی " msgid "Geometry collection" msgstr "مجموعه هندسی" msgid "Extent Aggregate Field" msgstr "تراکم وسعت حوزه‌ی " msgid "Raster Field" msgstr "حوزه‌ی شطرنجی" msgid "No geometry value provided." msgstr "مقدار جغرافیایی‌ای مقرر نشده است." msgid "Invalid geometry value." msgstr "مقدار جغرافیایی نامعتبر" msgid "Invalid geometry type." msgstr "نوعِ جغرافیایی نامعتبر" msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "مشکلی در هنگام انتقال مختصات هندسی از فیلد به SRID رخ داد." msgid "Delete all Features" msgstr "حذف همه‌ی اشیاء" msgid "WKT debugging window:" msgstr "پنجره‌ی اشکال زدایی «متن قابل درک»" msgid "Debugging window (serialized value)" msgstr "پنجره‌ی اشکال زدایی (ارزش متوالی)" msgid "No feeds are registered." msgstr "هیچ فیدی ثبت شده است." #, python-format msgid "Slug %r isn’t registered." msgstr "Slug %r ثبت نشده"
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/fa/LC_MESSAGES/django.po
po
mit
2,596
# This file is distributed under the same license as the Django package. # # Translators: # Aarni Koskela, 2015,2020 # Antti Kaihola <antti.15+transifex@kaihola.fi>, 2011 # Jannis Leidel <jannis@leidel.info>, 2011 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2020-12-09 06:30+0000\n" "Last-Translator: Aarni Koskela\n" "Language-Team: Finnish (http://www.transifex.com/django/django/language/" "fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "Paikkatietojärjestelmä" msgid "The base GIS field." msgstr "GIS-peruskenttä." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "Geometriaperuskenttä – vastaa OpenGIS-määrittelyn geometriatyyppiä." msgid "Point" msgstr "Piste" msgid "Line string" msgstr "Murtoviiva" msgid "Polygon" msgstr "Polygoni" msgid "Multi-point" msgstr "Monipiste" msgid "Multi-line string" msgstr "Monimurtoviiva" msgid "Multi polygon" msgstr "Monipolygoni" msgid "Geometry collection" msgstr "Geometriakokoelma" msgid "Extent Aggregate Field" msgstr "Laajuusaggregaattikenttä" msgid "Raster Field" msgstr "Rasterikenttä" msgid "No geometry value provided." msgstr "Geometria-arvoa ei annettu." msgid "Invalid geometry value." msgstr "Virheellinen geometria-arvo." msgid "Invalid geometry type." msgstr "Virheellinen geometriatyyppi." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "Kentän SRID-muunnoksessa tapahtui virhe." msgid "Delete all Features" msgstr "Poista kaikki ominaisuudet" msgid "WKT debugging window:" msgstr "WKT-debuggausikkuna:" msgid "Debugging window (serialized value)" msgstr "Debuggausikkuna (sarjoitettu arvo)" msgid "No feeds are registered." msgstr "Syötteitä ei ole rekisteröity." #, python-format msgid "Slug %r isn’t registered." msgstr "Lyhytnimeä %r ei ole rekisteröity."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/fi/LC_MESSAGES/django.po
po
mit
2,114
# This file is distributed under the same license as the Django package. # # Translators: # Claude Paroz <claude@2xlibre.net>, 2014-2015,2017,2019 # Claude Paroz <claude@2xlibre.net>, 2012 # Jannis Leidel <jannis@leidel.info>, 2011 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2019-09-18 15:59+0000\n" "Last-Translator: Claude Paroz <claude@2xlibre.net>\n" "Language-Team: French (http://www.transifex.com/django/django/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "GIS" msgstr "SIG" msgid "The base GIS field." msgstr "Le champ SIG de base." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Le champ géométrique de base, correspond au type Geometry de la " "spécification OpenGIS." msgid "Point" msgstr "Point" msgid "Line string" msgstr "Chaîne de segment" msgid "Polygon" msgstr "Polygone" msgid "Multi-point" msgstr "Multipoint" msgid "Multi-line string" msgstr "Chaîne multisegment" msgid "Multi polygon" msgstr "Multipolygone" msgid "Geometry collection" msgstr "Collection géométrique" msgid "Extent Aggregate Field" msgstr "Champ d’agrégation d’étendue" msgid "Raster Field" msgstr "Champ matriciel" msgid "No geometry value provided." msgstr "Aucune valeur géométrique fournie." msgid "Invalid geometry value." msgstr "Valeur géométrique non valide." msgid "Invalid geometry type." msgstr "Type de géométrie non valide." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Une erreur est survenue lors de la transformation de l’objet géométrique " "dans le SRID du champ de formulaire géométrique." msgid "Delete all Features" msgstr "Supprimer toutes les localisations" msgid "WKT debugging window:" msgstr "Fenêtre de débogage WKT :" msgid "Debugging window (serialized value)" msgstr "Fenêtre de débogage (valeur sérialisée)" msgid "No feeds are registered." msgstr "Aucun flux enregistré." #, python-format msgid "Slug %r isn’t registered." msgstr "Le slug %r n’est pas enregistré."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/fr/LC_MESSAGES/django.po
po
mit
2,306
# This file is distributed under the same license as the Django package. # # Translators: msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-03-18 09:16+0100\n" "PO-Revision-Date: 2015-03-18 08:35+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Western Frisian (http://www.transifex.com/projects/p/django/" "language/fy/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fy\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "" msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "" msgid "Line string" msgstr "" msgid "Polygon" msgstr "" msgid "Multi-point" msgstr "" msgid "Multi-line string" msgstr "" msgid "Multi polygon" msgstr "" msgid "Geometry collection" msgstr "" msgid "Extent Aggregate Field" msgstr "" msgid "No geometry value provided." msgstr "" msgid "Invalid geometry value." msgstr "" msgid "Invalid geometry type." msgstr "" msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Google Maps via GeoDjango" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "" #, python-format msgid "Slug %r isn't registered." msgstr ""
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/fy/LC_MESSAGES/django.po
po
mit
1,484
# This file is distributed under the same license as the Django package. # # Translators: # Jannis Leidel <jannis@leidel.info>, 2011 # Michael Thornhill <michael@maithu.com>, 2012 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2017-09-23 18:54+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Irish (http://www.transifex.com/django/django/language/ga/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ga\n" "Plural-Forms: nplurals=5; plural=(n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : " "4);\n" msgid "GIS" msgstr "" msgid "The base GIS field." msgstr "" msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "Pointe" msgid "Line string" msgstr "Líne teaghrán" msgid "Polygon" msgstr "Polagán" msgid "Multi-point" msgstr "Il-phointe" msgid "Multi-line string" msgstr "Il-líne teaghrán" msgid "Multi polygon" msgstr "Il polagán" msgid "Geometry collection" msgstr "Céimseata bhailiú" msgid "Extent Aggregate Field" msgstr "" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "Ní soláthair méid geoiméadracht" msgid "Invalid geometry value." msgstr "Méid geoiméadracht neamhbhailí" msgid "Invalid geometry type." msgstr "Tíopa geoiméadracht neamhbhailí" msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Tharla earráid ag claochlú an geoiméadracht go dtí SRID an réimse fhoirm " "geoiméadracht." msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "Níl fothaí cláraithe." #, python-format msgid "Slug %r isn't registered." msgstr "Níl slug %r cláraithe."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/ga/LC_MESSAGES/django.po
po
mit
1,968
# This file is distributed under the same license as the Django package. # # Translators: # GunChleoc, 2015-2016 # GunChleoc, 2015 # GunChleoc, 2015 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2019-12-13 12:40+0000\n" "Last-Translator: GunChleoc\n" "Language-Team: Gaelic, Scottish (http://www.transifex.com/django/django/" "language/gd/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: gd\n" "Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : " "(n > 2 && n < 20) ? 2 : 3;\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "Bun-raon GIS." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Bun-raon geomatrais – thèid a mhapachadh dhan t-seòrsa geomatrais a chaidh a " "shònrachadh le OpenGIS." msgid "Point" msgstr "Puing" msgid "Line string" msgstr "Sreang loidhne" msgid "Polygon" msgstr "Ioma-cheàrnach" msgid "Multi-point" msgstr "Iomadh-phuing" msgid "Multi-line string" msgstr "Sreang ioma-loidhne" msgid "Multi polygon" msgstr "Iomadh ioma-cheàrnach" msgid "Geometry collection" msgstr "Cruinneachadh geomatrais" msgid "Extent Aggregate Field" msgstr "Raon agragaid a tha ann" msgid "Raster Field" msgstr "Raon raster" msgid "No geometry value provided." msgstr "Cha deach luach geomatrais a shònrachadh." msgid "Invalid geometry value." msgstr "Luach geomatrais mì-dhligheach." msgid "Invalid geometry type." msgstr "Seòrsa geomatrais mì-dhligheach." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Thachair mearachd le thar-mhùthadh a’ gheomatrais gun SRID aig raon foirme " "a’ gheomatrais." msgid "Delete all Features" msgstr "Sguab às a h-uile gleus" msgid "WKT debugging window:" msgstr "Uinneag dì-bhugachadh WKT:" msgid "Debugging window (serialized value)" msgstr "Uinneag dì-bhugachaidh (luach sreathaichte)" msgid "No feeds are registered." msgstr "Cha deach inbhir a shònrachadh." #, python-format msgid "Slug %r isn’t registered." msgstr "Cha deach an sluga %r a chlàradh."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/gd/LC_MESSAGES/django.po
po
mit
2,259
# This file is distributed under the same license as the Django package. # # Translators: # fasouto <fsoutomoure@gmail.com>, 2011 # fonso <fonzzo@gmail.com>, 2013 # Leandro Regueiro <leandro.regueiro@gmail.com>, 2013 # X Bello <xbello@gmail.com>, 2023 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2023-04-24 18:45+0000\n" "Last-Translator: X Bello <xbello@gmail.com>, 2023\n" "Language-Team: Galician (http://www.transifex.com/django/django/language/" "gl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: gl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "SIX" msgid "The base GIS field." msgstr "O cambo básico de XIS." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "O cambo básico Geometry — correspónese co tipo Geometry da especificación " "OpenGIS." msgid "Point" msgstr "Punto" msgid "Line string" msgstr "Secuencia de liñas" msgid "Polygon" msgstr "Polígono" msgid "Multi-point" msgstr "Punto múltiple" msgid "Multi-line string" msgstr "Cadea multi-liña" msgid "Multi polygon" msgstr "Multi polígono" msgid "Geometry collection" msgstr "Colección de xeometrías" msgid "Extent Aggregate Field" msgstr "Campo de Agregación de Extensión" msgid "Raster Field" msgstr "Campo de Raster" msgid "No geometry value provided." msgstr "Non se proporcionou un valor de xeometría." msgid "Invalid geometry value." msgstr "Valor xeométrico non válido." msgid "Invalid geometry type." msgstr "Tipo xeométrico non válido." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Atopouse un erro mentras se trasnformaba a xeometría ó SRID do campo " "xeométrico do formulario." msgid "Delete all Features" msgstr "Eliminar tódalas Propiedades" msgid "WKT debugging window:" msgstr "Ventá de depurado de WKT:" msgid "Debugging window (serialized value)" msgstr "Ventá de depurado (valor serializado)" msgid "No feeds are registered." msgstr "Non hai feeds rexistradas." #, python-format msgid "Slug %r isn’t registered." msgstr "O slug %r non está rexistrado."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/gl/LC_MESSAGES/django.po
po
mit
2,298
# This file is distributed under the same license as the Django package. # # Translators: # Jannis Leidel <jannis@leidel.info>, 2011 # Meir Kriheli <mkriheli@gmail.com>, 2012,2014-2015,2020 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2020-08-02 13:28+0000\n" "Last-Translator: Meir Kriheli <mkriheli@gmail.com>\n" "Language-Team: Hebrew (http://www.transifex.com/django/django/language/he/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: he\n" "Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % " "1 == 0) ? 1: (n % 10 == 0 && n % 1 == 0 && n > 10) ? 2 : 3;\n" msgid "GIS" msgstr "מערכת מידע גאוגרפית" msgid "The base GIS field." msgstr "שדה GIS הבסיסי." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "שדה Geometry הבסיסי —ממופה לטיפוס OpenGIS Specification Geometry." msgid "Point" msgstr "נקודה" msgid "Line string" msgstr "מחרוזת קו" msgid "Polygon" msgstr "פוליגון" msgid "Multi-point" msgstr "מרובה־נקודות" msgid "Multi-line string" msgstr "מחרוזת קו מרובת שורות" msgid "Multi polygon" msgstr "פוליגון מרובה" msgid "Geometry collection" msgstr "אוסף גיאומטרי" msgid "Extent Aggregate Field" msgstr "שדה Extent Aggregate" msgid "Raster Field" msgstr "שדה Raster" msgid "No geometry value provided." msgstr "לא סופק ערך גיאומטרי." msgid "Invalid geometry value." msgstr "ערך גאומטרי שגוי." msgid "Invalid geometry type." msgstr "סוג גיאומטרי שגוי." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "הייתה בעיה עם השינוי של הצורה לסוג של השדה." msgid "Delete all Features" msgstr "מחיקת כל התכונות" msgid "WKT debugging window:" msgstr "חלון ניפוי שגיאות WKT:" msgid "Debugging window (serialized value)" msgstr "חלון ניפוי שגיאות (serialized value)" msgid "No feeds are registered." msgstr "לא נרשמו פידים." #, python-format msgid "Slug %r isn’t registered." msgstr "ה־Slug %r אינו רשום."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/he/LC_MESSAGES/django.po
po
mit
2,393
# This file is distributed under the same license as the Django package. # # Translators: # Chandan kumar <chandankumar.093047@gmail.com>, 2012 # Sandeep Satavlekar <sandysat@gmail.com>, 2011 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2017-09-19 16:40+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Hindi (http://www.transifex.com/django/django/language/hi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: hi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "" msgid "The base GIS field." msgstr "" msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "बिंदु" msgid "Line string" msgstr "पंक्ति शृंखला" msgid "Polygon" msgstr "बहुभुज" msgid "Multi-point" msgstr "बहु बिंदु" msgid "Multi-line string" msgstr "बहु - पंक्ति शृंखला" msgid "Multi polygon" msgstr "बहु बहुभुज" msgid "Geometry collection" msgstr "ज्यामिति संग्रह" msgid "Extent Aggregate Field" msgstr "" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "कोई ज्यामिति मूल्य प्रदान नहीं की है." msgid "Invalid geometry value." msgstr "अवैध ज्यामिति मूल्य." msgid "Invalid geometry type." msgstr "अवैध ज्यामिति प्रकार" msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "ज्यामिति को ज्यामिति प्रपत्र फ़ील्ड के SRID में परिवर्तित करते वक़्त एक ग़लती हो गयी ." msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "कोई फ़ीड पंजीकृत नहीं हैं." #, python-format msgid "Slug %r isn't registered." msgstr "स्लग %r पंजीकृत नहीं है."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/hi/LC_MESSAGES/django.po
po
mit
2,372
# This file is distributed under the same license as the Django package. # # Translators: # berislavlopac <berislav.lopac@gmail.com>, 2012 # Davor Lučić <r.dav.lc@gmail.com>, 2012 # Filip Cuk <filipcuk2@gmail.com>, 2016 # Jannis Leidel <jannis@leidel.info>, 2011 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2017-09-19 16:40+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Croatian (http://www.transifex.com/django/django/language/" "hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: hr\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" msgid "GIS" msgstr "" msgid "The base GIS field." msgstr "" msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "Točka" msgid "Line string" msgstr "Linija (Line string)" msgid "Polygon" msgstr "Poligon" msgid "Multi-point" msgstr "Više točaka" msgid "Multi-line string" msgstr "Više linija (Line string)" msgid "Multi polygon" msgstr "Više poligona" msgid "Geometry collection" msgstr "Geometrijska kolekcija" msgid "Extent Aggregate Field" msgstr "" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "Geometrijska vrijednost nije priložena." msgid "Invalid geometry value." msgstr "Neispravna geometrijska vrijednost." msgid "Invalid geometry type." msgstr "Neispravan geometrijski tip." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Došlo je do greške pri transformaciji geometrije na SRID geometrijskog polja " "forme." msgid "Delete all Features" msgstr "Izbriši sve značajke" msgid "WKT debugging window:" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "Nema registriranih izvora." #, python-format msgid "Slug %r isn't registered." msgstr "Slug %r nije registriran."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/hr/LC_MESSAGES/django.po
po
mit
2,132
# This file is distributed under the same license as the Django package. # # Translators: # Michael Wolf <milupo@sorbzilla.de>, 2016,2019 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2019-09-21 19:30+0000\n" "Last-Translator: Michael Wolf <milupo@sorbzilla.de>\n" "Language-Team: Upper Sorbian (http://www.transifex.com/django/django/" "language/hsb/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: hsb\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" "%100==4 ? 2 : 3);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "Bazowe polo GIS." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Bazowe geometrijowe polo -- zarysowane do geometrijoweho typa specifikacije " "OpenGIS. " msgid "Point" msgstr "Dypk" msgid "Line string" msgstr "Čara" msgid "Polygon" msgstr "Wjeleróžk" msgid "Multi-point" msgstr "Wjacore dypki" msgid "Multi-line string" msgstr "Wjacore čary" msgid "Multi polygon" msgstr "Wjacore wjelróžki" msgid "Geometry collection" msgstr "Geometrijowa zběrka" msgid "Extent Aggregate Field" msgstr "Polo „extent aggregate“" msgid "Raster Field" msgstr "Rasterowe polo" msgid "No geometry value provided." msgstr "Žana geometrijowa hódnota podata." msgid "Invalid geometry value." msgstr "Njepłaćiwa geometrijowa hódnota." msgid "Invalid geometry type." msgstr "Njepłaćiwy geometrijowy typ." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Zmylk je wustupił, hdyž so geometrija do SRID pola geometrijoweho formulara " "přetwori." msgid "Delete all Features" msgstr "Wšě funkcije zhašeć" msgid "WKT debugging window:" msgstr "Wokno pytanja zmylkow WKT:" msgid "Debugging window (serialized value)" msgstr "Wokno pytanja zmylkow (serijalizowana hódnota)" msgid "No feeds are registered." msgstr "Žane kanale zregistrowane." #, python-format msgid "Slug %r isn’t registered." msgstr "Adresowe mjeno %r njeje zregistrowane."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/hsb/LC_MESSAGES/django.po
po
mit
2,211
# This file is distributed under the same license as the Django package. # # Translators: # András Veres-Szentkirályi, 2016 # Istvan Farkas <istvan.farkas@gmail.com>, 2019 # Jannis Leidel <jannis@leidel.info>, 2011 # Kristóf Gruber <>, 2012 # Szilveszter Farkas <szilveszter.farkas@gmail.com>, 2011 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2019-11-18 10:14+0000\n" "Last-Translator: Istvan Farkas <istvan.farkas@gmail.com>\n" "Language-Team: Hungarian (http://www.transifex.com/django/django/language/" "hu/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: hu\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "Az alap GIS mező." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Az alap geometria mező - az OpenGIS Specification Geometry formátumnak " "megfelelően." msgid "Point" msgstr "Pont" msgid "Line string" msgstr "Vonallánc" msgid "Polygon" msgstr "Poligon" msgid "Multi-point" msgstr "Multi-pont" msgid "Multi-line string" msgstr "Többes vonallánc" msgid "Multi polygon" msgstr "Multi-poligon" msgid "Geometry collection" msgstr "Geometria gyűjtemény" msgid "Extent Aggregate Field" msgstr "Terület összegző mező" msgid "Raster Field" msgstr "Raszter mező" msgid "No geometry value provided." msgstr "Geometriai adat nem került megadásra." msgid "Invalid geometry value." msgstr "Érvénytelen geometriai érték." msgid "Invalid geometry type." msgstr "Érvénytelen geometriai típus." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "Hiba történt a geometriai transzformáció során." msgid "Delete all Features" msgstr "Minden Feature törlése" msgid "WKT debugging window:" msgstr "WKT debug ablak:" msgid "Debugging window (serialized value)" msgstr "Debug ablak (szerializált érték)" msgid "No feeds are registered." msgstr "Nincs regisztrált feed." #, python-format msgid "Slug %r isn’t registered." msgstr "A(z) %r domain-darabka nincs regisztrálva."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/hu/LC_MESSAGES/django.po
po
mit
2,261
# This file is distributed under the same license as the Django package. # # Translators: msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2018-11-01 20:36+0000\n" "Last-Translator: Ruben Harutyunov <rharutyunov@mail.ru>\n" "Language-Team: Armenian (http://www.transifex.com/django/django/language/" "hy/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: hy\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "ԱՏՀ" msgid "The base GIS field." msgstr "ԱՏՀ֊ի գլխավոր դաշտ" msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" "Հիմնական երկրաչափական դաշտը: Համապատասխանում է մուտքագրել OpenGIS " "սպեցիֆիկացիայի երկրաչափության տիպին։" msgid "Point" msgstr "Կետ" msgid "Line string" msgstr "Թեք" msgid "Polygon" msgstr "Բազմանկյուն" msgid "Multi-point" msgstr "Կետերի հավաքածու" msgid "Multi-line string" msgstr "Թեքերի հավաքածու" msgid "Multi polygon" msgstr "Բազմանկյունների հավաքածու" msgid "Geometry collection" msgstr "Երկրաչափական օբյեկտների հավաքածու" msgid "Extent Aggregate Field" msgstr "Մակերեսի կամ ծավալի խմբավորման դաշտ" msgid "Raster Field" msgstr "Պատկերացանցի դաշտ" msgid "No geometry value provided." msgstr "Երկարաչափական արժեք չի տրամադրվել։" msgid "Invalid geometry value." msgstr "Երկարաչափական օյբեկտի սխալ արժեք։" msgid "Invalid geometry type." msgstr "Երկարաչափական օյբեկտի տիպ։" msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "Երկարաչափական օյբեկտի SRID ձևափոխելու ժամանակ առաջացել է սխալլ։" msgid "Delete all Features" msgstr "Հեռացնել բոլոր օբյեկտները" msgid "WKT debugging window:" msgstr "WKT֊ի կարգաբերման պատուհան․" msgid "Debugging window (serialized value)" msgstr "Կարգաբերման պատուհան (սերիալիզացված արժեքներ)" msgid "No feeds are registered." msgstr "Չկան գրանցված feed֊եր։" #, python-format msgid "Slug %r isn't registered." msgstr "%r Slug֊ը գրանցված չէ։"
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/hy/LC_MESSAGES/django.po
po
mit
2,603
# This file is distributed under the same license as the Django package. # # Translators: # Martijn Dekker <mcdutchie@hotmail.com>, 2012,2016 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2017-09-19 16:40+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Interlingua (http://www.transifex.com/django/django/language/" "ia/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ia\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "" msgid "The base GIS field." msgstr "Le campo GIS de base." msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" "Le campo Geometry de base. Corresponde al typo geometric del specification " "OpenGIS." msgid "Point" msgstr "Puncto" msgid "Line string" msgstr "Texto de linea" msgid "Polygon" msgstr "Polygono" msgid "Multi-point" msgstr "Plure punctos" msgid "Multi-line string" msgstr "Texto con plure lineas" msgid "Multi polygon" msgstr "Plure polygonos" msgid "Geometry collection" msgstr "Collection geometric" msgid "Extent Aggregate Field" msgstr "" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "Nulle valor geometric fornite." msgid "Invalid geometry value." msgstr "Valor geometric invalide." msgid "Invalid geometry type." msgstr "Typo geometric invalide." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Un error occurreva durante le transformation del geometria al SRID del campo " "del formulario geometric." msgid "Delete all Features" msgstr "Deler tote le elementos" msgid "WKT debugging window:" msgstr "Fenestra pro debugging WKT:" msgid "Debugging window (serialized value)" msgstr "Fenestra pro debugging (valor serialisate)" msgid "No feeds are registered." msgstr "Nulle syndication es registrate." #, python-format msgid "Slug %r isn't registered." msgstr "Le denotation %r non es registrate."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/ia/LC_MESSAGES/django.po
po
mit
2,116
# This file is distributed under the same license as the Django package. # # Translators: # Fery Setiawan <gembelweb@gmail.com>, 2016 # Jannis Leidel <jannis@leidel.info>, 2011 # M Asep Indrayana <me@drayanaindra.com>, 2015 # rodin <romihardiyanto@gmail.com>, 2011-2012 # rodin <romihardiyanto@gmail.com>, 2015-2016 # sage <laymonage@gmail.com>, 2019 # Sutrisno Efendi <kangfend@gmail.com>, 2015 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2019-09-28 05:59+0000\n" "Last-Translator: sage <laymonage@gmail.com>\n" "Language-Team: Indonesian (http://www.transifex.com/django/django/language/" "id/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: id\n" "Plural-Forms: nplurals=1; plural=0;\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "Bidang GIS dasar." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Bidang Geometri dasar — memetakan ke jenis OpenGIS Specification Geometry." msgid "Point" msgstr "Point" msgid "Line string" msgstr "Line string" msgid "Polygon" msgstr "Polygon" msgid "Multi-point" msgstr "Multi-point" msgid "Multi-line string" msgstr "Multi-line string" msgid "Multi polygon" msgstr "Multi polygon" msgid "Geometry collection" msgstr "Geometry collection" msgid "Extent Aggregate Field" msgstr "perpanjang Bidang Pengumpulan" msgid "Raster Field" msgstr "Bidang Raster" msgid "No geometry value provided." msgstr "Nilai geometri tidak disediakan." msgid "Invalid geometry value." msgstr "Nilai geometri salah." msgid "Invalid geometry type." msgstr "Tipe geometri salah." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Galat terjadi saat mentransformasi geometri ke SRID bidang formulir geometri." msgid "Delete all Features" msgstr "Hapus semua Fitur" msgid "WKT debugging window:" msgstr "Jendela mencari dan memperbaiki kesalahan WKT:" msgid "Debugging window (serialized value)" msgstr "Jendela mencari dan memperbaiki kesalahan (nilai bersambung)" msgid "No feeds are registered." msgstr "Tidak ada umpan terdaftar." #, python-format msgid "Slug %r isn’t registered." msgstr "Slug %r tidak terdaftar."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/id/LC_MESSAGES/django.po
po
mit
2,353
# This file is distributed under the same license as the Django package. # # Translators: msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-03-18 09:16+0100\n" "PO-Revision-Date: 2015-03-18 08:35+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Ido (http://www.transifex.com/projects/p/django/language/" "io/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: io\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "" msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "" msgid "Line string" msgstr "" msgid "Polygon" msgstr "" msgid "Multi-point" msgstr "" msgid "Multi-line string" msgstr "" msgid "Multi polygon" msgstr "" msgid "Geometry collection" msgstr "" msgid "Extent Aggregate Field" msgstr "" msgid "No geometry value provided." msgstr "" msgid "Invalid geometry value." msgstr "" msgid "Invalid geometry type." msgstr "" msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Google Maps via GeoDjango" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "" #, python-format msgid "Slug %r isn't registered." msgstr ""
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/io/LC_MESSAGES/django.po
po
mit
1,472
# This file is distributed under the same license as the Django package. # # Translators: # Hafsteinn Einarsson <haffi67@gmail.com>, 2011-2012 # Jannis Leidel <jannis@leidel.info>, 2011 # Thordur Sigurdsson <thordur@ja.is>, 2019 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2019-11-20 05:37+0000\n" "Last-Translator: Thordur Sigurdsson <thordur@ja.is>\n" "Language-Team: Icelandic (http://www.transifex.com/django/django/language/" "is/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: is\n" "Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" msgid "GIS" msgstr "" msgid "The base GIS field." msgstr "" msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "Grunn GIS reitur — varpast í OpenGIS rúmgerð." msgid "Point" msgstr "Punktur" msgid "Line string" msgstr "Lína" msgid "Polygon" msgstr "Marghyrningur" msgid "Multi-point" msgstr "Punktar" msgid "Multi-line string" msgstr "Línur" msgid "Multi polygon" msgstr "Marghyrningar" msgid "Geometry collection" msgstr "Rúmsafn" msgid "Extent Aggregate Field" msgstr "" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "Ekkert rúmgildi gefið." msgid "Invalid geometry value." msgstr "Ógild rúmeining" msgid "Invalid geometry type." msgstr "Ógild rúmmálsgerð." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "Villa kom upp við að varpa rúmgildi í SRID reitsins." msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "Engir listar (feeds) eru skráðir" #, python-format msgid "Slug %r isn’t registered." msgstr ""
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/is/LC_MESSAGES/django.po
po
mit
1,934
# This file is distributed under the same license as the Django package. # # Translators: # yakky <i.spalletti@nephila.it>, 2015 # Jannis Leidel <jannis@leidel.info>, 2011 # Marco Bonetti, 2014 # Mirco Grillo <mirco.grillomg@gmail.com>, 2020 # Nicola Larosa <transifex@teknico.net>, 2012 # palmux <palmux@gmail.com>, 2015 # Mattia Procopio <promat85@gmail.com>, 2015 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2020-07-23 08:59+0000\n" "Last-Translator: Mirco Grillo <mirco.grillomg@gmail.com>\n" "Language-Team: Italian (http://www.transifex.com/django/django/language/" "it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "GIS" msgstr "GIS" msgid "The base GIS field." msgstr "Il campo GIS base." msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "" "Il campo Geometry -- corrisponde al tipo Geometry delle specifiche OpenGIS." msgid "Point" msgstr "Punto" msgid "Line string" msgstr "Stringa linea" msgid "Polygon" msgstr "Poligono" msgid "Multi-point" msgstr "Multipunto" msgid "Multi-line string" msgstr "Stringa multilinea" msgid "Multi polygon" msgstr "Multi poligono" msgid "Geometry collection" msgstr "Raccolta Geometry" msgid "Extent Aggregate Field" msgstr "Campo di aggregazione esteso" msgid "Raster Field" msgstr "Campo raster" msgid "No geometry value provided." msgstr "Nessun valore geometrico fornito." msgid "Invalid geometry value." msgstr "Valore geometrico non valido." msgid "Invalid geometry type." msgstr "Tipo geometrico non valido." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "Si è verificato un errore durante la trasformazione della geometria nello " "SRID del campo geometria della form." msgid "Delete all Features" msgstr "Cancella tutti gli oggetti" msgid "WKT debugging window:" msgstr "Finestra di debug WKT:" msgid "Debugging window (serialized value)" msgstr "Finestra di debug (valore serializzato)" msgid "No feeds are registered." msgstr "Non ci sono feed registrati." #, python-format msgid "Slug %r isn’t registered." msgstr "Lo slug %r non è registrato."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/it/LC_MESSAGES/django.po
po
mit
2,365
# This file is distributed under the same license as the Django package. # # Translators: # Jannis Leidel <jannis@leidel.info>, 2011 # Shinya Okano <tokibito@gmail.com>, 2012,2014-2015 # Takuya N <takninnovationresearch@gmail.com>, 2020 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-08 17:27+0200\n" "PO-Revision-Date: 2020-02-06 11:58+0000\n" "Last-Translator: Takuya N <takninnovationresearch@gmail.com>\n" "Language-Team: Japanese (http://www.transifex.com/django/django/language/" "ja/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" msgid "GIS" msgstr "地理情報システム" msgid "The base GIS field." msgstr "基底GISフィールド" msgid "" "The base Geometry field — maps to the OpenGIS Specification Geometry type." msgstr "基底GISフィールド — OpenGIS で決められた地形タイプに対応します。" msgid "Point" msgstr "点" msgid "Line string" msgstr "線" msgid "Polygon" msgstr "ポリゴン" msgid "Multi-point" msgstr "複数の点" msgid "Multi-line string" msgstr "複数の線" msgid "Multi polygon" msgstr "複数のポリゴン" msgid "Geometry collection" msgstr "地形の集合" msgid "Extent Aggregate Field" msgstr "広さ集計フィールド" msgid "Raster Field" msgstr "ラスターフィールド" msgid "No geometry value provided." msgstr "geometry値がありません。" msgid "Invalid geometry value." msgstr "geometry値が不正です" msgid "Invalid geometry type." msgstr "geometryタイプが不正です。" msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "" "geometry を geometry フォームフィールドの SRID に変換しようとしてエラーが起き" "ました。" msgid "Delete all Features" msgstr "すべての機能を削除" msgid "WKT debugging window:" msgstr "WKTデバッグウィンドウ:" msgid "Debugging window (serialized value)" msgstr "デバッグウィンドウ(シリアライズされた値)" msgid "No feeds are registered." msgstr "フィードが登録されていません。" #, python-format msgid "Slug %r isn’t registered." msgstr "スラグ %r は登録されていません。"
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/ja/LC_MESSAGES/django.po
po
mit
2,352
# This file is distributed under the same license as the Django package. # # Translators: # André Bouatchidzé <a@anbz.net>, 2013,2015 # avsd05 <avsd05@gmail.com>, 2011 # Jannis Leidel <jannis@leidel.info>, 2011 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2017-09-19 16:40+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Georgian (http://www.transifex.com/django/django/language/" "ka/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ka\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n" msgid "GIS" msgstr "" msgid "The base GIS field." msgstr "" msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "წერტილი" msgid "Line string" msgstr "ხაზის მასივი" msgid "Polygon" msgstr "მრავალკუთხედი" msgid "Multi-point" msgstr "წერტილების სიმრავლე" msgid "Multi-line string" msgstr "ხაზების სიმრავლის მასივი" msgid "Multi polygon" msgstr "მრავალკუთხედების სიმრავლე" msgid "Geometry collection" msgstr "გეომეტრიული კოლექცია" msgid "Extent Aggregate Field" msgstr "" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "გეომეტრიის მნიშვნელობა მოცემული არ არის." msgid "Invalid geometry value." msgstr "გეომეტრიის მნიშვნელობა არასწორია." msgid "Invalid geometry type." msgstr "გეომეტრიის ტიპი არასწორია." msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "ველიდან გეომეტრიის SRID-ში გადაყვანისას მოხდა შეცდომა." msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "არცერთი ფიდი არ არის რეგისტრირებული." #, python-format msgid "Slug %r isn't registered." msgstr "სლაგი %r არ არის რეგისტრირებული."
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/ka/LC_MESSAGES/django.po
po
mit
2,571
# This file is distributed under the same license as the Django package. # # Translators: # yun_man_ger <germanilyin@gmail.com>, 2011 # Zhazira <zhazira.mt@gmail.com>, 2011 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-19 16:49+0100\n" "PO-Revision-Date: 2017-09-19 16:40+0000\n" "Last-Translator: Jannis Leidel <jannis@leidel.info>\n" "Language-Team: Kazakh (http://www.transifex.com/django/django/language/kk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: kk\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n" msgid "GIS" msgstr "" msgid "The base GIS field." msgstr "" msgid "" "The base Geometry field -- maps to the OpenGIS Specification Geometry type." msgstr "" msgid "Point" msgstr "Нүкте" msgid "Line string" msgstr "Сынық" msgid "Polygon" msgstr "Көпбұрыш" msgid "Multi-point" msgstr "Нүкте жинағы" msgid "Multi-line string" msgstr "Сынықтар жинағы" msgid "Multi polygon" msgstr "Көпбұрыш жинағы" msgid "Geometry collection" msgstr "Геометриялық объект жинағы" msgid "Extent Aggregate Field" msgstr "" msgid "Raster Field" msgstr "" msgid "No geometry value provided." msgstr "Геметрия мәні берілген жоқ" msgid "Invalid geometry value." msgstr "Геометрия мәні дұрыс емес" msgid "Invalid geometry type." msgstr "Геометрия түрі дұрыс емес" msgid "" "An error occurred when transforming the geometry to the SRID of the geometry " "form field." msgstr "Геометрияны SRID-ге өзгерту кезінде қате шықты." msgid "Delete all Features" msgstr "" msgid "WKT debugging window:" msgstr "" msgid "Debugging window (serialized value)" msgstr "" msgid "No feeds are registered." msgstr "" #, python-format msgid "Slug %r isn't registered." msgstr ""
castiel248/Convert
Lib/site-packages/django/contrib/gis/locale/kk/LC_MESSAGES/django.po
po
mit
1,979