Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PROJECT_EPSG #53

Open
minhhpham opened this issue Jul 15, 2018 · 3 comments
Open

PROJECT_EPSG #53

minhhpham opened this issue Jul 15, 2018 · 3 comments

Comments

@minhhpham
Copy link

Just a case study for the comment on line 10 of conf.py. I tried a non-UTM projections and got a weird problem. The coordinates that were fed into the database by using trip.Trip.save() are different from the coordinates that were retrieved by trip.Trip.fromDB(). The new coordinates put the vehicle in the ocean 😂. I changed to a UTM Projection and it works fine.

How about writing a warning in the comment?

@Nate-Wessel
Copy link
Contributor

Curious. What projection were you trying to use? Are you certain the projection in your config file matched the projection on your PostGIS tables?

@minhhpham
Copy link
Author

I was using 26759. I'm sure I used the same one in the tables and in the conf file.

@Nate-Wessel
Copy link
Contributor

I would expect confusion with some things because the unit for that projection appears to be feet (the configuration file talks about things being in meters and I'm not totally sure that assumption isn't hardcoded anywhere), but it still shouldn't end up with points displaced as far as I know.

The DB stores things in a local projection. When trips are pulled from the DB for (re)processing they get transformed to lon/lat (4326). Those points feed directly into OSRM which returns 4326 geometries as well. The match geometries are transformed by Python into the local projection which then gets stored in the DB alongside the original geometry.

If I understand what you're trying to do, you probably shouldn't ever actually be calling Trip.save() though. This is only for pulling points from the Nextbus API (and eventually other APIs) into the DB. Since you already have a DB, you would need to synthesize an HTTP API to use this, but I suspect it would be a lot easier for you to just format your data into a PostGIS DB and then use process.py.

Or were you toying around with the functions manually?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants