karsten | 22 May 2013 22:18

create 10m buffer using input data in EPSG4326

Greetings, I am working on creating 10m buffers around roads:
 
SELECT 10 AS score, ST_Difference(
 ST_Union(ST_Buffer(roads.the_geom, 10)),
 ST_Union(ST_Buffer(roads.the_geom, 0))
 )
AS the_geom
FROM geodata.roads2012_ca roads
GROUP BY score
 
So far I have the roads in dd (EPSG 4326) and was wondering how I could pass the distances in meters into the buffer function (without necessarily creating a new column with projected geometries). I guess could use some geography data type function .. but how ?
 
Thanks
Karsten

Karsten Vennemann
Principal

Terra GIS LTD
2119 Boyer Ave E
Seattle, WA  98112
USA 
www.terragis.net

Phone ++1 206 905 1711
Fax      ++1 925 905 1711

 
_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Cedric Duprez | 21 May 2013 18:55
Picon
Favicon

Area of non-intersecting parts of layers

Hi all,

 

I have 2 layers composed of multipolygons in Postgis 2.0. Each layer contains polygons with a name that is sometime common to several polygons.

When I try to find area of intersections between the 2 layers, no problem with the following query:

SELECT l1.name1, l2.name2, SUM(ST_Area(ST_Intersection(l1.geom, l2.geom))) / 10000 AS surface_ha

FROM layer1 l1

INNER JOIN layer2 l2 ON ST_Intersects(l1.geom, l2.geom)

GROUP BY 1, 2

ORDER BY 1, 2;

 

OK.

But I also try to get the area of my layer1 (grouped by name1) that does not contain elements of my layer2.

 

I tried with LEFT JOIN, with ST_CONTAINS, without success.

 

Does anyone have an idea on how to write this query?

 

Thanks in advance,

 

Cedric Duprez

_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Pietro Rossin | 21 May 2013 14:13
Picon

permission denied for relation geometry_columns on postgis 2.x

Hello all
how can I solve this problem?
With postgres user no problem (of course), but I made a gisadmin user which
I thought I gave enough grants..
geometry_columns with postgis 2.x is not a table but a view that, if I'm not
wrong, is updated by some trigger/function

How can I make it usable/selectable by users?

Thanks
Pietro

--
View this message in context: http://postgis.17.x6.nabble.com/permission-denied-for-relation-geometry-columns-on-postgis-2-x-tp5003338.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
Hugues François | 20 May 2013 14:23
Picon
Favicon

Shp2pgsql : Error in fread()

Hello,

I have a big amount of data to import ins postgis from shapefile (18.000.000 of squares). As usual, I used
shp2pgsql to do that with this command line : shp2pgsql -s 2154 -g geom -W LATIN1 -I /home/myhome/shpname myschema.shpname.

But for each of my file (there are four of them) it throw me the same error :
Error in fread() reading object of size 136 at offset 2147483756 from .shp file
Error reading shape object 15790321

In each of the four file the error happens to the same time / object.

Where did I make a mistake and how can I correct it ?

I found this related info : http://trac.osgeo.org/gdal/ticket/4203

But the answer don't really help me to find any solution... Is anyone there having an idea please ?

Hugues.
Eva Linhartová | 19 May 2013 19:49
Picon

toTopoGeom take long time

Hi,
I'm trying to insert geometry data to topology structure. I have 7000 polygons and the procedure take very long time now it's about 22 hours. 

UPDATE plochy  SET topo = topology.toTopoGeom(geom, 'dp_topo',3,0.005);

I run the postgis database on my laptop:
procesor: Intel(R) Core(TM) i5-2430M CPU 2.40GHz 
RAM: 8GB
type: 64bit 

I'm newbie and I tryed it only on my sample data.
Is this time still ok or should I stop the query?

Thx
 Eva
_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Eva Linhartová | 18 May 2013 12:17
Picon

postgis topology

Hi,
I'm trying to insert geometry data to topology structure. I tryed it on my sample data before and it was ok, but now if I use polygon table with 7000 polygons or 20000 lines can't work. 

I get error like: 

ERROR:  schema "dp_topo2" does not exist
LINE 1: SELECT nextval('DP_TOPO2.node_node_id_seq')

ERROR: schema "dp_topo2" does not exist
Stav SQL: 3F000

SET search_path TO dp, topology, public;
SELECT CreateTopology('DP_TOPO2',2065,0.005);  -- 1491 ms

