Giter Club home page Giter Club logo

oswvalidators's Introduction

OpenSidewalks data schema, and its validators

This repository is created to perform validations on the geojson files provided against OpenSideWalks Schema.

Steps to run:

  1. Create a Virtual environment in Python
  2. Activate virtual environment
  3. Install the required packages to run the code

Using Pip

  1. virtualenv opensidewalk -p /usr/bin/python3.6
  2. source opensidewalk/bin/activate
  3. pip3 install -r pip_reqs.txt

Using Conda Distribution

  1. conda create -n opensidewalk python=3.8
  2. conda activate opensidewalk
  3. conda install --file conda_reqs.txt
  4. pip install -r conda_pip_reqs.txt
How to run the code:

python main.py --inputPath <<input folder>> --writePath <<Output Directory to Write To>>

Example:

python main.py --inputPath TestData/input --writePath TestData/Output

Expected Input:

Input folder should contain nodes, and ways files belonging to a region with the same prefix. For example:

FileName Data it should contain
1. Redmond_nodes.geojson Contains all the points in that region
2. Redmond_ways.geojson Contains all the ways in that region
Output:

The program writes the following files in the output folder

FileName Data it contains
1. Redmond_nodes_valid.geojson All the points in the region that adhere to OSW Schema
2. Redmond_ways_valid.geojson All the ways in the region that are in accordance with OSW schema
3. Redmond_nodes_invalid.geojson All the points in the region that do NOT adhere to OSW schema
4. Redmond_ways_invalid.geojson All the ways in the region that do NOT adhere to OSW schema
5. Redmond_ways_Missing_Intersection.geojson Shows the ways that are probably intersecting but don't have a intersecting node
6. Redmond_ways_recommended_Intersection.geojson Recommended Potential Intersecting points for the ways in Missing_Intersection.geojson
7. Redmond_ways_connected.geojson All the ways that are connected to atleast one another way
8. Redmond_ways_isolated.geojson Ways that are not connected to any other ways
9. Redmond_ways_subgraph_*.geojson Shows a connected island of the region given
How to use the output files:

For the invalid files, please look at the tag "fixme" in them to know what is the possible reason for the point or way being invalidated and take the necessary action to fix them.

Load Missing_Intersection file in QGIS to see the ways that are potentially intersecting but don't have an intersecting node.
Load Recommended_Intersection file on top of Missing_Intersection files to see recommended intersection points.

How to file issues:

Please open a GitHub issue for any for any bugs/requested features. For each issue, please provide:

  • Branch commit your code is based on. This could be done in a couple of ways: -- pick the 'commit' tag from the first line of the command 'git log' -- If the code you're working on is based on a release tag, provide the release tag
  • Provide potential test input files you used while running the code

oswvalidators's People

Contributors

devalapr avatar karthikkadajji avatar rtgunti avatar sureshgaussian avatar rdevalap avatar alishahusain avatar

Stargazers

Molly Beach avatar

Watchers

 avatar  avatar

Forkers

uwtcat

oswvalidators's Issues

Add a file to generate_schema

Schema is being created manually from OSW_Tags
This is updated according to the requirements. Write a script to generate the schema automatically from the sheet.

intersectingValidation results in IndexError: list index out of range error

Running the following line on multiple different test cases results in an Index Error
python main.py --inputPath TestData/Test2/input --writePath TestData/Test2/output

Output:

Reading files from : TestData/Test2/input
Number of geojson files : 2
Processing the following files :
bell_Node.geojson
bell_Ways.geojson
ways_file split into bell_Ways_connected.geojson and bell_Ways_isolated.geojson
number of ways in the currrent file : 316

Checking whether there are any Ways without an intersecting node

[==================== ] 78% Traceback (most recent call last):
File "main.py", line 47, in
intersectLineStringInValidFormat(utildOriginal.ways_json, "brunnel", cf, ntpath.basename(ways_file))
File "/home/alisha/oswvalidators/intersectingValidation.py", line 149, in intersectLineStringInValidFormat
{"type": "Feature", "geometry": {"type": "Point", "coordinates": appendPoints[0]}})
IndexError: list index out of range

Expected Output:

Number of geojson files :
Processing the following files:
ways_file split into xxx_Ways_connected.geojson and xxx_Ways_isolated.geojson
number of ways in the currrent file : 108

Checking whether there are any Ways without an intersecting node

[==========================] 100%

eda

Number of ways in the file : 108
Number of Subgraphs/islands : 19
Number of ways not connected to any other way: 0
Number of ways that are connected to atleast one other way: 108
Number of ways in subgraph 0: 3
Number of ways in subgraph 1: 3
Number of ways in subgraph 2: 2
Number of ways in subgraph 3: 2
Number of ways in subgraph 4: 14
Number of ways in subgraph 5: 2
Number of ways in subgraph 6: 2
Number of ways in subgraph 7: 2
Number of ways in subgraph 8: 3
Number of ways in subgraph 9: 54
Number of ways in subgraph 10: 6
Number of ways in subgraph 11: 5
Number of ways in subgraph 12: 5
Number of ways in subgraph 13: 3
Number of ways in subgraph 14: 2
Number of ways in subgraph 15: 2
Number of ways in subgraph 16: 2
Number of ways in subgraph 17: 2
Number of ways in subgraph 18: 2

As a result of this error, no "recommended_intersections.geojson", "missing_intersections.geojson", or "subgraph.geojson" files are produced in the output.

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.