Re: [postgis-users] help with the Union of 2 shp

2013-12-26 Thread J.Alejandro Martinez Linares


El 19/12/13 19:22, Rémi Cura escribió:

it is a regular sql command :
use pgadmin or psql

vacuum full analyze;

Remi i'll do a full analysis vacuum to my DB ok.



To execute by pieces, there are many possibilities,
one would be to use pgscript.
The idea is to split your big query into smaller queries.

Remi
and , how can i do it, i mean, how can i split my big query, in the case 
of only this

CREATE TABLE SPLITED AS
SELECT ST_Split(b.the_geom,z.the_geom) AS the_geom
FROM public.mapa_base_141213 b, public.all_lines_merged z;


Cheers,
Rémi-C


2013/12/19 isla...@infomed.sld.cu mailto:isla...@infomed.sld.cu

Rémi Cura remi.c...@gmail.com mailto:remi.c...@gmail.com
escribió:


most likely you havn't !
I don't know your os so answering is difficult.

y have XP sp2, and 1Gb of ram, dual core 1.6ghz


If you have the size of fb free on list,
you can try a
VACUUM FULL ANALYZE

then try again =)
Other wise, you may have to do you computing piece by piece.

how can i do this


Cheers,
Rémi-C


2013/12/19 isla...@infomed.sld.cu
mailto:isla...@infomed.sld.cu

ok i execute this:
//
DROP TABLE IF EXISTS SPLITED;
CREATE TABLE SPLITED AS
SELECT ST_Split(b.the_geom,z.the_geom) AS the_geom
FROM public.mapa_base_141213 b, public.all_lines_merged z;
UPDATE SPLITED SET the_geom = ST_SetSRID(the_geom,4326);
SELECT Populate_Geometry_Columns('public.SPLITED'::regclass);
ALTER TABLE SPLITED ADD column gid serial;
ALTER TABLE SPLITED ADD COLUMN dato character varying;
ALTER TABLE SPLITED ADD PRIMARY KEY (gid);


DROP TABLE IF EXISTS collectionExtracted;
CREATE TABLE collectionExtracted AS
SELECT ST_CollectionExtract(b.the_geom,3) AS the_geom
FROM public.SPLITED b;
UPDATE SPLITED SET the_geom = ST_SetSRID(the_geom,4326);
SELECT
Populate_Geometry_Columns('public.collectionExtracted'::regclass);
ALTER TABLE collectionExtracted ADD column gid serial;
ALTER TABLE collectionExtracted ADD COLUMN dato character
varying;
ALTER TABLE collectionExtracted ADD PRIMARY KEY (gid);


DROP TABLE IF EXISTS dumped;
CREATE TABLE dumped AS
SELECT (ST_Dump(b.the_geom)).geom AS the_geom
FROM public.rad_solar_directa b;
UPDATE dumped SET the_geom = ST_SetSRID(the_geom,4326);
SELECT Populate_Geometry_Columns('public.dumped'::regclass);
ALTER TABLE dumped ADD column gid serial;
ALTER TABLE dumped ADD COLUMN dato character varying;
ALTER TABLE dumped ADD PRIMARY KEY (gid);
///---
and i get this error
//-
ERROR:  no se pudo extender el archivo
«base/604204/609808.5»: No space
left on device
HINT:  Verifique el espacio libre en disco.

** Error **

ERROR: no se pudo extender el archivo
«base/604204/609808.5»: No space
left on device
Estado SQL:53100
Sugerencias:Verifique el espacio libre en disco.

//
and i have 11,5Gb of free space what can i do to solve
this problem now.


--






This message was sent using IMP, the Internet Messaging Program.



--

Este mensaje le ha llegado mediante el servicio de correo
electronico que ofrece Infomed para respaldar el cumplimiento de
las misiones del Sistema Nacional de Salud. La persona que envia
este correo asume el compromiso de usar el servicio a tales fines
y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/






--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/
___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Re: [postgis-users] help with the Union of 2 shp

2013-12-19 Thread islanis

ok i execute this:
//
DROP TABLE IF EXISTS SPLITED;
CREATE TABLE SPLITED AS
SELECT ST_Split(b.the_geom,z.the_geom) AS the_geom
FROM public.mapa_base_141213 b, public.all_lines_merged z;
UPDATE SPLITED SET the_geom = ST_SetSRID(the_geom,4326);
SELECT Populate_Geometry_Columns('public.SPLITED'::regclass);
ALTER TABLE SPLITED ADD column gid serial;
ALTER TABLE SPLITED ADD COLUMN dato character varying;
ALTER TABLE SPLITED ADD PRIMARY KEY (gid);


DROP TABLE IF EXISTS collectionExtracted;
CREATE TABLE collectionExtracted AS
SELECT ST_CollectionExtract(b.the_geom,3) AS the_geom
FROM public.SPLITED b;
UPDATE SPLITED SET the_geom = ST_SetSRID(the_geom,4326);
SELECT Populate_Geometry_Columns('public.collectionExtracted'::regclass);
ALTER TABLE collectionExtracted ADD column gid serial;
ALTER TABLE collectionExtracted ADD COLUMN dato character varying;
ALTER TABLE collectionExtracted ADD PRIMARY KEY (gid);


DROP TABLE IF EXISTS dumped;
CREATE TABLE dumped AS
SELECT (ST_Dump(b.the_geom)).geom AS the_geom
FROM public.rad_solar_directa b;
UPDATE dumped SET the_geom = ST_SetSRID(the_geom,4326);
SELECT Populate_Geometry_Columns('public.dumped'::regclass);
ALTER TABLE dumped ADD column gid serial;
ALTER TABLE dumped ADD COLUMN dato character varying;
ALTER TABLE dumped ADD PRIMARY KEY (gid);
///---
and i get this error
//-
ERROR:  no se pudo extender el archivo «base/604204/609808.5»: No  
space left on device

HINT:  Verifique el espacio libre en disco.

** Error **

ERROR: no se pudo extender el archivo «base/604204/609808.5»: No space  
left on device

Estado SQL:53100
Sugerencias:Verifique el espacio libre en disco.

//
and i have 11,5Gb of free space what can i do to solve this problem now.


This message was sent using IMP, the Internet Messaging Program.


--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/


---BeginMessage---
I want to create little pieces of multipolygons from these 3 shapes  
(A,B and C)=result , result with all the sections formed with the  
intersection from the 3 shapes together, come on tell me , do you  
understand now what i want

thanks
no never mind am not offended, am trying that you understand Ok,  
here   are png of my 3 multipolygon shapes, what else do you need


Rémi Cura remi.c...@gmail.com escribió:


Sorry I'm  not trying to offend you.

For example in this thread
https://groups.google.com/forum/#!topic/postgis-users/9pozIoUAZuI
The asker posted an image to explain better.

Cheers,
Rémi-C


2013/12/12 isla...@infomed.sld.cu


no is not dificult to understand, what ever you want i'll give , just ask
what do you want to a better understanding. please i need it

Rémi Cura remi.c...@gmail.com escribió:


