-
Notifications
You must be signed in to change notification settings - Fork 26
Create geometry fields with line/point data for GIS applications #44
Comments
I think this is a good idea. Can you explain where in the schema you may like to put these fields (eg, what table, or a new table?). And what is your reasoning - to use Postgres to the best of its ability with the its geom capabilities? |
Maybe just having the column populate geometry in the the 'coordinate' table in a WGS84 SRID would work best? I don't really have a specific answer or solution. Being able to join tables without creating a column each time is what kind of result I was looking for. And if there's a way to pull this into QGIS without creating a geometry column that would work as well. |
Here is a high-level proposal of what we were thinking would add value to the Waze WARP product. Currently, WARP populates tables with latitude and longitude in double precision fields for points under the coordinates table. It also uses a json data type in the 'line' column in the 'jams' table. The result we're looking for is to pull these tables into QGIS or ArcGIS. In order to pull these tables, they need to read from a geom column.
From here anyone could pull data directly into these programs or publish the layers to a service. |
I think we are going to go with geom_line in 'jams' and geom_point in 'alerts'. @CentennialCo Can you enumerate here the SQL code for
|
Both of these are going to have extra columns, but it's basically taking the coordinates and converting them to a geometry. Here is the query for points. I tried to Bold what is important. DROP TABLE IF EXISTS waze.wazecombine; |
For the Create Table part, I'd like to see how you would create it on its own, not connected to other tables or data from other tables. Eg:
For updating, I see now that something like this has been depreciated for editing a table structure for geometry:
in favor of:
Bottom line, thanks, this is good! |
For Alerts I can do this (I think, not connected to DB now):
How do you do that for Jams and linestring? Is this too complex?
|
This is added for the Jams, Alerts, and Coordinates table in latest code. |
Is there a way to update a geometry column where there are lat/long columns? I would like to put it into a view and can't use UPDATE in it. Here's what I run manually to create the Geom field in a new column.
The text was updated successfully, but these errors were encountered: