Giter VIP home page Giter VIP logo

pygeopkg's People

Contributors

dafvid avatar jennstill avatar jlhumber avatar nbw-iii avatar ropable avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pygeopkg's Issues

Issue with datetime fields

I've searched the main README for instructions on creating datetime fields, but unless there are other docs somewhere, I can't seem to find a solution for this. It seems that providing a SQLFieldTypes.datetime as the type for a field causes an error:

from pygeopkg.core.geopkg import GeoPackage
from pygeopkg.core.srs import SRS
from pygeopkg.core.field import Field
from pygeopkg.shared.enumeration import GeometryType, SQLFieldTypes
import pathlib

gpkg = GeoPackage.create(pathlib.Path.home().joinpath("test_datetime.gpkg"))
srs_wkt = 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433],AUTHORITY["EPSG",4326]]'
srs = SRS("WGS84", "EPSG", 4326, srs_wkt)
fields = (
    Field('int_fld', SQLFieldTypes.integer),
    Field('date_fld', SQLFieldTypes.date),
    Field('datetime_fld', SQLFieldTypes.datetime)
)
fc = gpkg.create_feature_class(
    "test",
    srs,
    fields=fields,
    shape_type=GeometryType.point
)

This throws the following error:

Traceback (most recent call last):
  File "C:\temp\.venv\lib\site-packages\IPython\core\interactiveshell.py", line 3397, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-5-4e68b047d91e>", line 14, in <cell line: 14>
    fc = gpkg.create_feature_class(
  File "C:\temp\.venv\lib\site-packages\pygeopkg\core\geopkg.py", line 171, in create_feature_class
    self._create_feature_table(name, shape_type, fields)
  File "C:\temp\.venv\lib\site-packages\pygeopkg\core\geopkg.py", line 196, in _create_feature_table
    connection_execute(self.full_path, sql)
  File "C:\temp\.venv\lib\site-packages\pygeopkg\core\utils.py", line 30, in connection_execute
    result = conn.execute(sql)
sqlite3.OperationalError: near "(": syntax error

Dropping that SQLFieldTypes.datetime field, though, and everything works like a charm.

Am I just missing something like an argument for that datetime format?

Add gpkg_ogr_contents table with feature count

Currently, the generated geopackage does not contain feature counts in the gpkg_ogr_contents table (https://gdal.org/drivers/vector/gpkg.html#dataset-creation-options).

This means that if we are writing to an existing geopackage generated with e.g. QGIS, the feature counts for layers will not be updated and QGIS will show old feature counts. Also, QGIS cannot correct this any more. Probably triggers that update feature counts in this table are also missing.

Tiles support?

Question: Is it planned to support GeoPackage Tiles in the near future?

Currently, I am writing two OGC draft GeoPackage extension standards. One for Features and one for Tiles. Milestone for RFC is September 2022.

To generate GeoPackage instance files for compliance testing, I am looking for an easy to use library. Looking at this library, it looks promising for the Features extension. But, there is no Tiles support :-(

It would be great to see the Tiles support in the near future. Possible?

Best
Andreas

Request: package the project and publish to the Python Package Index

I've found this project to be extremely useful in several projects that I maintain for my organisation. At present I generally use pygeopkg in those projects by adding it as a Git submodule; however it seems like it would be relatively straightforward to package and publish it to Pypi (I note that the pygeopkg namespace is unused).

Is this something that the maintainers would be interested in, or alternatively something that would be welcomed as a pull request? I'd be happy to do so, having packaged a couple of other simple projects in the past.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.