I'm very sorry it is difficult to understand what you mean.

Maybe with a real drawing and link here to it, or to some screenshots?
;-)

Cheers,

Rémi-C

2013/12/12 isla...@infomed.sld.cu

thanks for the quick answer Rémi, but, thats right thats one of answers,

but my idea was not complete,because there is a
3rd shape, your answer works fine for the 1st and 2dn shapes, but not
with
the 3rd, because the 3rd has not suares inside,
the 3rd shape have big triangles inside,the idea is that i need some
routine that merge or blend the spatial data and with it the attributes
of respective data, i need some ideas for do that, and am working on it,
but not sucess, please i need help, thanks for all.


1-the first shapefile
__
| |
| |
| 1   | shp=A
| |
| |
|_|
num of poligons=1


The one big country, this is a multipolygon shape

DATA=dni01 numeric,dni02 numeric,dni03 numeric,
 dni04 numeric,dni05 numeric,dni06 numeric,
 dni07 numeric,dni08 numeric,dni09 numeric,
 dni10 numeric,dni11 numeric,dni12 numeric,
 dniann numeric,the_geom geometry

2-and the second shapefile
__
| 2  |  2 |
|||
| 2  |  2 | shp=B
|||
| 2  |  2 |
|||
num of poligons = 6

The same country, but this time in little pieces, the states, this is a
multipolygon shape too

DATA=dni01 numeric,dni02 numeric,dni03 numeric,
 dni04 numeric,dni05 numeric,dni06 numeric,
 dni07 numeric,dni08 numeric,dni09 numeric,
 dni10 numeric,dni11 numeric,dni12 numeric,
 dniann numeric,the_geom geometry


3-and the second shapefile
__
|  /  |
| /

Re: [postgis-users] help with the Union of 2 shp

2013-12-19 Thread Rémi Cura
most likely you havn't !
I don't know your os so answering is difficult.

If you have the size of fb free on list,
you can try a
VACUUM FULL ANALYZE

then try again =)
Other wise, you may have to do you computing piece by piece.

Cheers,
Rémi-C


2013/12/19 isla...@infomed.sld.cu

 ok i execute this:
 //
 DROP TABLE IF EXISTS SPLITED;
 CREATE TABLE SPLITED AS
 SELECT ST_Split(b.the_geom,z.the_geom) AS the_geom
 FROM public.mapa_base_141213 b, public.all_lines_merged z;
 UPDATE SPLITED SET the_geom = ST_SetSRID(the_geom,4326);
 SELECT Populate_Geometry_Columns('public.SPLITED'::regclass);
 ALTER TABLE SPLITED ADD column gid serial;
 ALTER TABLE SPLITED ADD COLUMN dato character varying;
 ALTER TABLE SPLITED ADD PRIMARY KEY (gid);


 DROP TABLE IF EXISTS collectionExtracted;
 CREATE TABLE collectionExtracted AS
 SELECT ST_CollectionExtract(b.the_geom,3) AS the_geom
 FROM public.SPLITED b;
 UPDATE SPLITED SET the_geom = ST_SetSRID(the_geom,4326);
 SELECT Populate_Geometry_Columns('public.collectionExtracted'::regclass);
 ALTER TABLE collectionExtracted ADD column gid serial;
 ALTER TABLE collectionExtracted ADD COLUMN dato character varying;
 ALTER TABLE collectionExtracted ADD PRIMARY KEY (gid);


 DROP TABLE IF EXISTS dumped;
 CREATE TABLE dumped AS
 SELECT (ST_Dump(b.the_geom)).geom AS the_geom
 FROM public.rad_solar_directa b;
 UPDATE dumped SET the_geom = ST_SetSRID(the_geom,4326);
 SELECT Populate_Geometry_Columns('public.dumped'::regclass);
 ALTER TABLE dumped ADD column gid serial;
 ALTER TABLE dumped ADD COLUMN dato character varying;
 ALTER TABLE dumped ADD PRIMARY KEY (gid);
 ///---
 and i get this error
 //-
 ERROR:  no se pudo extender el archivo «base/604204/609808.5»: No space
 left on device
 HINT:  Verifique el espacio libre en disco.

 ** Error **

 ERROR: no se pudo extender el archivo «base/604204/609808.5»: No space
 left on device
 Estado SQL:53100
 Sugerencias:Verifique el espacio libre en disco.

 //
 and i have 11,5Gb of free space what can i do to solve this problem now.


 --

___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Re: [postgis-users] help with the Union of 2 shp

2013-12-19 Thread Rémi Cura
it is a regular sql command :
use pgadmin or psql

vacuum full analyze;


To execute by pieces, there are many possibilities,
one would be to use pgscript.
The idea is to split your big query into smaller queries.

Cheers,
Rémi-C


2013/12/19 isla...@infomed.sld.cu

 Rémi Cura remi.c...@gmail.com escribió:


  most likely you havn't !
 I don't know your os so answering is difficult.

 y have XP sp2, and 1Gb of ram, dual core 1.6ghz


 If you have the size of fb free on list,
 you can try a
 VACUUM FULL ANALYZE

 then try again =)
 Other wise, you may have to do you computing piece by piece.

 how can i do this


 Cheers,
 Rémi-C


 2013/12/19 isla...@infomed.sld.cu

  ok i execute this:
 //
 DROP TABLE IF EXISTS SPLITED;
 CREATE TABLE SPLITED AS
 SELECT ST_Split(b.the_geom,z.the_geom) AS the_geom
 FROM public.mapa_base_141213 b, public.all_lines_merged z;
 UPDATE SPLITED SET the_geom = ST_SetSRID(the_geom,4326);
 SELECT Populate_Geometry_Columns('public.SPLITED'::regclass);
 ALTER TABLE SPLITED ADD column gid serial;
 ALTER TABLE SPLITED ADD COLUMN dato character varying;
 ALTER TABLE SPLITED ADD PRIMARY KEY (gid);


 DROP TABLE IF EXISTS collectionExtracted;
 CREATE TABLE collectionExtracted AS
 SELECT ST_CollectionExtract(b.the_geom,3) AS the_geom
 FROM public.SPLITED b;
 UPDATE SPLITED SET the_geom = ST_SetSRID(the_geom,4326);
 SELECT Populate_Geometry_Columns('public.collectionExtracted'::
 regclass);
 ALTER TABLE collectionExtracted ADD column gid serial;
 ALTER TABLE collectionExtracted ADD COLUMN dato character varying;
 ALTER TABLE collectionExtracted ADD PRIMARY KEY (gid);


 DROP TABLE IF EXISTS dumped;
 CREATE TABLE dumped AS
 SELECT (ST_Dump(b.the_geom)).geom AS the_geom
 FROM public.rad_solar_directa b;
 UPDATE dumped SET the_geom = ST_SetSRID(the_geom,4326);
 SELECT Populate_Geometry_Columns('public.dumped'::regclass);
 ALTER TABLE dumped ADD column gid serial;
 ALTER TABLE dumped ADD COLUMN dato character varying;
 ALTER TABLE dumped ADD PRIMARY KEY (gid);
 ///---
 and i get this error
 //-
 ERROR:  no se pudo extender el archivo «base/604204/609808.5»: No space
 left on device
 HINT:  Verifique el espacio libre en disco.

 ** Error **

 ERROR: no se pudo extender el archivo «base/604204/609808.5»: No space
 left on device
 Estado SQL:53100
 Sugerencias:Verifique el espacio libre en disco.

 //
 and i have 11,5Gb of free space what can i do to solve this problem now.


 --





 
 This message was sent using IMP, the Internet Messaging Program.



 --

 Este mensaje le ha llegado mediante el servicio de correo electronico que
 ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema
 Nacional de Salud. La persona que envia este correo asume el compromiso de
 usar el servicio a tales fines y cumplir con las regulaciones establecidas

 Infomed: http://www.sld.cu/


