Skip to main content

Plugin to implement Geoalchemy fields in Flask Appbuilder

Project description

THIS PACKAGE HAS BEEN DEPRECATED.

In order to use the proper flask appbuilder addon infrastructure, this package has been deprecated in favor of flask-addon-geoalchemy. This package won’t be updated.

fab_geoalchemy

Implementation of GeoAlchemy fields for Flask Appbuilder.

It automatically transforms POINT Geometry columns to widgets with a field for latitude and longitude. The goal is to add a leaflet widget and add support for line and polygon as well.

Installation

Run pip install fab-geoalchemy.

Usage

You can find examples in the unittests in the tests folder. But in short, this is what you need to do:

from fab_geoalchemy.views import GeoModelView
from fab_geoalchemy.interface import GeoSQLAInterface

class Observation(Model):
    id = Column(Integer, primary_key=True)
    name = Column(String)
    location = Column(Geometry(geometry_type='POINT', srid=4326))

    def __repr__(self):
        if self.name:
            return self.name
        else:
            return 'Person Type %s' % self.id


class ObservationView(GeoModelView):
    datamodel = GeoSQLAInterface(Observation)
    add_columns = ['name', 'location']

This will automatically create the LatLonWidget in the form, and process the data to transform the latitude and longitude values into a point geometry in the database. The srid form the column is used by the field for the conversion of the text coordinates to the geometry. No validation is done if the entered coordinates are actually valid for the specified SRID.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fab_geoalchemy-0.1.6.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

fab_geoalchemy-0.1.6-py3.5.egg (12.6 kB view details)

Uploaded Source

File details

Details for the file fab_geoalchemy-0.1.6.tar.gz.

File metadata

  • Download URL: fab_geoalchemy-0.1.6.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.0 CPython/3.5.2

File hashes

Hashes for fab_geoalchemy-0.1.6.tar.gz
Algorithm Hash digest
SHA256 3e966f903e231d0b16c7f6a75df3954477dcd0a748fb16028376ddf56cd0fc38
MD5 3dd150f0d36c82ae2ad89cc7153c5279
BLAKE2b-256 351d81c5e6076bccffcc0d218e117345cefcd39734c35750acf029a14e5c5a2d

See more details on using hashes here.

File details

Details for the file fab_geoalchemy-0.1.6-py3.5.egg.

File metadata

  • Download URL: fab_geoalchemy-0.1.6-py3.5.egg
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.0 CPython/3.5.2

File hashes

Hashes for fab_geoalchemy-0.1.6-py3.5.egg
Algorithm Hash digest
SHA256 7f966b36971ab91973ac5b609ce181af26f4305c6508501ee0853972be620817
MD5 32bc3e46c617e2b300516d3ab4a45cbc
BLAKE2b-256 9a9652888168a6b097b60a36e104df08b98c29f61d2e1e84adafee53f1ee0f91

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page