-
In some scenarios it is not possible to create a polygon (when e.g. the way has less than 4 points). But I still want to obtain the centroid. In the documentation it is stated, that this only works with polygons/multipolygons. I gave it a shot and anyways, it is possible to obtain a centroid from linestrings like I tried to convert the geometry into a single point via |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Lets try to unpack this:
I think we should probably add (4). This would at least allow you to do whatever you want to do, although it is a bit annoying that you have to try We are already thinking about how to fix (5). There will be some way of accessing single member geometries of relations directly. (And we should probably also add an |
Beta Was this translation helpful? Give feedback.
-
Sorry for my bad explanation yesterday. I was rethinking today, and maybe I can give you a complete picture. The spatial function set of this library is very limited, compared to PostGIS. This is completely fine, as this library has another use case. However, it trapped me in thinking I can replace this library now with PostGIS... After further investigations today, I also need to use PostGIS's In fact, I want to have four tables:
In my case I don't care if it is a relation, way or node. A way can be a polygon ( osm2pgsql is very oriented on node/way/relation structure and is restricting access to e.g. Is there a way to do what I want without having a lot of intermediate tables and disk usage? I was thinking (as I use triggers anyway, to push all geom as So I think my demand with the centroid processing was just a side effect of an incomplete plan. You have to decide, if you want to investigate this further. Can you give me a suggestion on how to approach my import? Edit: mhm, maybe I could just create two dummy tables for ways and relations and use them just to get the data to insert them via trigger into other tables after processing (and prevent the actual ibsert). However, im not sure how compatible this is with the replication... Does the replication actually check for existance of records via id? I havent really looked into that. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
centroid()
is now implemented for all geometry types and so documented.