___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Re: [postgis-users] help with the Union of 2 shp

2013-12-19 Thread J.Alejandro Martinez Linares


El 19/12/13 19:22, Rémi Cura escribió:

it is a regular sql command :
use pgadmin or psql

vacuum full analyze;

i'll do a full analysis vacuum to my DB ok.



To execute by pieces, there are many possibilities,
one would be to use pgscript.
The idea is to split your big query into smaller queries.
and , how can i do it, i mean, how can i split my big query, in the case 
of only this

CREATE TABLE SPLITED AS
SELECT ST_Split(b.the_geom,z.the_geom) AS the_geom
FROM public.mapa_base_141213 b, public.all_lines_merged z;

how can i do it


Cheers,
Rémi-C


2013/12/19 isla...@infomed.sld.cu mailto:isla...@infomed.sld.cu

Rémi Cura remi.c...@gmail.com mailto:remi.c...@gmail.com
escribió:


most likely you havn't !
I don't know your os so answering is difficult.

y have XP sp2, and 1Gb of ram, dual core 1.6ghz


If you have the size of fb free on list,
you can try a
VACUUM FULL ANALYZE

then try again =)
Other wise, you may have to do you computing piece by piece.

how can i do this


Cheers,
Rémi-C


2013/12/19 isla...@infomed.sld.cu
mailto:isla...@infomed.sld.cu

ok i execute this:
//
DROP TABLE IF EXISTS SPLITED;
CREATE TABLE SPLITED AS
SELECT ST_Split(b.the_geom,z.the_geom) AS the_geom
FROM public.mapa_base_141213 b, public.all_lines_merged z;
UPDATE SPLITED SET the_geom = ST_SetSRID(the_geom,4326);
SELECT Populate_Geometry_Columns('public.SPLITED'::regclass);
ALTER TABLE SPLITED ADD column gid serial;
ALTER TABLE SPLITED ADD COLUMN dato character varying;
ALTER TABLE SPLITED ADD PRIMARY KEY (gid);


DROP TABLE IF EXISTS collectionExtracted;
CREATE TABLE collectionExtracted AS
SELECT ST_CollectionExtract(b.the_geom,3) AS the_geom
FROM public.SPLITED b;
UPDATE SPLITED SET the_geom = ST_SetSRID(the_geom,4326);
SELECT
Populate_Geometry_Columns('public.collectionExtracted'::regclass);
ALTER TABLE collectionExtracted ADD column gid serial;
ALTER TABLE collectionExtracted ADD COLUMN dato character
varying;
ALTER TABLE collectionExtracted ADD PRIMARY KEY (gid);


DROP TABLE IF EXISTS dumped;
CREATE TABLE dumped AS
SELECT (ST_Dump(b.the_geom)).geom AS the_geom
FROM public.rad_solar_directa b;
UPDATE dumped SET the_geom = ST_SetSRID(the_geom,4326);
SELECT Populate_Geometry_Columns('public.dumped'::regclass);
ALTER TABLE dumped ADD column gid serial;
ALTER TABLE dumped ADD COLUMN dato character varying;
ALTER TABLE dumped ADD PRIMARY KEY (gid);
///---
and i get this error
//-
ERROR:  no se pudo extender el archivo
«base/604204/609808.5»: No space
left on device
HINT:  Verifique el espacio libre en disco.

** Error **

ERROR: no se pudo extender el archivo
«base/604204/609808.5»: No space
left on device
Estado SQL:53100
Sugerencias:Verifique el espacio libre en disco.

//
and i have 11,5Gb of free space what can i do to solve
this problem now.


--






This message was sent using IMP, the Internet Messaging Program.



--

Este mensaje le ha llegado mediante el servicio de correo
electronico que ofrece Infomed para respaldar el cumplimiento de
las misiones del Sistema Nacional de Salud. La persona que envia
este correo asume el compromiso de usar el servicio a tales fines
y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/






--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/
___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Re: [postgis-users] help with the Union of 2 shp

2013-12-17 Thread Rémi Cura
Juste use one or 2 polygon !
you can use limits on your first query,
or add a where condition with gid=XX, I guess you have a gid field (primary
key).

Cheers,
Rémi-C


2013/12/16 J.Alejandro Martinez Linares isla...@infomed.sld.cu


 El 16/12/13 14:38, Rémi Cura escribió:

 And of course it is *a very bad idea* to try something without knowing if
 it works on all your data !

  You should try the complete solution on a small sample, then optimize
 your queries, then use it on all your data...

  Cheers,

  Rémi-C

 ok ok, but there are 6570 rows of multipolygons, ok what can i do?, at
 least i need to know if the entire process is working, i mean like a
 progress bar, is there enything like that??!!! please and thanks

___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Re: [postgis-users] help with the Union of 2 shp

2013-12-17 Thread islanis

Rémi Cura remi.c...@gmail.com escribió:


Juste use one or 2 polygon !
you can use limits on your first query,
or add a where condition with gid=XX, I guess you have a gid field (primary
key).


ok i make this, and i get all suces but i can see what happening  
because i can see the answer in my quantumgis it say detecting... in  
the type of the table of my result, in this case in the  
all_lines_cuadrado_merged table, whats happening? please and thanks


*drop table if exists cuadrado;
CREATE TABLE cuadrado
AS (select ST_GeomFromText('MULTIPOLYGON(((-77 56,-52 18,-88 -27,-10  
-13,-11 38,-77 56)))',4326)as the_geom );

UPDATE cuadrado SET the_geom=ST_SetSRID(the_geom,4326);
SELECT Populate_Geometry_Columns('public.cuadrado'::regclass);
ALTER TABLE cuadrado ADD column gid serial;
ALTER TABLE cuadrado ADD COLUMN dato character varying;
ALTER TABLE cuadrado ADD PRIMARY KEY (gid);
UPDATE cuadrado SET dato='cuadrado' WHERE gid=1;

drop table if exists cuadrados;
CREATE TABLE cuadrados
AS (select ST_GeomFromText('MULTIPOLYGON(((-49 63,-32 24,-39 -7,-66  
-19,-72 -9,-74 31,-49 63)))',4326)as the_geom );

