[postgis-users] Cast geometry as geography

Paul Ramsey pramsey at opengeo.org
Mon Jun 20 09:34:19 PDT 2011


Can you reduce this to a smaller example? a couple geometries (or one)
that displays this behavior? It's a bug.

P

On Mon, Jun 20, 2011 at 12:48 AM, Andreas Forø Tollefsen
<andreasft at gmail.com> wrote:
> Hi.
> I want to measure the length of lines within polygons in km and not in dd.
>
> Why can't I cast this as geography to get length in km? I get this error:
>
> ERROR:  gbox_overlaps: geometries have mismatched dimensionality
>
> ********** Error **********
>
> ERROR: gbox_overlaps: geometries have mismatched dimensionality
> SQL state: XX000
>
>
> I also tried to ST_Transform into Eckert VI, but it has been running
> for 50 hours++ without a result.
> Here is my query with cast as geography:
>
> DROP TABLE IF EXISTS v0map_rd_length;
> SELECT priogrid_land.gid, priogrid_land.cell,
> SUM(ST_Length(ST_Intersection(v0map_rd.geom::geography,
> priogrid_land.cell::geography)))/1000 as length_km
> INTO v0map_rd_length
> FROM priogrid_land, v0map_rd
> WHERE ST_Intersects(v0map_rd.geom::geography, priogrid_land.cell::geography)
> GROUP BY priogrid_land.gid, priogrid_land.cell
> ;
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



More information about the postgis-users mailing list