23.05.2016       Выпуск 127 (23.05.2016 - 29.05.2016)       Интересные проекты, инструменты, библиотеки

gjtk - GeoJSON ToolKit

Читать>>




Экспериментальная функция:

Ниже вы видите текст статьи по ссылке. По нему можно быстро понять ссылка достойна прочтения или нет

Просим обратить внимание, что текст по ссылке и здесь может не совпадать.

gjtk 3.0.0

GeoJSON ToolKit

gjtkis a library for working with GeoJSON. It aims to be as compliant with the specification (soon standard, hopefully) as possible.

Installation

gjtkis available on PyPI.

pip install gjtk

Modules

gjtk.extract

MethodDescription
positions_of(geojson)returns all the Positions in a valid GeoJSON object
features_of(geojson)returns all the Features in a valid GeoJSON object
geometries_of(geojson)returns all the Geometries in a valid GeoJSON object

gjtk.generate

MethodDescription
point(position)returns a valid Point
multi_point(coordinates)returns a valid MultiPoint
line_string(coordinates)returns a valid LineString
multi_line_string(coordinates)returns a valid MultiLineString
polygon(coordinates)returns a valid Polygon
multi_polygon(coordinates)returns a valid MultiPolygon
geometry_collection(geometries)returns a valid GeometryCollection
feature(geometry, properties)returns a valid Feature
feature_collection(features)returns a valid FeatureCollection

gjtk.random

MethodDescription
position(max_numbers=3, min_numbers=2)returns a random Position
point_coordinates()returns random Point coordinates
multi_point_coordinates(max_positions=6, min_positions=0)returns random MultiPoint coordinates
line_string_coordinates(max_positions=6, min_positions=2)returns random LineString coordinates
linear_ring_coordinates()returns random LinearRing coordinates
multi_line_string_coordinates(max_line_strings=6, min_line_strings=1)returns random MultiLineString coordinates
polygon_coordinates()returns random Polygon coordinates
multi_polygon_coordinates(max_polygons=6, min_polygons=1)returns random MultiPolygon coordinates
geometry()returns a random Geometry
point()returns a random Point
multi_point()returns a random MultiPoint
line_string()returns a random LineString
multi_line_string()returns a random MultiLineString
polygon()returns a random Polygon
multi_polygon()returns a random MultiPolygon
geometry_collection(max_geometries=3, min_geometries=0)returns a random GeometryCollection
feature()returns a random Feature
feature_collection(max_features=3, min_features=0)returns a random FeatureCollection
crs()returns a random CRS
link()returns a random Link
bbox(max_dimensions=4, min_dimensions=2)returns a random Bbox

gjtk.validate

MethodDescription
is_geojson(anything)returnsTruewhen passed a valid GeoJSON object, otherwiseFalse
is_geometry(anything)returnsTruewhen passed a valid Geometry, otherwiseFalse
is_position(anything)returnsTruewhen passed a valid Position, otherwiseFalse
is_point_coordinates(anything)returnsTruewhen passed valid Point coordinates, otherwiseFalse
is_multi_point_coordinates(anything)returnsTruewhen passed valid MultiPoint coordinates, otherwiseFalse
is_line_string_coordinates(anything)returnsTruewhen passed valid LineString coordinates, otherwiseFalse
is_linear_ring_coordinates(anything)returnsTruewhen passed valid LinearRing coordinates, otherwiseFalse
is_multi_line_string_coordinates(anything)returnsTruewhen passed valid MultiLineString coordinates, otherwiseFalse
is_polygon_coordinates(anything)returnsTruewhen passed valid Polygon coordinates, otherwiseFalse
is_multi_polygon_coordinates(anything)returnsTruewhen passed valid MultiPolygon coordinates, otherwiseFalse
is_point(anything)returnsTruewhen passed a valid Point, otherwiseFalse
is_multi_point(anything)returnsTruewhen passed a valid MultiPoint, otherwiseFalse
is_line_string(anything)returnsTruewhen passed a valid LineString, otherwiseFalse
is_multi_line_string(anything)returnsTruewhen passed a valid MultiLineString, otherwiseFalse
is_polygon(anything)returnsTruewhen passed a valid Polygon, otherwiseFalse
is_multi_polygon(anything)returnsTruewhen passed a valid MultiPolygon, otherwiseFalse
is_geometry_collection(anything)returnsTruewhen passed a valid GeometryCollection, otherwiseFalse
is_feature(anything)returnsTruewhen passed a valid Feature, otherwiseFalse
is_feature_collection(anything)returnsTruewhen passed a valid Feature Collection, otherwiseFalse
is_crs(anything)returnsTruewhen passed a valid CRS, otherwiseFalse
has_crs(anything)returnsTruewhen passed a GeoJSON object that validly specifies a CRS, otherwiseFalse
is_link(anything)returnsTruewhen passed a valid Link, otherwiseFalse
is_bbox(anything)returnsTruewhen passed a valid Bbox, otherwiseFalse
has_bbox(anything)returnsTruewhen passed a GeoJSON object that validly specifies a Bbox, otherwiseFalse
equal_positions(position1, position2)returnsTruewhen all parameters are identical Positions, otherwiseFalse
contained_polygon(innerLinearRing, outerLinearRing)returnsTruewhen one LinearRing contains another, otherwiseFalse

License

Copyright (C) 2016 David Tucker

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

 





Разместим вашу рекламу

Пиши: mail@pythondigest.ru

Нашли опечатку?

Выделите фрагмент и отправьте нажатием Ctrl+Enter.

Система Orphus