UPDATE cuadrados SET the_geom=ST_SetSRID(the_geom,4326);
SELECT Populate_Geometry_Columns('public.cuadrados'::regclass);
ALTER TABLE cuadrados ADD column gid serial;
ALTER TABLE cuadrados ADD COLUMN dato character varying;
ALTER TABLE cuadrados ADD PRIMARY KEY (gid);
UPDATE cuadrados SET dato='cuadrados' WHERE gid=1;

DROP TABLE IF EXISTS all_lines_cuadrado_merged;
CREATE TABLE all_lines_cuadrado_merged AS
SELECT ST_LineMerge(ST_ExteriorRing((ST_Dump(z.the_geom)).geom)) AS the_geom
FROM public.cuadrado z;
UPDATE all_lines_cuadrado_merged SET the_geom=ST_SetSRID(the_geom,4326);
SELECT  
Populate_Geometry_Columns('public.all_lines_cuadrado_merged'::regclass);

ALTER TABLE all_lines_cuadrado_merged ADD column gid serial;
ALTER TABLE all_lines_cuadrado_merged ADD COLUMN dato character varying;
ALTER TABLE all_lines_cuadrado_merged ADD PRIMARY KEY (gid);


DROP TABLE IF EXISTS cuadrados_parts;
CREATE TABLE cuadrados_parts AS
SELECT ST_Split(a.the_geom,z.the_geom) AS the_geom
FROM public.cuadrados a, public.all_lines_cuadrado_merged z;
UPDATE cuadrados_parts SET the_geom=ST_SetSRID(the_geom,4326);
SELECT Populate_Geometry_Columns('public.cuadrados_parts'::regclass);
ALTER TABLE cuadrados_parts ADD column gid serial;
ALTER TABLE cuadrados_parts ADD COLUMN dato character varying;
ALTER TABLE cuadrados_parts ADD PRIMARY KEY (gid);



Cheers,
Rémi-C


2013/12/16 J.Alejandro Martinez Linares isla...@infomed.sld.cu



El 16/12/13 14:38, Rémi Cura escribió:

And of course it is *a very bad idea* to try something without knowing if
it works on all your data !

 You should try the complete solution on a small sample, then optimize
your queries, then use it on all your data...

 Cheers,

 Rémi-C

ok ok, but there are 6570 rows of multipolygons, ok what can i do?, at
least i need to know if the entire process is working, i mean like a
progress bar, is there enything like that??!!! please and thanks








This message was sent using IMP, the Internet Messaging Program.



--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Re: [postgis-users] help with the Union of 2 shp

2013-12-17 Thread Rémi Cura
Most likely,
in your last step,
cuadrados_parts :
there is not guaranteed type to the_geom :
it could be multi, simple, line, point, etc etc.

So if you expect polygon, use ST_CollectionExtract(the_geom,3)
Then use (ST_Dump()).geom to break appart multi polygon if you want to
(thus making something like
(ST_Dump(ST_CollectionExtract(the_geom,3))).geom AS the_geom
)
(you will need to generate an unique ID, see
http://trac.osgeo.org/postgis/wiki/UsersWikiQGIS
 row_number() OVER() AS id_qgis
;-) )


