CityOfLosAngeles / aqueduct

A shared pipeline for building ETLs and batch jobs that we run at the City of LA for Data Science Projects. Built on Apache Airflow & Civis Platform
Apache License 2.0
21 stars 6 forks source link

LineStrings must contain at least two points #83

Open ian-r-rose opened 5 years ago

ian-r-rose commented 5 years ago

We are currently processing route GeoJSON into a LineString. If that GeoJSON contains a single point, we can create an invalid shape (c.f., the GeoJSON schema here, and seemingly the Geos spec somewhere).

We can catch this by filtering by ST_IsValid in our queries, but better to not have to do this.

ian-r-rose commented 5 years ago

cc @RMK0110

RMK0110 commented 4 years ago

You're referring to the process_route function in geom_parse.sql?

ian-r-rose commented 4 years ago

@RMK0110 Yes, that's right.

RMK0110 commented 4 years ago

@ian-r-rose Is there allowance in terms of consolidating the CREATE TABLE....trips_geos, CREATE FUNCTION...process_route and CREATE FUNCTION...geom_copy parts?

ian-r-rose commented 4 years ago

Are you asking about restructuring some of the functions? If so, feel free to take a crack at it and bring that to code review so we can discuss.

If it's a series of bigger changes, feel free to break them into multiple PRs that each express one idea.