SELECT AddTopoGeometryColumn('DP_TOPO2', 'dp', 'ku', 'topo', 'POLYGON');  -- 301ms
SELECT AddTopoGeometryColumn('DP_TOPO2', 'dp', 'body', 'topo', 'POINT');  -- 701ms
SELECT AddTopoGeometryColumn('DP_TOPO2', 'dp', 'plochy', 'topo', 'POLYGON'); -- 298ms
SELECT AddTopoGeometryColumn('DP_TOPO2', 'dp', 'linie', 'topo', 'LINESTRING'); -- 171ms


UPDATE ku SET topo = topology.toTopoGeom(geom, 'DP_TOPO2',1,0.005);  -- 687ms
UPDATE body SET topo = topology.toTopoGeom(geom, 'DP_TOPO2',2,0.005); -- 164274ms
UPDATE plochy  SET topo = topology.toTopoGeom(geom, 'DP_TOPO2',3,0.005); -- dp_topo2 does not exist
UPDATE linie SET topo = topology.toTopoGeom(geom, 'DP_TOPO2',4,0.005); -- dp_topo2 does not exist

I'm newbie in geodatabase and in PostGIS so I have no idea what can I do to fix this problem.
I'll appreciate some help.

Thx Eva
_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Richard Cernava | 18 May 2013 01:40
Picon

Strange behavior

I'm trying to query if a point is present inside a MultiLineString. When I run the following query I get very strange results in my opinion. If someone could elaborate as to what's going on it would be very much appreciated! 

From this query I get a false and a true on the identical data. First I check to see if the_geom intersects with my point and receive false. Second I take the_geom and convert it to text and then compare it with my point using ST_GeomFromText and get true. How is this possible? I've outputted the result from the statement below.

SELECT fullname, ST_X(ST_StartPoint(ST_LineMerge(the_geom))), ST_Y(ST_StartPoint(ST_LineMerge(the_geom))),
ST_AsText(the_geom) AS text,
ST_Intersects(the_geom, ST_GeomFromText('POINT(-122.837109 45.537746)', 4269)) AS fromdb,
ST_Intersects(ST_GeomFromText(ST_AsText(the_geom), 4269), ST_GeomFromText('POINT(-122.837109 45.537746)', 4269)) AS fromtxt
from tiger_data.or_edges where   fullname like 'NW Norwich St' limit 1


"NW Norwich St";-122.837109;45.537746;"MULTILINESTRING((-122.837109 45.537746,-122.837253 45.537684,-122.837718 45.537368,-122.837829 45.537288,-122.838081 45.537108,-122.838169 45.537049))";f;t


--
-Richard
_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Elena Olivares | 17 May 2013 15:00
Picon
Favicon

Σχετ: Yen's algorithm


hello,

i am a student and i need help with postgis.
i want to implement a algorithm (Yen's algorithm computes  K-shortestpaths).
if can somebody help me ???

 thank you in avdance


_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Tina Musa | 17 May 2013 11:07
Picon
Favicon

Σχετ: postgis

hello,

i am a student and i need help with postgis.
i want to implement a algorithm (Yen's algorithm computes  K-shortestpaths).
if can somebody help me ???

 thank you in avdance


_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Tina Musa | 17 May 2013 10:13
Picon
Favicon

Σχετ: postgis

hello,

i am a student and i need help with postgis.
i want to implement a algorithm (Yen's algorithm computes  K-shortestpaths).
if can somebody help me ???

 thank you in avdance


_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Dave Potts | 17 May 2013 01:05
Picon

Getting argument of AND must not return a set, when trying to calculate the intersection of a end of a multiline and a polygon

Hi,

I am trying to find the results of an intersection between a multi line 
string and a polygon,  I had assumed that saying something
like

select rt.source, 
av.geom,st_astext(st_startpoint((st_dump((rt.the_geom))).geom)) from 
route_table rt ,
avoid_areas av
where av.valid=true and rt.parent_port_id=80360 and
st_within(av.geom,st_startpoint((st_dump((rt.the_geom))).geom)) =true

might work where rt.the_geom is a multiline  and av.geom is a polygon

but I get the error,
ERROR:  argument of AND must not return a set
LINE 4: st_within(av.geom,st_startpoint((st_dump((rt.the_geom))).geo

any idea what I am doing wrong?

Dave

Gmane