2013/12/17 isla...@infomed.sld.cu

 Rémi Cura remi.c...@gmail.com escribió:


  Juste use one or 2 polygon !
 you can use limits on your first query,
 or add a where condition with gid=XX, I guess you have a gid field
 (primary
 key).


 ok i make this, and i get all suces but i can see what happening because i
 can see the answer in my quantumgis it say detecting... in the type of
 the table of my result, in this case in the all_lines_cuadrado_merged
 table, whats happening? please and thanks

 *drop table if exists cuadrado;
 CREATE TABLE cuadrado
 AS (select ST_GeomFromText('MULTIPOLYGON(((-77 56,-52 18,-88 -27,-10
 -13,-11 38,-77 56)))',4326)as the_geom );
 UPDATE cuadrado SET the_geom=ST_SetSRID(the_geom,4326);
 SELECT Populate_Geometry_Columns('public.cuadrado'::regclass);
 ALTER TABLE cuadrado ADD column gid serial;
 ALTER TABLE cuadrado ADD COLUMN dato character varying;
 ALTER TABLE cuadrado ADD PRIMARY KEY (gid);
 UPDATE cuadrado SET dato='cuadrado' WHERE gid=1;

 drop table if exists cuadrados;
 CREATE TABLE cuadrados
 AS (select ST_GeomFromText('MULTIPOLYGON(((-49 63,-32 24,-39 -7,-66
 -19,-72 -9,-74 31,-49 63)))',4326)as the_geom );
 UPDATE cuadrados SET the_geom=ST_SetSRID(the_geom,4326);
 SELECT Populate_Geometry_Columns('public.cuadrados'::regclass);
 ALTER TABLE cuadrados ADD column gid serial;
 ALTER TABLE cuadrados ADD COLUMN dato character varying;
 ALTER TABLE cuadrados ADD PRIMARY KEY (gid);
 UPDATE cuadrados SET dato='cuadrados' WHERE gid=1;

 DROP TABLE IF EXISTS all_lines_cuadrado_merged;
 CREATE TABLE all_lines_cuadrado_merged AS
 SELECT ST_LineMerge(ST_ExteriorRing((ST_Dump(z.the_geom)).geom)) AS
 the_geom
 FROM public.cuadrado z;
 UPDATE all_lines_cuadrado_merged SET the_geom=ST_SetSRID(the_geom,4326);
 SELECT Populate_Geometry_Columns('public.all_lines_cuadrado_
 merged'::regclass);
 ALTER TABLE all_lines_cuadrado_merged ADD column gid serial;
 ALTER TABLE all_lines_cuadrado_merged ADD COLUMN dato character varying;
 ALTER TABLE all_lines_cuadrado_merged ADD PRIMARY KEY (gid);


 DROP TABLE IF EXISTS cuadrados_parts;
 CREATE TABLE cuadrados_parts AS
 SELECT ST_Split(a.the_geom,z.the_geom) AS the_geom
 FROM public.cuadrados a, public.all_lines_cuadrado_merged z;
 UPDATE cuadrados_parts SET the_geom=ST_SetSRID(the_geom,4326);
 SELECT Populate_Geometry_Columns('public.cuadrados_parts'::regclass);
 ALTER TABLE cuadrados_parts ADD column gid serial;
 ALTER TABLE cuadrados_parts ADD COLUMN dato character varying;
 ALTER TABLE cuadrados_parts ADD PRIMARY KEY (gid);


 Cheers,
 Rémi-C


 2013/12/16 J.Alejandro Martinez Linares isla...@infomed.sld.cu


 El 16/12/13 14:38, Rémi Cura escribió:

 And of course it is *a very bad idea* to try something without knowing if

 it works on all your data !

  You should try the complete solution on a small sample, then optimize
 your queries, then use it on all your data...

  Cheers,

  Rémi-C

 ok ok, but there are 6570 rows of multipolygons, ok what can i do?, at
 least i need to know if the entire process is working, i mean like a
 progress bar, is there enything like that??!!! please and thanks





 
 This message was sent using IMP, the Internet Messaging Program.



 --

 Este mensaje le ha llegado mediante el servicio de correo electronico que
 ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema
 Nacional de Salud. La persona que envia este correo asume el compromiso de
 usar el servicio a tales fines y cumplir con las regulaciones establecidas

 Infomed: http://www.sld.cu/


___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Re: [postgis-users] help with the Union of 2 shp

2013-12-16 Thread J.Alejandro Martinez Linares


El 16/12/13 14:38, Rémi Cura escribió:
And of course it is *a very bad idea* to try something without knowing 
if it works on all your data !


You should try the complete solution on a small sample, then optimize 
your queries, then use it on all your data...


Cheers,

Rémi-C
ok ok, but there are 6570 rows of multipolygons, ok what can i do?, at 
least i need to know if the entire process is working, i mean like a 
progress bar, is there enything like that??!!! please and thanks



--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/
___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Re: [postgis-users] help with the Union of 2 shp

2013-12-12 Thread islanis

Hi,

Try pg 21 of this:  
http://presentations.opengeo.org/2011_FOSS4G/postgis-power.pdf


That will give you the metacode.

Overlays. (he sighs.)  Be glad you only have 2 layers... .

Best,
Steve
Hey steve thanks for the book is really good as a resume, but the only  
apart that it have to do with my problem is the intersection of 2 shapes

SELECT
a.*, b.*,
ST_Intersection(a.geom, b.geom)
FROM
a, b
WHERE
ST_Intersects(a.geom, b.geom);

but my problem  is different, i got as a mention 2 shapes with the  
same projection and place,
and are the same but one is from one study, and the other is from  
other stufy, but are the same
place and each one have data, the only things that they got different  
are the size of the squares,the data they got and the
name of the columns are the same, but the values are different cause  
the type of the study
,there is one that have the squares more smaller that the other, but i  
dont want lose any data, i need that in the map it has seen like
 the figure A and B but in the data each row got the values of A  
and the values of B


 1-the first shapefile
 __
 | |
 | |
 | 1   | shp=A
 | |
 | |
 |_|

 The one big country, this is a multipolygon shape

 DATA=dni01 numeric,dni02 numeric,dni03 numeric,
   dni04 numeric,dni05 numeric,dni06 numeric,
   dni07 numeric,dni08 numeric,dni09 numeric,
   dni10 numeric,dni11 numeric,dni12 numeric,
   dniann numeric,the_geom geometry

 2-and the second shapefile
 __
 | 2  |  2 |
 |||
 | 2  |  2 | shp=B
 |||
 | 2  |  2 |
 |||
 The same country, but this time in little pieces, the states, this  
is a multipolygon shape too


 DATA=dni01 numeric,dni02 numeric,dni03 numeric,
   dni04 numeric,dni05 numeric,dni06 numeric,
   dni07 numeric,dni08 numeric,dni09 numeric,
   dni10 numeric,dni11 numeric,dni12 numeric,
   dniann numeric,the_geom geometry

 and i want join the 2 shapes in only one shapefile getting something  
like this


 __
 |1,2 |   1,2  |
 |||
 |1,2 |   1,2  | shp=A and B
 |||
 |1,2 |   1,2  |
 |||

DATA=dni01A numeric,dni02A numeric,dni03A numeric,dni04A numeric,
  dni05A numeric,dni06A numeric,dni07A numeric,dni08A numeric,
  dni09A numeric,dni10A numeric,dni11A numeric,dni12A numeric,
  dniannA numeric,dni01B numeric,dni02B numeric,dni03B numeric,
  dni04B numeric,dni05B numeric,dni06B numeric,dni07B numeric,
  dni08B numeric,dni09B numeric,dni10B numeric,dni11B numeric,
  dni12B numeric,dniannB numeric,the_geom geometry

 i think that this is posible to do with postgis, but i dont know  
why, am looking in quantumGIS but i lose data cause the big suare  
overlap the little

 ones and i lose data cause there is some places that i get NULL.

 please help
 thanks for all







On Mon, Dec 9, 2013 at 11:03 AM, J.Alejandro Martinez Linares  
isla...@infomed.sld.cu wrote:


   Hi People, i need your help, let say that i have 2 shapefiles

   1-the first shapefile
   __
   | |
   | |
   | 1   | shp=B
   | |
   | |
   |_|

   One big country, this is a multipolygon shape

   2-and the second shapefile
   __
   | 2  |  2 |
   |||
   | 2  |  2 | shp=B
   |||
   | 2  |  2 |
   |||
   The same country, but this time in little pieces, the states,  
this is a multipolygon shape too


   and i want join the 2 shapes in only one shapefile getting  
something like this


   __
   |1,2 |   1,2  |
   |||
   |1,2 |   1,2  | shp=A and B
   |||
   |1,2 |   1,2  |
   |||

   i think that this is posible, please help me to get somthing  
like this i need it.




   --

   Este mensaje le ha llegado mediante el servicio de correo  
electronico que ofrece Infomed para respaldar el cumplimiento de  
las misiones del Sistema Nacional de Salud. La persona que envia  
este correo asume el compromiso de usar el servicio a tales fines y  
cumplir con las regulaciones establecidas


   Infomed: http://www.sld.cu/

   ___
   postgis-users mailing list
   postgis-users@lists.osgeo.org
   http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users







This message was sent using IMP, the Internet Messaging Program.


--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso 

Re: [postgis-users] help with the Union of 2 shp

2013-12-12 Thread Rémi Cura
Seems like If you want :
for each little square, get the id of big square overlaping.
If this is simply this, you don't need the intersection function,
but only the intersects function :

You could do something like this

SELECT ss.id, bs.id , ss.geom
FROM smal_square_table AS ss, big_square_table AS bs
WHERE ST_Intersects(ss.geom,bs.geom)=TRUE

Cheers,
Rémi-C




2013/12/12 isla...@infomed.sld.cu

 Hi,

 Try pg 21 of this: http://presentations.opengeo.
 org/2011_FOSS4G/postgis-power.pdf

 That will give you the metacode.

 Overlays. (he sighs.)  Be glad you only have 2 layers... .

 Best,
 Steve

 Hey steve thanks for the book is really good as a resume, but the only
 apart that it have to do with my problem is the intersection of 2 shapes
 SELECT
 a.*, b.*,
 ST_Intersection(a.geom, b.geom)
 FROM
 a, b
 WHERE
 ST_Intersects(a.geom, b.geom);

 but my problem  is different, i got as a mention 2 shapes with the same
 projection and place,
 and are the same but one is from one study, and the other is from other
 stufy, but are the same
 place and each one have data, the only things that they got different are
 the size of the squares,the data they got and the
 name of the columns are the same, but the values are different cause the
 type of the study
 ,there is one that have the squares more smaller that the other, but i
 dont want lose any data, i need that in the map it has seen like
  the figure A and B but in the data each row got the values of A and the
 values of B

  1-the first shapefile
  __
  | |
  | |
  | 1   | shp=A
  | |
  | |
  |_|

  The one big country, this is a multipolygon shape

  DATA=dni01 numeric,dni02 numeric,dni03 numeric,
dni04 numeric,dni05 numeric,dni06 numeric,
dni07 numeric,dni08 numeric,dni09 numeric,
dni10 numeric,dni11 numeric,dni12 numeric,
dniann numeric,the_geom geometry


  2-and the second shapefile
  __
  | 2  |  2 |
  |||
  | 2  |  2 | shp=B
  |||
  | 2  |  2 |
  |||
  The same country, but this time in little pieces, the states, this is a
 multipolygon shape too

  DATA=dni01 numeric,dni02 numeric,dni03 numeric,
dni04 numeric,dni05 numeric,dni06 numeric,
dni07 numeric,dni08 numeric,dni09 numeric,
dni10 numeric,dni11 numeric,dni12 numeric,
dniann numeric,the_geom geometry


  and i want join the 2 shapes in only one shapefile getting something like
 this

  __
  |1,2 |   1,2  |
  |||
  |1,2 |   1,2  | shp=A and B
  |||
  |1,2 |   1,2  |
  |||

 DATA=dni01A numeric,dni02A numeric,dni03A numeric,dni04A numeric,
   dni05A numeric,dni06A numeric,dni07A numeric,dni08A numeric,
   dni09A numeric,dni10A numeric,dni11A numeric,dni12A numeric,
   dniannA numeric,dni01B numeric,dni02B numeric,dni03B numeric,
   dni04B numeric,dni05B numeric,dni06B numeric,dni07B numeric,
   dni08B numeric,dni09B numeric,dni10B numeric,dni11B numeric,
   dni12B numeric,dniannB numeric,the_geom geometry

  i think that this is posible to do with postgis, but i dont know why, am
 looking in quantumGIS but i lose data cause the big suare overlap the little
  ones and i lose data cause there is some places that i get NULL.

  please help
  thanks for all







  On Mon, Dec 9, 2013 at 11:03 AM, J.Alejandro Martinez Linares 
 isla...@infomed.sld.cu wrote:

Hi People, i need your help, let say that i have 2 shapefiles

1-the first shapefile
__
| |
| |
| 1   | shp=B
| |
| |
|_|

One big country, this is a multipolygon shape

2-and the second shapefile
__
| 2  |  2 |
|||
| 2  |  2 | shp=B
|||
| 2  |  2 |
|||
The same country, but this time in little pieces, the states, this is
 a multipolygon shape too

and i want join the 2 shapes in only one shapefile getting something
 like this

__
|1,2 |   1,2  |
|||
|1,2 |   1,2  | shp=A and B
|||
|1,2 |   1,2  |
|||

i think that this is posible, please help me to get somthing like
 this i need it.



--

Este mensaje le ha llegado mediante el servicio de correo electronico
 que ofrece Infomed para respaldar el cumplimiento de las misiones del
 Sistema Nacional de Salud. La persona que envia este correo asume el
 compromiso de usar el servicio a tales fines y cumplir con las regulaciones
 establecidas

Infomed: http://www.sld.cu/

___

Re: [postgis-users] help with the Union of 2 shp

2013-12-12 Thread Rémi Cura
I'm very sorry it is difficult to understand what you mean.
Maybe with a real drawing and link here to it, or to some screenshots?
 ;-)

