[postgis-users] MultiLineStringZM

2012-07-19 Thread Pedro Costa

Hello people,

I have one column that is 'MultiLineStringZM'.
How do i turn this geom in 2d?

Thanks
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] MultiLineStringZM

2012-07-19 Thread Pedro Costa


Thank you Sandro Santilli

I resolved with force2d





Em 19-07-2012 12:18, Sandro Santilli escreveu:

On Thu, Jul 19, 2012 at 11:35:50AM +0100, Pedro Costa wrote:

Hello people,

I have one column that is 'MultiLineStringZM'.
How do i turn this geom in 2d?

ALTER TABLE mytable ALTER mycolumn
  TYPE geometry(MultiLineString)
  WITH st_force2d(mycolumn);

The last one could be USING rather than WITH, and there
could be some other SQL syntax error. Refer to PostgreSQL
manual abut ALTER TABLE.

--strk;

   ,--o-.
   |   __/  |Delivering high quality PostGIS 2.1
   |  / 2.1 |http://strk.keybit.net - http://vizzuality.com
   `-o--'

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Import excel file to postgresql

2012-06-13 Thread Pedro Costa

Hi José,

You have to convert the excel file to csv and use the copy command like 
that:



copy table_name from 'C:\Users\TEMP\filename.csv' WITH CSV DELIMITER ';';


You have to create the table before and delete the column names of csv file.




Em 13-06-2012 14:46, José María Amuedo escreveu:

Hi,

I would like to know how can import excel file to postgresql. I'm 
working with linux OS.


Thanks


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Import excel file to postgresql

2012-06-13 Thread Pedro Costa


Try with i sample attached.
be sure that your table must have columns according to the file



Em 13-06-2012 15:50, José María Amuedo escreveu:

this is my file

2012/6/13 Pedro Costa pedrocostaa...@sapo.pt 
mailto:pedrocostaa...@sapo.pt


Send me a sample of your file. But you have to remove the last
semicolon.

Your file have to be like that:


column1;column2;column3;33.
column1_r2;column2_r2;column3_r2;33.




Em 13-06-2012 15:34, José María Amuedo escreveu:

I obtened this error:

RROR: extra data after last expected column
SQL state: 22P04
Context: COPY nueva, line 1:

CODIGO;TIPO;DESCRIPCION;REPRESENTACION;PERFIL;CLAVE;VER3D;CARACBUSQ;LETRA;CAPITULO;SUBCAPITULO;ESTA;...

2012/6/13 Pedro Costa pedrocostaa...@sapo.pt
mailto:pedrocostaa...@sapo.pt

Hi José,

You have to convert the excel file to csv and use the copy
command like that:


copy table_name from 'C:\Users\TEMP\filename.csv' WITH CSV
DELIMITER ';';


You have to create the table before and delete the column
names of csv file.




Em 13-06-2012 14:46, José María Amuedo escreveu:

Hi,

I would like to know how can import excel file to
postgresql. I'm working with linux OS.

Thanks


___
postgis-users mailing list
postgis-users@postgis.refractions.net  
mailto:postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




___
postgis-users mailing list
postgis-users@postgis.refractions.net
mailto:postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




___
postgis-users mailing list
postgis-users@postgis.refractions.net  
mailto:postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




___
postgis-users mailing list
postgis-users@postgis.refractions.net
mailto:postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



ADF;0;ADELFA SOLA;ADF;0;0;1;Adelfas y setos;b;7;21;FALSO;ADF;D:\SDC\Señales\;ADF
ARB;0;ARBOL;ARB;0;0;0;Arboleda;b;7;21;FALSO;ARB;D:\SDC\Señales\;ARB
ARC;1;LINEA DE REFERENCIA DE CARRET;1;1;0;1;Codigos reservados;z;900;911;FALSO;ARC;D:\SDC\Señales\;ARC
BAA;1;EMPALME DE BAG EN SALIDAS;3;1;0;1;Codigos reservados;z;900;911;FALSO;BAA;D:\SDC\Señales\;BAA
BAG;1;BORDE DE AGLOMERADO;15;1;0;1;Codigos reservados;z;900;911;FALSO;BAG;D:\SDC\Señales\;BAG
BCS;1;BORDE CAMINO SERVICIO;1;1;0;1;Codigos reservados;z;900;911;FALSO;BCS;D:\SDC\Señales\;BCS
BST;1;BORDE SUPERIOR DE TALUD;1;1;0;1;Codigos reservados;z;900;911;FALSO;BST;D:\SDC\Señales\;BST
BTI;1;BORDE TALUD INFERIOR;1;1;0;1;Codigos reservados;z;900;911;FALSO;BTI;D:\SDC\Señales\;BTI
CNO;1;CAMINO;4;1;0;1;Camino servicio;z;15;901;FALSO;CNO;D:\SDC\Señales\;CNO
ENT;0;Punto entronque con enlace;ENT;0;0;0;Codigos reservados;z;900;911;FALSO;ENT;D:\SDC\Señales\;ENT
IBN;0;IMBORNAL;IBN;0;0;1;Imbornales;z;10;46;VERDADERO;IBN;D:\SDC\Señales\;IBN
LTA;1;Linea de peine de talud;LTA;1;0;1;Codigos reservados;z;900;911;FALSO;LTA;D:\SDC\Señales\;LTA
VSA;1;BORDE CAMINO SERVICIO AGLOMERADO;1;1;0;1;Codigos reservados;z;900;911;FALSO;VSA;D:\SDC\Señales\;VSA
ACE;1;ACERADO PUENTE;1;0;1;1;Acerados;z;900;913;VERDADERO;ACE;D:\SDC\Señales\;ACE
ADE;1;ADELFAS Y SETOS;1;0;1;1;Adelfas y setos;a;7;21;VERDADERO;ADE;D:\SDC\Señales\;ADE
BAE;1;BARANDILLA ENTERA;1;0;1;1;Barandillas;z;900;913;VERDADERO;BAE;D:\SDC\Señales\;BAE___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] RE : st_offsetcurve

2012-05-17 Thread Pedro Costa

Thanks Hugues...

In this time the select return the street number, my_single_geom and 
my_union_geom.

The my_union_geom are the two parallels right?

I tried to see the result in qgis, adding a new column (the_geom) equal 
to the column my_union_geom, and adding a new entry inthe table 
geometry_columns. But I can not see the result, qgis does not recognize 
as a geometry column.


What would have to do to see the result?


Thanks


Em 15-05-2012 06:56, Francois Hugues escreveu:

Ok, the error comes from the select : try using select a.n_street, 
my_union_geom, ST_Parallel(the_geom,-3.0,0,0) my_single_geom

I forgot to add the table reference a.

I think I made another mistake using the over method. It would rather be 
something like that :

select n_street, st_union(ST_Parallel(the_geom,3.0,0,0)) over(partition by 
n_street) my_union_geom,
ST_Parallel(the_geom,-3.0,0,0)) my_single_geom
from streets

Firts time I read too fast this time I wrote too fast !

Hugues.



 Message d'origine
De: postgis-users-boun...@postgis.refractions.net de la part de Pedro Costa
Date: lun. 14/05/2012 17:36
À: PostGIS Users Discussion
Objet : Re: [postgis-users] st_offsetcurve

Thank you Francois but still error.

Using this:

With my_union as (
select n_street, st_union (ST_Parallel(the_geom,3.0,0,0)) my_union_geom
from streets
group by n_street)

select n_street, my_union_geom, ST_Parallel(the_geom,-3.0,0,0) my_single_geom
from my_union a
join streets b on a.n_street = b.n_street



give me this error:

column reference n_street is ambiguous

I put the table name but give me another error:

invalid reference to FROM-clause entry for table my_union




Em 11-05-2012 11:01, Francois Hugues escreveu:

Hi,

This error is normal. You can not use a group by clause with an aggregate 
function and keep all of single records from your original database. Which one 
will you choose to keep for each unique n-street value ?

To do that you can use two different tricks (but your table will have as many 
lines as you have unique couple n_street/the_geom):

Using with with a join
With my_union as (
select n_street, st_union (ST_Parallel(the_geom,3.0,0,0)) my_union_geom
from streets
group by n_street)

select n_street, my_union_geom, ST_Parallel(the_geom,-3.0,0,0) my_single_geom
from my_union a
join streets b on a.n_street = b.n_street

or using an over function (not totally sure of this particular request but the 
window function can certainly help you in this case)

select n_street, st_union (ST_Parallel(the_geom,3.0,0,0)) ,
ST_Parallel(the_geom,-3.0,0,0))over(partition by n_street)
from streets
group by n_street

Hugues.

--

-Message d'origine-
De : postgis-users-boun...@postgis.refractions.net 
[mailto:postgis-users-boun...@postgis.refractions.net] De la part de Pedro Costa
Envoyé : vendredi 11 mai 2012 10:30
À : PostGIS Users Discussion
Objet : Re: [postgis-users] st_offsetcurve

Ups, sorry...

The whole sql:

create table test4 as
(select n_street, st_union (ST_Parallel(the_geom,3.0,0,0)) ,
(ST_Parallel(the_geom,-3.0,0,0))
from streets
group by n_street)



Em 11-05-2012 00:03, Simon Greener escreveu:

Pedro,


greate. The funcion works.

I'm doing something like that:

ST_Parallel(the_geom,3.0,0,0)

but give me error:

column streetss.the_geom must appear in the GROUP BY clause or be used
in an aggregate function

anybody know the problem?

Not without the whole SQL statement.

S

thanks


Em 10-05-2012 04:40, Simon Greener escreveu:

Folks,

Sorry about that. The file:

http://www.spatialdbadvisor.com/file_download/55/PostGIS_Parallel.sql

Did not contain all the required types and functions. One needed also
to access the types and functions for my ST_GetVector function.

I have now included all the required types and related functions in
the above script and replaced it on my site.

I have changed a bit in the code as it didn't handle some situations
as I expected. Hopefully my test cases give good coverage.

My tests, conducted on PostgreSQL 9.1 and PostGIS 2.0 on Windows 7 64
Bit all work as this example shows:

With geometries As (
select ST_GeomFromText('LINESTRING(1 1,1 10)') as geom,
   10.0 as offset,2 as roundFactor,0 as curved
union all select ST_GeomFromText('LINESTRING(0 0,1 1,1 2)') as geom,
0.5 as offset,2 as roundFactor,
   generate_series(0,1,1) as curved
union all select ST_GeomFromText('LINESTRING(0.0 0.0, 45.0 45.0, 90.0
0.0, 135.0 45.0, 180.0 0.0, 180.0 -45.0, 45.0 -45.0, 0.0 0.0)') as
geom,
   10.0 as offset,2 as roundFactor,
   generate_series(0,1,1) as curved
union all select ST_GeomFromText('MULTILINESTRING((0 0,1 1,1 2),(2 3,3
2,5 4))') as geom,
0.5 as offsetRight,2 as roundFactor,
   generate_series(0,1,1) as curved
)
select ST_AsText(g.geom) as origGeom, g.offset,g.curved,
 ST_AsText

Re: [postgis-users] break lines at intersections

2012-05-17 Thread Pedro Costa

Great Nicolos, works...

It is possible select lines from one table a less than 3 meters from 
lines from another table?and delete them...


thanks


Em 17-05-2012 15:41, Nicolas Ribot escreveu:

Hi Pedro,

select (st_dump(st_union(geom))).geom from lines;

will cut your network of lines at intersections.

Nicolas

On 17 May 2012 11:57, Pedro Costa pedrocostaa...@sapo.pt 
mailto:pedrocostaa...@sapo.pt wrote:


does anyone know how I can cut the lines at intersectionslike the
image attached?

I can´t install postgis 2.0 for now

I see a few examples with st_union and st_dump but i don't
understand...


Thanks

___
postgis-users mailing list
postgis-users@postgis.refractions.net
mailto:postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] break lines at intersections

2012-05-17 Thread Pedro Costa

i found the error. the parallels are a less then 3 meters...

thanks



Em 17-05-2012 16:43, Pedro Costa escreveu:
I'm already tried this function but with no good results, I do not 
understand why.
You can see an example in the attached image. The streets are red 
lines. The parallel purple and what I want to clear yellow.


Any idea ?


I tried the st_dwithin like this:


create table street8 as (SELECT paralell.geom FROM parallel,street 
WHERE st_dwithin(paralell.geom, streets.the_geom, 2.99 ))



The 'line erros' that i want to delete are a less than 3 meters from 
streets...



thanks



Em 17-05-2012 16:32, Nicolas Ribot escreveu:

Yes, it should be:
st_dwithin will help you to find all lines from a table within a 
certain distance to other lines.


Nicolas

On 17 May 2012 17:23, Pedro Costa pedrocostaa...@sapo.pt 
mailto:pedrocostaa...@sapo.pt wrote:


Great Nicolos, works...

It is possible select lines from one table a less than 3 meters
from lines from another table?and delete them...

thanks


Em 17-05-2012 15:41, Nicolas Ribot escreveu:

Hi Pedro,

select (st_dump(st_union(geom))).geom from lines;

will cut your network of lines at intersections.

Nicolas

On 17 May 2012 11:57, Pedro Costa pedrocostaa...@sapo.pt
mailto:pedrocostaa...@sapo.pt wrote:

does anyone know how I can cut the lines at
intersectionslike the image attached?

I can´t install postgis 2.0 for now

I see a few examples with st_union and st_dump but i don't
understand...


Thanks

___
postgis-users mailing list
postgis-users@postgis.refractions.net
mailto:postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




___
postgis-users mailing list
postgis-users@postgis.refractions.net  
mailto:postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



___
postgis-users mailing list
postgis-users@postgis.refractions.net
mailto:postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] st_offsetcurve

2012-05-14 Thread Pedro Costa

Thank you Francois but still error.

Using this:

With my_union as (
select n_street, st_union (ST_Parallel(the_geom,3.0,0,0)) my_union_geom
from streets
group by n_street)

select n_street, my_union_geom, ST_Parallel(the_geom,-3.0,0,0) my_single_geom
from my_union a
join streets b on a.n_street = b.n_street



give me this error:

column reference n_street is ambiguous

I put the table name but give me another error:

invalid reference to FROM-clause entry for table my_union




Em 11-05-2012 11:01, Francois Hugues escreveu:

Hi,

This error is normal. You can not use a group by clause with an aggregate 
function and keep all of single records from your original database. Which one 
will you choose to keep for each unique n-street value ?

To do that you can use two different tricks (but your table will have as many 
lines as you have unique couple n_street/the_geom):

Using with with a join
With my_union as (
select n_street, st_union (ST_Parallel(the_geom,3.0,0,0)) my_union_geom
from streets
group by n_street)

select n_street, my_union_geom, ST_Parallel(the_geom,-3.0,0,0) my_single_geom
from my_union a
join streets b on a.n_street = b.n_street

or using an over function (not totally sure of this particular request but the 
window function can certainly help you in this case)

select n_street, st_union (ST_Parallel(the_geom,3.0,0,0)) ,
ST_Parallel(the_geom,-3.0,0,0))over(partition by n_street)
from streets
group by n_street

Hugues.

--

-Message d'origine-
De : postgis-users-boun...@postgis.refractions.net 
[mailto:postgis-users-boun...@postgis.refractions.net] De la part de Pedro Costa
Envoyé : vendredi 11 mai 2012 10:30
À : PostGIS Users Discussion
Objet : Re: [postgis-users] st_offsetcurve

Ups, sorry...

The whole sql:

create table test4 as
(select n_street, st_union (ST_Parallel(the_geom,3.0,0,0)) ,
(ST_Parallel(the_geom,-3.0,0,0))
from streets
group by n_street)



Em 11-05-2012 00:03, Simon Greener escreveu:

Pedro,


greate. The funcion works.

I'm doing something like that:

ST_Parallel(the_geom,3.0,0,0)

but give me error:

column streetss.the_geom must appear in the GROUP BY clause or be used
in an aggregate function

anybody know the problem?

Not without the whole SQL statement.

S

thanks


Em 10-05-2012 04:40, Simon Greener escreveu:

Folks,

Sorry about that. The file:

http://www.spatialdbadvisor.com/file_download/55/PostGIS_Parallel.sql

Did not contain all the required types and functions. One needed also
to access the types and functions for my ST_GetVector function.

I have now included all the required types and related functions in
the above script and replaced it on my site.

I have changed a bit in the code as it didn't handle some situations
as I expected. Hopefully my test cases give good coverage.

My tests, conducted on PostgreSQL 9.1 and PostGIS 2.0 on Windows 7 64
Bit all work as this example shows:

With geometries As (
   select ST_GeomFromText('LINESTRING(1 1,1 10)') as geom,
  10.0 as offset,2 as roundFactor,0 as curved
union all select ST_GeomFromText('LINESTRING(0 0,1 1,1 2)') as geom,
   0.5 as offset,2 as roundFactor,
  generate_series(0,1,1) as curved
union all select ST_GeomFromText('LINESTRING(0.0 0.0, 45.0 45.0, 90.0
0.0, 135.0 45.0, 180.0 0.0, 180.0 -45.0, 45.0 -45.0, 0.0 0.0)') as
geom,
  10.0 as offset,2 as roundFactor,
  generate_series(0,1,1) as curved
union all select ST_GeomFromText('MULTILINESTRING((0 0,1 1,1 2),(2 3,3
2,5 4))') as geom,
   0.5 as offsetRight,2 as roundFactor,
  generate_series(0,1,1) as curved
)
select ST_AsText(g.geom) as origGeom, g.offset,g.curved,
ST_AsText(ST_Parallel(g.geom,g.offset,g.roundFactor,g.curved))
as geomWKTLeft,

ST_AsText(ST_Parallel(g.geom,0.0-g.offset,g.roundFactor,g.curved)) as
geomWKTRight
   from geometries as g;

LINESTRING(1 1,1 10);10.0;0;LINESTRING(11 1,11 10);LINESTRING(-9
1,-9 10)
LINESTRING(0 0,1 1,1 2);0.5;0;LINESTRING(0.35 -0.35,1.5 0.79,1.5
2);LINESTRING(-0.35 0.35,0.5 1.21,0.5 2)
LINESTRING(0 0,1 1,1 2);0.5;1;COMPOUNDCURVE((0.35 -0.35,1.35
0.65),CIRCULARSTRING(1.35 0.65,1.46 0.81,1.5 1),(1.5 1,1.5
2));LINESTRING(-0.35 0.35,0.5 1.21,0.5 2)
LINESTRING(0 0,45 45,90 0,135 45,180 0,180 -45,45 -45,0
0);10.0;0;LINESTRING(7.07 -7.07,45 30.86,90 -14.14,135 30.86,170
-4.14,170 -35,49.14 -35,7.07 7.07);LINESTRING(-7.07 7.07,45 59.14,90
14.14,135 59.14,190 4.14,190 -55,40.86 -55,-7.07 -7.07)
LINESTRING(0 0,45 45,90 0,135 45,180 0,180 -45,45 -45,0
0);10.0;1;COMPOUNDCURVE((7.07 -7.07,45 30.86,82.93
-7.07),CIRCULARSTRING(82.93 -7.07,90 -10,97.07 -7.07),(97.07
-7.07,134.71 31.15,170 -4.14,170 -35,49.14 -35,7.07
7.07));COMPOUNDCURVE((-7.07 7.07,37.93 52.07),CIRCULARSTRING(37.93
52.07,45 55,52.07 52.07),(52.07 52.07,89.71 13.85,127.93
52.07),CIRCULARSTRING(127.93 52.07,135 55,142.07 52.07),(142.07
52.07,187.07 7.07),CIRCULARSTRING

Re: [postgis-users] st_offsetcurve

2012-05-11 Thread Pedro Costa

Ups, sorry...

The whole sql:

create table test4 as
(select n_street, st_union (ST_Parallel(the_geom,3.0,0,0)) , 
(ST_Parallel(the_geom,-3.0,0,0))

from streets
group by n_street)



Em 11-05-2012 00:03, Simon Greener escreveu:

Pedro,


greate. The funcion works.

I'm doing something like that:

ST_Parallel(the_geom,3.0,0,0)

but give me error:

column streetss.the_geom must appear in the GROUP BY clause or be used
in an aggregate function

anybody know the problem?


Not without the whole SQL statement.

S


thanks


Em 10-05-2012 04:40, Simon Greener escreveu:

Folks,

Sorry about that. The file:

http://www.spatialdbadvisor.com/file_download/55/PostGIS_Parallel.sql

Did not contain all the required types and functions. One needed also
to access the types and functions for my ST_GetVector function.

I have now included all the required types and related functions in
the above script and replaced it on my site.

I have changed a bit in the code as it didn't handle some situations
as I expected. Hopefully my test cases give good coverage.

My tests, conducted on PostgreSQL 9.1 and PostGIS 2.0 on Windows 7 64
Bit all work as this example shows:

With geometries As (
  select ST_GeomFromText('LINESTRING(1 1,1 10)') as geom,
 10.0 as offset,2 as roundFactor,0 as curved
union all select ST_GeomFromText('LINESTRING(0 0,1 1,1 2)') as geom,
  0.5 as offset,2 as roundFactor,
 generate_series(0,1,1) as curved
union all select ST_GeomFromText('LINESTRING(0.0 0.0, 45.0 45.0, 90.0
0.0, 135.0 45.0, 180.0 0.0, 180.0 -45.0, 45.0 -45.0, 0.0 0.0)') as 
geom,

 10.0 as offset,2 as roundFactor,
 generate_series(0,1,1) as curved
union all select ST_GeomFromText('MULTILINESTRING((0 0,1 1,1 2),(2 3,3
2,5 4))') as geom,
  0.5 as offsetRight,2 as roundFactor,
 generate_series(0,1,1) as curved
)
select ST_AsText(g.geom) as origGeom, g.offset,g.curved,
   ST_AsText(ST_Parallel(g.geom,g.offset,g.roundFactor,g.curved))
as geomWKTLeft,

ST_AsText(ST_Parallel(g.geom,0.0-g.offset,g.roundFactor,g.curved)) as
geomWKTRight
  from geometries as g;

LINESTRING(1 1,1 10);10.0;0;LINESTRING(11 1,11 10);LINESTRING(-9
1,-9 10)
LINESTRING(0 0,1 1,1 2);0.5;0;LINESTRING(0.35 -0.35,1.5 0.79,1.5
2);LINESTRING(-0.35 0.35,0.5 1.21,0.5 2)
LINESTRING(0 0,1 1,1 2);0.5;1;COMPOUNDCURVE((0.35 -0.35,1.35
0.65),CIRCULARSTRING(1.35 0.65,1.46 0.81,1.5 1),(1.5 1,1.5
2));LINESTRING(-0.35 0.35,0.5 1.21,0.5 2)
LINESTRING(0 0,45 45,90 0,135 45,180 0,180 -45,45 -45,0
0);10.0;0;LINESTRING(7.07 -7.07,45 30.86,90 -14.14,135 30.86,170
-4.14,170 -35,49.14 -35,7.07 7.07);LINESTRING(-7.07 7.07,45 59.14,90
14.14,135 59.14,190 4.14,190 -55,40.86 -55,-7.07 -7.07)
LINESTRING(0 0,45 45,90 0,135 45,180 0,180 -45,45 -45,0
0);10.0;1;COMPOUNDCURVE((7.07 -7.07,45 30.86,82.93
-7.07),CIRCULARSTRING(82.93 -7.07,90 -10,97.07 -7.07),(97.07
-7.07,134.71 31.15,170 -4.14,170 -35,49.14 -35,7.07
7.07));COMPOUNDCURVE((-7.07 7.07,37.93 52.07),CIRCULARSTRING(37.93
52.07,45 55,52.07 52.07),(52.07 52.07,89.71 13.85,127.93
52.07),CIRCULARSTRING(127.93 52.07,135 55,142.07 52.07),(142.07
52.07,187.07 7.07),CIRCULARSTRING(187.07 7.07,189.16 4.01,190 0),(190
0,190 -45),CIRCULARSTRING(190 -45,187.13 -52.01,180 -55),(180 -55,45
-55),CIRCULARSTRING(45 -55,41.27 -54.28,37.93 -52.07),(37.93
-52.07,-7.07 -7.07))
MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5
4));0.5;0;MULTILINESTRING((1.65 2.65,3 1.29,5.35
3.65));MULTILINESTRING((2.35 3.35,3 2.71,4.65 4.35))
MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4));0.5;1;MULTICURVE((1.65
2.65,2.65 1.65),CIRCULARSTRING(2.65 1.65,3 1.5,3.35 1.65),(3.35
1.65,5.35 3.65));MULTILINESTRING((2.35 3.35,3 2.71,4.65 4.35))

Sorry for any inconvenience.

The file is available for download via the link above.

regards
Simon


On Wed, 09 May 2012 23:27:04 +1000, Pedro Costa
pedrocostaa...@sapo.pt wrote:


No problem Hugues.

Give me the same error:

ERROR:  function st_parallel(geometry, numeric, numeric, integer) does
not exist
LINE 1: select ST_Parallel(the_geom, 3.0, 0.0, 0) as test from tests



Em 09-05-2012 13:48, Francois Hugues escreveu:

Sorry, I read your message too fast and forgot the PS.

Maybe you could try something like :
select ST_Parallel(the_geom, 3.0, 0.0, 0) as test from tests

Hugues.



-Message d'origine-
De : postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] De la part de
Pedro Costa
Envoyé : mercredi 9 mai 2012 13:06
À : PostGIS Users Discussion
Objet : Re: [postgis-users] st_offsetcurve

Em 09-05-2012 11:28, Pedro Costa escreveu:

PS: I´m already install the function by your file

I'm already do that...
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
___
postgis-users mailing list
postgis-users

Re: [postgis-users] st_offsetcurve

2012-05-10 Thread Pedro Costa

greate. The funcion works.

I'm doing something like that:

ST_Parallel(the_geom,3.0,0,0)


but give me error:

column streetss.the_geom must appear in the GROUP BY clause or be used 
in an aggregate function


anybody know the problem?

thanks


Em 10-05-2012 04:40, Simon Greener escreveu:

Folks,

Sorry about that. The file:

http://www.spatialdbadvisor.com/file_download/55/PostGIS_Parallel.sql

Did not contain all the required types and functions. One needed also 
to access the types and functions for my ST_GetVector function.


I have now included all the required types and related functions in 
the above script and replaced it on my site.


I have changed a bit in the code as it didn't handle some situations 
as I expected. Hopefully my test cases give good coverage.


My tests, conducted on PostgreSQL 9.1 and PostGIS 2.0 on Windows 7 64 
Bit all work as this example shows:


With geometries As (
  select ST_GeomFromText('LINESTRING(1 1,1 10)') as geom,
 10.0 as offset,2 as roundFactor,0 as curved
union all select ST_GeomFromText('LINESTRING(0 0,1 1,1 2)') as geom,
  0.5 as offset,2 as roundFactor,
 generate_series(0,1,1) as curved
union all select ST_GeomFromText('LINESTRING(0.0 0.0, 45.0 45.0, 90.0 
0.0, 135.0 45.0, 180.0 0.0, 180.0 -45.0, 45.0 -45.0, 0.0 0.0)') as geom,

 10.0 as offset,2 as roundFactor,
 generate_series(0,1,1) as curved
union all select ST_GeomFromText('MULTILINESTRING((0 0,1 1,1 2),(2 3,3 
2,5 4))') as geom,

  0.5 as offsetRight,2 as roundFactor,
 generate_series(0,1,1) as curved
)
select ST_AsText(g.geom) as origGeom, g.offset,g.curved,
   ST_AsText(ST_Parallel(g.geom,g.offset,g.roundFactor,g.curved)) 
as geomWKTLeft,
   
ST_AsText(ST_Parallel(g.geom,0.0-g.offset,g.roundFactor,g.curved)) as 
geomWKTRight

  from geometries as g;

LINESTRING(1 1,1 10);10.0;0;LINESTRING(11 1,11 10);LINESTRING(-9 
1,-9 10)
LINESTRING(0 0,1 1,1 2);0.5;0;LINESTRING(0.35 -0.35,1.5 0.79,1.5 
2);LINESTRING(-0.35 0.35,0.5 1.21,0.5 2)
LINESTRING(0 0,1 1,1 2);0.5;1;COMPOUNDCURVE((0.35 -0.35,1.35 
0.65),CIRCULARSTRING(1.35 0.65,1.46 0.81,1.5 1),(1.5 1,1.5 
2));LINESTRING(-0.35 0.35,0.5 1.21,0.5 2)
LINESTRING(0 0,45 45,90 0,135 45,180 0,180 -45,45 -45,0 
0);10.0;0;LINESTRING(7.07 -7.07,45 30.86,90 -14.14,135 30.86,170 
-4.14,170 -35,49.14 -35,7.07 7.07);LINESTRING(-7.07 7.07,45 59.14,90 
14.14,135 59.14,190 4.14,190 -55,40.86 -55,-7.07 -7.07)
LINESTRING(0 0,45 45,90 0,135 45,180 0,180 -45,45 -45,0 
0);10.0;1;COMPOUNDCURVE((7.07 -7.07,45 30.86,82.93 
-7.07),CIRCULARSTRING(82.93 -7.07,90 -10,97.07 -7.07),(97.07 
-7.07,134.71 31.15,170 -4.14,170 -35,49.14 -35,7.07 
7.07));COMPOUNDCURVE((-7.07 7.07,37.93 52.07),CIRCULARSTRING(37.93 
52.07,45 55,52.07 52.07),(52.07 52.07,89.71 13.85,127.93 
52.07),CIRCULARSTRING(127.93 52.07,135 55,142.07 52.07),(142.07 
52.07,187.07 7.07),CIRCULARSTRING(187.07 7.07,189.16 4.01,190 0),(190 
0,190 -45),CIRCULARSTRING(190 -45,187.13 -52.01,180 -55),(180 -55,45 
-55),CIRCULARSTRING(45 -55,41.27 -54.28,37.93 -52.07),(37.93 
-52.07,-7.07 -7.07))
MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 
4));0.5;0;MULTILINESTRING((1.65 2.65,3 1.29,5.35 
3.65));MULTILINESTRING((2.35 3.35,3 2.71,4.65 4.35))
MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4));0.5;1;MULTICURVE((1.65 
2.65,2.65 1.65),CIRCULARSTRING(2.65 1.65,3 1.5,3.35 1.65),(3.35 
1.65,5.35 3.65));MULTILINESTRING((2.35 3.35,3 2.71,4.65 4.35))


Sorry for any inconvenience.

The file is available for download via the link above.

regards
Simon


On Wed, 09 May 2012 23:27:04 +1000, Pedro Costa 
pedrocostaa...@sapo.pt wrote:



No problem Hugues.

Give me the same error:

ERROR:  function st_parallel(geometry, numeric, numeric, integer) does
not exist
LINE 1: select ST_Parallel(the_geom, 3.0, 0.0, 0) as test from tests



Em 09-05-2012 13:48, Francois Hugues escreveu:

Sorry, I read your message too fast and forgot the PS.

Maybe you could try something like :
select ST_Parallel(the_geom, 3.0, 0.0, 0) as test from tests

Hugues.



-Message d'origine-
De : postgis-users-boun...@postgis.refractions.net 
[mailto:postgis-users-boun...@postgis.refractions.net] De la part de 
Pedro Costa

Envoyé : mercredi 9 mai 2012 13:06
À : PostGIS Users Discussion
Objet : Re: [postgis-users] st_offsetcurve

Em 09-05-2012 11:28, Pedro Costa escreveu:

PS: I´m already install the function by your file

I'm already do that...
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo

Re: [postgis-users] st_offsetcurve

2012-05-09 Thread Pedro Costa

Em 09-05-2012 10:46, Francois Hugues escreveu:

If i'm not wrong, this function really dos not exists in postgis 1.5.3 and is 
avalaible since 2.0.


Thanks.
Anybody know a way of transform a polygon buffer in lines?


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] st_offsetcurve

2012-05-09 Thread Pedro Costa

Em 09-05-2012 11:28, Pedro Costa escreveu:
PS: I´m already install the function by your file 


I'm already do that...
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] st_offsetcurve

2012-05-09 Thread Pedro Costa

No problem Hugues.

Give me the same error:

ERROR:  function st_parallel(geometry, numeric, numeric, integer) does 
not exist

LINE 1: select ST_Parallel(the_geom, 3.0, 0.0, 0) as test from tests



Em 09-05-2012 13:48, Francois Hugues escreveu:

Sorry, I read your message too fast and forgot the PS.

Maybe you could try something like :
select ST_Parallel(the_geom, 3.0, 0.0, 0) as test from tests

Hugues.



-Message d'origine-
De : postgis-users-boun...@postgis.refractions.net 
[mailto:postgis-users-boun...@postgis.refractions.net] De la part de Pedro Costa
Envoyé : mercredi 9 mai 2012 13:06
À : PostGIS Users Discussion
Objet : Re: [postgis-users] st_offsetcurve

Em 09-05-2012 11:28, Pedro Costa escreveu:

PS: I´m already install the function by your file

I'm already do that...
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] View PostGIS raster in mapserver

2012-03-21 Thread Pedro Costa

Em 21-03-2012 21:08, Hemin Tofiq escreveu:

I would like to perform raster-analysis and Map_algebra operations and
present the results in a (Web)GIS application (I found more documentation
about using mapserver). I try to start from simple raster data sets created
from PostGIS tables.

Hello Tofiq,

Can you share information about this?that you find...

thanks
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Fwd: cut lines with points

2012-03-15 Thread Pedro Costa

Em 14-03-2012 23:58, Stephen Woodbridge escreveu:
You might want to look at the book: PostGIS In Action pg 225 has a 
function to cut a linestring at point junctions


Thanks Steve.
I have the printed version of this book because I bought recently.
I did not remember this example but do not quite understand.
The points that I want to join share the same street number so my 
intention is to create lines with the union of points which share the 
same street, but only for those who are within a certain distance.

Will could help in building the query?

thank you
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Fwd: cut lines with points

2012-03-14 Thread Pedro Costa

I forget the image...



 Mensagem Original 
Assunto:cut lines with points
Data:   Wed, 14 Mar 2012 20:59:14 +
De: Pedro Costa pedrocostaa...@sapo.pt
Para:   postgis-users@postgis.refractions.net



Hello to all,

This is my first mail to this list.
I have to do one thing and i need help for solving that fastly.
I have points and lines and I intend to cut the lines based on points.
Does anyone have any idea how to fix this quickly?

Attached is a picture to illustrate the problem.

thank you

Pedro


attachment: cortar linhas com pontos.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users