EssBee59 left a comment (osm2pgsql-dev/osm2pgsql#2274)
Hello,
I liked to be able to define a column in a table giving the ratio "cartesian
distance" / "real = spheroid distance" on a GIS object.
My use case:
Based on OSM + 0sm2pgsql I calculate "global" pseudo-tags for a bike-routing
project.
This is very fast using srid 3857, but n some situations distances have to be
corrected depending on the latitude.
- I tested using geography type (works well with osm2pgsql!) but the
computing-times are at least 10 higher
- So in Postgis I currently add manually a column a.e. in the lines table with
this code:
...........................
select
osm_id, highway, maxspeed, way, waterway, li.natural, width, oneway,
st_length(way) / st_length(ST_Transform(way,4326)::geography) as merca_coef
into table lines_bis
from lines li;
select now();
drop table lines;
alter table lines_bis rename to lines;
create index lines_osm_id_idx on lines(osm_id) WITH (fillfactor='100');
CREATE INDEX lines_way_idx ON public.lines USING gist (way) WITH
(fillfactor='100');
analyze lines;
....................................
by need, the column merca_coef is then used in the sql´s, very much faster as
working in geography mode.
(distance-real = distance(3857) / merca_coef)
Could it become possible to add on a way clolumn an associated "merca_coef"?
Thank for the very good programm and regards
--
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/issues/2274#issuecomment-2729032628
You are receiving this because you are subscribed to this thread.
Message ID: <osm2pgsql-dev/osm2pgsql/issues/2274/[email protected]>
_______________________________________________
Tile-serving mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/tile-serving