Cheers,

Rémi-C

2013/12/12 isla...@infomed.sld.cu

 thanks for the quick answer Rémi, but, thats right thats one of answers,
 but my idea was not complete,because there is a
 3rd shape, your answer works fine for the 1st and 2dn shapes, but not with
 the 3rd, because the 3rd has not suares inside,
 the 3rd shape have big triangles inside,the idea is that i need some
 routine that merge or blend the spatial data and with it the attributes
 of respective data, i need some ideas for do that, and am working on it,
 but not sucess, please i need help, thanks for all.


  1-the first shapefile
  __
  | |
  | |
  | 1   | shp=A
  | |
  | |
  |_|
 num of poligons=1


  The one big country, this is a multipolygon shape

  DATA=dni01 numeric,dni02 numeric,dni03 numeric,
dni04 numeric,dni05 numeric,dni06 numeric,
dni07 numeric,dni08 numeric,dni09 numeric,
dni10 numeric,dni11 numeric,dni12 numeric,
dniann numeric,the_geom geometry

  2-and the second shapefile
  __
  | 2  |  2 |
  |||
  | 2  |  2 | shp=B
  |||
  | 2  |  2 |
  |||
  num of poligons = 6

  The same country, but this time in little pieces, the states, this is a
 multipolygon shape too

  DATA=dni01 numeric,dni02 numeric,dni03 numeric,
dni04 numeric,dni05 numeric,dni06 numeric,
dni07 numeric,dni08 numeric,dni09 numeric,
dni10 numeric,dni11 numeric,dni12 numeric,
dniann numeric,the_geom geometry


  3-and the second shapefile
  __
  |  /  |
  | /   |
  |   3/| shp=C
  |   / |
  |  / 4|
  |_/___|
  num of poligons = 2

  The same country, but this time in little pieces, the states, this is a
 multipolygon shape too

  DATA=dni01 numeric,dni02 numeric,dni03 numeric,
dni04 numeric,dni05 numeric,dni06 numeric,
dni07 numeric,dni08 numeric,dni09 numeric,
dni10 numeric,dni11 numeric,dni12 numeric,
dniann numeric,the_geom geometry



  and i want join the 2 shapes in only one shapefile getting something like
 this

  __
  |  |/ |
  |  |1,2,3  /  |
  |1,2,3 |  /1,2,4  |
  |  | /|
  |__|/_|
  |  |1,2/  | shp=A and B
  |  |,3/   |
  |1,2,3 | / 1,2,4  |
  |  |/ |
  |__/__|
  | /|  |
  |/ |  |
  |1,2,3  /1,|   1,2,4  |
  |  /2,4|  |
  |_/|__|
 num of poligons = 9


 DATA=dni01A numeric,dni02A numeric,dni03A numeric,dni04A numeric,
   dni05A numeric,dni06A numeric,dni07A numeric,dni08A numeric,
   dni09A numeric,dni10A numeric,dni11A numeric,dni12A numeric,
   dniannA numeric,dni01B numeric,dni02B numeric,dni03B numeric,
   dni04B numeric,dni05B numeric,dni06B numeric,dni07B numeric,
   dni08B numeric,dni09B numeric,dni10B numeric,dni11B numeric,
   dni12B numeric,dniannB numeric,dni01C numeric,dni02C numeric,
   dni03C numeric,dni04C numeric,dni05C numeric,dni06C numeric,
   dni07C numeric,dni08C numeric,dni09C numeric,dni10C numeric,
   dni11C numeric,dni12C numeric,dniannC numeric,the_geom geometry

 Rémi Cura remi.c...@gmail.com escribió:


  Seems like If you want :
 for each little square, get the id of big square overlaping.
 If this is simply this, you don't need the intersection function,
 but only the intersects function :

 You could do something like this

 SELECT ss.id, bs.id , ss.geom
 FROM smal_square_table AS ss, big_square_table AS bs
 WHERE ST_Intersects(ss.geom,bs.geom)=TRUE

 Cheers,
 Rémi-C




 2013/12/12 isla...@infomed.sld.cu

  Hi,


 Try pg 21 of this: http://presentations.opengeo.
 org/2011_FOSS4G/postgis-power.pdf

 That will give you the metacode.

 Overlays. (he sighs.)  Be glad you only have 2 layers... .

 Best,
 Steve

  Hey steve thanks for the book is really good as a resume, but the only
 apart that it have to do with my problem is the intersection of 2 shapes
 SELECT
 a.*, b.*,
 ST_Intersection(a.geom, b.geom)
 FROM
 a, b
 WHERE
 ST_Intersects(a.geom, b.geom);

 but my problem  is different, i got as a mention 2 shapes with the same
 projection and place,
 and are the same but one is from one study, and the other is from other
 stufy, but are the same
 place and each one have data, the only things that they got different are
 the size of the squares,the data they got and the
 name of the columns are the same, but the values are different cause the
 type 

