-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Create new DB table to store 'new' and 'bad' geoms #1986
Comments
@spwoodcock This approach of storing bad geometries on a new table would also ease the effort on the frontend in pulsing the bad entities right #1975? Currently, on PR #2018, I have added another flatgeobuf layer passing the project extent and then filtering the features based on the entity status. This approach might be resource-extensive for low-end devices and makes the UI a bit laggy (especially management frontend) due to the constant fetch of the fgb URL. |
The approach you took is nice & more calls to the fgb file isn't a huge problem. This db table will be required for the newly added geoms though, as we can't update the fgb file every time. So if we have the table there anyway, it makes sense too also add the 'bad' geoms to it too. Then we can display as a layer on top of all the others, ignoring the task area filtering |
Plus also note the database table allows for the realtime update / loading bad geoms in the mapper frontend to be re-mapped immediately by the mapper still in the field. (the fgb would require refresh via an API call, likely a page refresh) |
The where clause in electric SQL doesn't support columns of the enum type. So I think we need to convert the type of column. I looked on electric SQL docs and couldn't find any solution. CC: @spwoodcock , @Sujanadh |
Damn! That's useful info (electric has a few limitations for SQL currently). Hopefully its fine to load all geoms without a where clause, as the table should only have new and bad geoms. They could then be filtered to separate the 'new' geoms from the 'bad' geoms |
The geom is being returned in wkb format. Sujan and I looked possibilities if we can convert geojson from the wkb format. But didn' t found the solution. Any suggestions @spwoodcock ? |
I think you mentioned about using pglite to sync database with our main db, if we could sync db/electric migrate then we could use postgis function to get geojson directly from sql. Something like this? const db = initDb;
async function getGeoJSON() {
const query = ` SELECT id, ST_AsGeoJSON(ST_GeomFromWKB(wkb_column)) AS geojson FROM geometrylog; `;
const results = await db.query(query);
return results.rows; // Each row will have id and geojson
} |
Unfortunately those PostGIS won't be available in PGLite yet 😅 (maybe in time) The only solutions are:
|
I think the field types for the geometrylog table should be updated with a migration: id --> UUID |
@spwoodcock we want to show the entity pulse effect on the management frontend as well. So since we don't have a get API for retrieving the bad geoms, what shall be the next step?
|
An API endpoint 👍 We want to avoid adding electric to the React frontend probably (for now) |
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Describe alternatives you've considered
The text was updated successfully, but these errors were encountered: