GispoCoding / tarmo

Tarmo - Tampere Mobilemap
https://ulkoilutampereenseutu.fi/
MIT License
11 stars 3 forks source link

Extent for data #29

Closed SannaJokela closed 2 years ago

SannaJokela commented 2 years ago

Tampere city region is the main area of interest, but there are some routes that are part of bigger routing system, so they should be taken into account.

Possible solutions:

To do:

karttasivu – 1

SannaJokela commented 2 years ago

@anniinakovalainen add mockup to this

SannaJokela commented 2 years ago

@Rikuoja added the mockup for this, but do you need a cookie cutter (layer with all the municipalities)? Or can you do this with this info? Problem might be that the routes that should be continuing over the border are not "intact" so that if we create a GIS overlay it just takes parts of the routes, but not all. If the Lipas-data has municipality info in all routes, then there could be some query for this (e.g. take all routes into account that are within these municipalities). One option is to create a municipality layer in the map view that "covers" the areas that are not wanted... So maybe at least 3 ways to do this.

SannaJokela commented 2 years ago

@anniinakovalainen ideas on how to do this?

anniinaiikkanen commented 2 years ago

@SannaJokela Hmm, I was wondering if the data extent could be determined in the database? I would do it like this: when the data is brought to the kooste database, it is clipped with the Tampere region. If this is done in the frontend, I have no solution other than a buffer (that has been done already). @Rikuoja might have some idea if the map of Tampere region could mask the data in the frontend?

SannaJokela commented 2 years ago

Joona comments: 3 options:

  1. this could be done in front side (mask) if we do not want to hard code it to the database. Inverted polygon type solution....
  2. More simple way to do in the database: materialized view with extent.
  3. OR: Pgtile serv supports functions, that takes certain parameters into account. This might be the best solution. This needs the extent polygon. https://github.com/CrunchyData/pg_tileserv#function-layers
Rikuoja commented 2 years ago

Won't be doing any of those. All of them require 1) importing all kaupunkiseudut data to the frontend or backend, and 2) having the huge polygon filter the data in the frontend or backend, and 3) creating either separate duplicate views for each table, or separate functions that cannot be implemented since we want to be able to use CQL for further filtering of the data.

Instead, use a simple CQL filter on the cityName field. The field is already in lipas and some other tables. So we just need to fill in this field in all tables, and everything will be fine and dandy. There are some data (notably OSM) that is only visible when we zoom in, and it doesn't really matter if we show that outside the cities in question.

The main thing is that the lipas points aren't shown beyond the Tampere region, and that's easy with no backend changes just by adding the CQL cityName filter.