Re: [postgis-users] help with the Union of 2 shp

2013-12-12 Thread islanis
no is not dificult to understand, what ever you want i'll give , just  
ask what do you want to a better understanding. please i need it


Rémi Cura remi.c...@gmail.com escribió:


I'm very sorry it is difficult to understand what you mean.
Maybe with a real drawing and link here to it, or to some screenshots?
 ;-)

Cheers,

Rémi-C

2013/12/12 isla...@infomed.sld.cu


thanks for the quick answer Rémi, but, thats right thats one of answers,
but my idea was not complete,because there is a
3rd shape, your answer works fine for the 1st and 2dn shapes, but not with
the 3rd, because the 3rd has not suares inside,
the 3rd shape have big triangles inside,the idea is that i need some
routine that merge or blend the spatial data and with it the attributes
of respective data, i need some ideas for do that, and am working on it,
but not sucess, please i need help, thanks for all.


 1-the first shapefile
 __
 | |
 | |
 | 1   | shp=A
 | |
 | |
 |_|
num of poligons=1


 The one big country, this is a multipolygon shape

 DATA=dni01 numeric,dni02 numeric,dni03 numeric,
   dni04 numeric,dni05 numeric,dni06 numeric,
   dni07 numeric,dni08 numeric,dni09 numeric,
   dni10 numeric,dni11 numeric,dni12 numeric,
   dniann numeric,the_geom geometry

 2-and the second shapefile
 __
 | 2  |  2 |
 |||
 | 2  |  2 | shp=B
 |||
 | 2  |  2 |
 |||
 num of poligons = 6

 The same country, but this time in little pieces, the states, this is a
multipolygon shape too

 DATA=dni01 numeric,dni02 numeric,dni03 numeric,
   dni04 numeric,dni05 numeric,dni06 numeric,
   dni07 numeric,dni08 numeric,dni09 numeric,
   dni10 numeric,dni11 numeric,dni12 numeric,
   dniann numeric,the_geom geometry


 3-and the second shapefile
 __
 |  /  |
 | /   |
 |   3/| shp=C
 |   / |
 |  / 4|
 |_/___|
 num of poligons = 2

 The same country, but this time in little pieces, the states, this is a
multipolygon shape too

 DATA=dni01 numeric,dni02 numeric,dni03 numeric,
   dni04 numeric,dni05 numeric,dni06 numeric,
   dni07 numeric,dni08 numeric,dni09 numeric,
   dni10 numeric,dni11 numeric,dni12 numeric,
   dniann numeric,the_geom geometry



 and i want join the 2 shapes in only one shapefile getting something like
this

 __
 |  |/ |
 |  |1,2,3  /  |
 |1,2,3 |  /1,2,4  |
 |  | /|
 |__|/_|
 |  |1,2/  | shp=A and B
 |  |,3/   |
 |1,2,3 | / 1,2,4  |
 |  |/ |
 |__/__|
 | /|  |
 |/ |  |
 |1,2,3  /1,|   1,2,4  |
 |  /2,4|  |
 |_/|__|
num of poligons = 9


DATA=dni01A numeric,dni02A numeric,dni03A numeric,dni04A numeric,
  dni05A numeric,dni06A numeric,dni07A numeric,dni08A numeric,
  dni09A numeric,dni10A numeric,dni11A numeric,dni12A numeric,
  dniannA numeric,dni01B numeric,dni02B numeric,dni03B numeric,
  dni04B numeric,dni05B numeric,dni06B numeric,dni07B numeric,
  dni08B numeric,dni09B numeric,dni10B numeric,dni11B numeric,
  dni12B numeric,dniannB numeric,dni01C numeric,dni02C numeric,
  dni03C numeric,dni04C numeric,dni05C numeric,dni06C numeric,
  dni07C numeric,dni08C numeric,dni09C numeric,dni10C numeric,
  dni11C numeric,dni12C numeric,dniannC numeric,the_geom geometry

Rémi Cura remi.c...@gmail.com escribió:


 Seems like If you want :

for each little square, get the id of big square overlaping.
If this is simply this, you don't need the intersection function,
but only the intersects function :

You could do something like this

SELECT ss.id, bs.id , ss.geom
FROM smal_square_table AS ss, big_square_table AS bs
WHERE ST_Intersects(ss.geom,bs.geom)=TRUE

Cheers,
Rémi-C




2013/12/12 isla...@infomed.sld.cu

 Hi,




Try pg 21 of this: http://presentations.opengeo.
org/2011_FOSS4G/postgis-power.pdf

That will give you the metacode.

Overlays. (he sighs.)  Be glad you only have 2 layers... .

Best,
Steve

 Hey steve thanks for the book is really good as a resume, but the only

apart that it have to do with my problem is the intersection of 2 shapes
SELECT
a.*, b.*,
ST_Intersection(a.geom, b.geom)
FROM
a, b
WHERE
ST_Intersects(a.geom, b.geom);

but my problem  is different, i got as a mention 2 shapes with the same
projection and place,
and are the same but one is from one study, and the other is from other
stufy, but are the same
place and each one have data, the only things that they got different are
the size of the squares,the data they got and the
name of the 

Re: [postgis-users] help with the Union of 2 shp

2013-12-12 Thread Rémi Cura
Sorry I'm  not trying to offend you.

For example in this thread
https://groups.google.com/forum/#!topic/postgis-users/9pozIoUAZuI
The asker posted an image to explain better.

Cheers,
Rémi-C


