Giter Club home page Giter Club logo

trails's People

Contributors

bendickens avatar elcok avatar tomalrussell avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tomalrussell

trails's Issues

ogr/gdal import fails

Depending on the GDAL version which is installed, the import statement for ogr and gdal (e.g. in extract.py) fails.
Recommened import from https://pypi.org/project/GDAL/ website:
from osgeo import gdal & from osgeo import ogr or

>>> try:
...     from osgeo import gdal
... except ImportError:
...     import gdal

Functions relying on shapely vs. pygeos geometries

I have come across a few instances where I was not sure about the required type of geometries, and / or whether this is consistent throughout the module.

For instance, the following function seems to take pygeos geometries from a network instance as inputs, but applies shapely interpolation functions:

trails/src/trails/simplify.py

Lines 1134 to 1144 in a89a1a9

def nearest_point_on_line(point, line):
"""Return the nearest point on a line
Args:
point (pygeos.geometry): [description]
line (pygeos.geometry): [description]
Returns:
[type]: [description]
"""
return line.interpolate(line.project(point))

For me, this returns a type error.
Replacing the statement by a pygeos analogon, e.g. return pygeos.linear.line_interpolate_point(line, pygeos.linear.line_locate_point(line, point)) passes, but leads to issues further down the road.

E.g., nearest_point_on_line is called by the following function:

def link_nodes_to_nearest_edge(network, condition=None):

When staying with pygeos geometries as proposed above, this fails at
line = LineString([node.geometry, point])
as the operation again requires shapely geometry objects.

I assume a network instance with shapely-based dataframes would work for this function combo, but not for others such as merge_multilinestrings or find_roundabouts, which explicitly apply pygeos functions.

Perhaps this is also intended, and the individual functions are not supposed to be taken out of a standard "work-flow"?

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.