Git Product home page Git Product logo

pycql's Introduction

geopython

Vanity package for geopython projects

pip install geopython
>>> import geopython

pycql's People

Contributors

bitner avatar constantinius avatar tomkralidis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pycql's Issues

Transition to `pygeofilters`

pycql originally only supports the old CSW CQL dialect. But more filter languages/dialects exist:

As all these filter languages offer more or less the same functionality, it is envisioned to

  • Create a new python package (in favor of renaming this package): pygeofilters where most of the pycql source code will be copied to
  • Update the AST to accommodate the features of all languages/dialects (potentially with type-checks via pydantic)
  • Implement the parsers for each language encoding/dialect

When this is done, this git repository shall be archived and redirect to pygeofilters

lextab warning on parsing into AST

Running the following:

from pycql.integrations.sqlalchemy import to_filter, parse

cql_text = 'title = "foo"'
ast = parse(cql_text)

Results in the following warning:

WARNING: Couldn't write lextab module 'lextab'. [Errno 20] Not a directory: '/Users/tkralidi/Dev/pycsw/lib/python3.7/site-packages/pycql-0.0.8-py3.7.egg/pycql/lextab.py'

BBOX parser not conforming to specs

The parser for BBOX demands a CRS, while in the ECQL specification this is optional:

BBOX ( Expression , Number , Number , Number , Number [ , CRS ] )

E.g. this works: BBOX(geometry,13,48,14,49,"EPSG:4326")
while this throws an error: BBOX(geometry,13,48,14,49) although it is valid according to specs.

Error: Syntax error at token RPAREN ) 25 1

pycql should not demand a CRS.

properties with dashes are interpreted as operators

In OGC API - Records, some properties contain dashes (record-created, record-updated, keywords-codespace, etc.). The following CQL:

record-updated < "2000"

results in the following error:

  File "/Users/tkralidi/Dev/pycsw/lib/python3.7/site-packages/pycql-0.0.8-py3.7.egg/pycql/integrations/sqlalchemy/evaluate.py", line 102, in to_filter
    return FilterEvaluator(field_mapping).to_filter(ast)
  File "/Users/tkralidi/Dev/pycsw/lib/python3.7/site-packages/pycql-0.0.8-py3.7.egg/pycql/integrations/sqlalchemy/evaluate.py", line 33, in to_filter
    to_filter(node.lhs), to_filter(node.rhs), node.op,
  File "/Users/tkralidi/Dev/pycsw/lib/python3.7/site-packages/pycql-0.0.8-py3.7.egg/pycql/integrations/sqlalchemy/evaluate.py", line 85, in to_filter
    to_filter(node.lhs), to_filter(node.rhs), node.op
  File "/Users/tkralidi/Dev/pycsw/lib/python3.7/site-packages/pycql-0.0.8-py3.7.egg/pycql/integrations/sqlalchemy/filters.py", line 103, in runop
    return _op.function(lhs, rhs)
  File "/Users/tkralidi/Dev/pycsw/lib/python3.7/site-packages/pycql-0.0.8-py3.7.egg/pycql/integrations/sqlalchemy/filters.py", line 49, in <lambda>
    "-": lambda f, a: f - a,
TypeError: unsupported operand type(s) for -: 'str' and 'str'

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.