2013/12/12 isla...@infomed.sld.cu

 no is not dificult to understand, what ever you want i'll give , just ask
 what do you want to a better understanding. please i need it

 Rémi Cura remi.c...@gmail.com escribió:


  I'm very sorry it is difficult to understand what you mean.
 Maybe with a real drawing and link here to it, or to some screenshots?
  ;-)

 Cheers,

 Rémi-C

 2013/12/12 isla...@infomed.sld.cu

  thanks for the quick answer Rémi, but, thats right thats one of answers,
 but my idea was not complete,because there is a
 3rd shape, your answer works fine for the 1st and 2dn shapes, but not
 with
 the 3rd, because the 3rd has not suares inside,
 the 3rd shape have big triangles inside,the idea is that i need some
 routine that merge or blend the spatial data and with it the attributes
 of respective data, i need some ideas for do that, and am working on it,
 but not sucess, please i need help, thanks for all.


  1-the first shapefile
  __
  | |
  | |
  | 1   | shp=A
  | |
  | |
  |_|
 num of poligons=1


  The one big country, this is a multipolygon shape

  DATA=dni01 numeric,dni02 numeric,dni03 numeric,
dni04 numeric,dni05 numeric,dni06 numeric,
dni07 numeric,dni08 numeric,dni09 numeric,
dni10 numeric,dni11 numeric,dni12 numeric,
dniann numeric,the_geom geometry

  2-and the second shapefile
  __
  | 2  |  2 |
  |||
  | 2  |  2 | shp=B
  |||
  | 2  |  2 |
  |||
  num of poligons = 6

  The same country, but this time in little pieces, the states, this is a
 multipolygon shape too

  DATA=dni01 numeric,dni02 numeric,dni03 numeric,
dni04 numeric,dni05 numeric,dni06 numeric,
dni07 numeric,dni08 numeric,dni09 numeric,
dni10 numeric,dni11 numeric,dni12 numeric,
dniann numeric,the_geom geometry


  3-and the second shapefile
  __
  |  /  |
  | /   |
  |   3/| shp=C
  |   / |
  |  / 4|
  |_/___|
  num of poligons = 2

  The same country, but this time in little pieces, the states, this is a
 multipolygon shape too

  DATA=dni01 numeric,dni02 numeric,dni03 numeric,
dni04 numeric,dni05 numeric,dni06 numeric,
dni07 numeric,dni08 numeric,dni09 numeric,
dni10 numeric,dni11 numeric,dni12 numeric,
dniann numeric,the_geom geometry



  and i want join the 2 shapes in only one shapefile getting something
 like
 this

  __
  |  |/ |
  |  |1,2,3  /  |
  |1,2,3 |  /1,2,4  |
  |  | /|
  |__|/_|
  |  |1,2/  | shp=A and B
  |  |,3/   |
  |1,2,3 | / 1,2,4  |
  |  |/ |
  |__/__|
  | /|  |
  |/ |  |
  |1,2,3  /1,|   1,2,4  |
  |  /2,4|  |
  |_/|__|
 num of poligons = 9


 DATA=dni01A numeric,dni02A numeric,dni03A numeric,dni04A numeric,
   dni05A numeric,dni06A numeric,dni07A numeric,dni08A numeric,
   dni09A numeric,dni10A numeric,dni11A numeric,dni12A numeric,
   dniannA numeric,dni01B numeric,dni02B numeric,dni03B numeric,
   dni04B numeric,dni05B numeric,dni06B numeric,dni07B numeric,
   dni08B numeric,dni09B numeric,dni10B numeric,dni11B numeric,
   dni12B numeric,dniannB numeric,dni01C numeric,dni02C numeric,
   dni03C numeric,dni04C numeric,dni05C numeric,dni06C numeric,
   dni07C numeric,dni08C numeric,dni09C numeric,dni10C numeric,
   dni11C numeric,dni12C numeric,dniannC numeric,the_geom geometry

 Rémi Cura remi.c...@gmail.com escribió:


  Seems like If you want :

 for each little square, get the id of big square overlaping.
 If this is simply this, you don't need the intersection function,
 but only the intersects function :

 You could do something like this

 SELECT ss.id, bs.id , ss.geom
 FROM smal_square_table AS ss, big_square_table AS bs
 WHERE ST_Intersects(ss.geom,bs.geom)=TRUE

 Cheers,
 Rémi-C




 2013/12/12 isla...@infomed.sld.cu

  Hi,



 Try pg 21 of this: http://presentations.opengeo.
 org/2011_FOSS4G/postgis-power.pdf

 That will give you the metacode.

 Overlays. (he sighs.)  Be glad you only have 2 layers... .

 Best,
 Steve

  Hey steve thanks for the book is really good as a resume, but the
 only

 apart that it have to do with my problem is the intersection of 2
 shapes
 SELECT
 a.*, b.*,
 ST_Intersection(a.geom, b.geom)
 FROM
 a, b
 WHERE
 

[postgis-users] help with the Union of 2 shp

2013-12-09 Thread J.Alejandro Martinez Linares

Hi People, i need your help, let say that i have 2 shapefiles

1-the first shapefile
__
|   |
|   |
|1 | shp=B
|   |
|   |
|_|

One big country, this is a multipolygon shape

2-and the second shapefile
__
| 2  |  2 |
|||
| 2  |  2 | shp=B
|||
| 2  |  2 |
|||
The same country, but this time in little pieces, the states, this is a 
multipolygon shape too


and i want join the 2 shapes in only one shapefile getting something 
like this


__
|1,2|  1,2  |
|||
|1,2|  1,2  | shp=A and B
|||
|1,2|  1,2  |
|||

i think that this is posible, please help me to get somthing like this i 
need it.




--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users


Re: [postgis-users] help with the Union of 2 shp

2013-12-09 Thread J.Alejandro Martinez Linares


El 10/12/13 02:06, Stephen Mather escribió:

Hi,

Try pg 21 of this: 
http://presentations.opengeo.org/2011_FOSS4G/postgis-power.pdf


That will give you the metacode.
thanks for the answer but, i have no internet, i dont understand what do 
you mean, please





Overlays. (he sighs.)  Be glad you only have 2 layers... .

Best,
Steve




On Mon, Dec 9, 2013 at 11:03 AM, J.Alejandro Martinez Linares 
isla...@infomed.sld.cu mailto:isla...@infomed.sld.cu wrote:


Hi People, i need your help, let say that i have 2 shapefiles

1-the first shapefile
__
| |
| |
| 1   | shp=B
| |
| |
|_|

One big country, this is a multipolygon shape

2-and the second shapefile
__
| 2  |  2 |
|||
| 2  |  2 | shp=B
|||
| 2  |  2 |
|||
The same country, but this time in little pieces, the states, this
is a multipolygon shape too

and i want join the 2 shapes in only one shapefile getting
something like this

__
|1,2 |   1,2  |
|||
|1,2 |   1,2  | shp=A and B
|||
|1,2 |   1,2  |
|||

i think that this is posible, please help me to get somthing like
this i need it.



--

Este mensaje le ha llegado mediante el servicio de correo
electronico que ofrece Infomed para respaldar el cumplimiento de
las misiones del Sistema Nacional de Salud. La persona que envia
este correo asume el compromiso de usar el servicio a tales fines
y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

___
postgis-users mailing list
postgis-users@lists.osgeo.org mailto:postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users




___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users




--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/
___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users