Nick Ves | 23 Apr 11:25 2015
Picon

Create common vertexes between shared polygon boundaries in PostGis?

Given two polygon tables L1 (blue) and L2 (red) that  share a common
boundary but different vertexes how can one make the common boundary
identical (they should share the same vertexes) ?

 reference picture:  http://i.stack.imgur.com/11Eq6.png
Albury, Carl -FS | 21 Apr 18:18 2015
Picon

Re: ST_Value on tiled raster

Hi

I’m new to PostGIS  so please bear with me.

I’m working with MODIS data that I tiled using the auto tile switch in raster2pgsql resulting in 13250 82x94 tiles.

When I try to query for pixel values using ST_Value, such as:

 

SELECT

    ST_Value(rast, 2, 1,1) -- multiband raster

FROM

  MODIS_test;

 

I get a value for each tile, not for each pixel (I assume the value is for the first pixel in the tile?).

If I want to query each pixel do I need to loop through each tile and have a sub loop for each pixel in that tile? If so I can’t figure out the syntax to designate the tiles vs pixels.

 

Thanks very much,

Carl

 

_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Beekk Meess | 21 Apr 12:12 2015
Picon

viewing 3D data

hello, i have a 3 d data tables, node(znode), polygonz and volume(polyhedralsurface) . how can i display
this tables in 3d.
Nick Ves | 21 Apr 10:58 2015
Picon

Equality operator for type box2d

I was playing with the ST_Extent today and I wanted to try a query like this:

select distinct ST_Extent(geom)  over () box from parcels_test

where the geom is Type ST_Polygon but I got this error instead:

  ERROR:  could not identify an equality operator for type box2d

The aim was to get the BBox from a set of polygons that might or might
not be adjutant. Ofc you can get the same results by limit the result
to 1 but, it hitted me strange box2d type not having an equal operator

using "POSTGIS="2.1.4 r12966" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel.
4.8.0, 6 March 2012" GDAL="GDAL 1.11.1, released 2014/09/24"
LIBXML="2.9.1" LIBJSON="UNKNOWN" RASTER"
Martin Landa | 21 Apr 09:06 2015
Picon

postgis raster wkb documentation

Hi all,

is there any complete documentation of WKB available online? I just
found [1] (Table 2 - Structure of a raster type).

Thanks, Martin

[1] https://trac.osgeo.org/postgis/wiki/WKTRaster/Documentation01

--

-- 
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa
Ahmet Temiz | 20 Apr 19:40 2015
Picon

wrong on raster2pgsql

I never could find a solution this problem:

raster2pgsql -c -I -C -s 4326  -N -9999  -M -Y  -F ./test2/*.tif  rdem2 > rdem2.sql

Processing 84/84: ./test2/dem2_4326_06_14.tif
ERROR: diff_rastinfo: Could not run raster alignment test

I will appreciate if you supply a solution.

regards

--
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Bilgi İşlem  Dairesi Başkanlığı-CBS Grubu


________________________

Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency
_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Ahmet Temiz | 20 Apr 13:31 2015
Picon

(no subject)

hello

after creating tiles with gdal_retile.py ....,

I tried to load rasters to postgis with ...

raster2pgsql -c -I -C -s 4326  -M -Y  -F ./test2/*.tif  rdem2 > rdem2.sql

I got this message

Processing 84/84: ./test2/dem2_4326_06_14.tif
ERROR: diff_rastinfo: Could not run raster alignment test

Can you tell me why ?

regards

--
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Bilgi İşlem  Dairesi Başkanlığı-CBS Grubu


________________________

Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency
_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Ahmet Temiz | 20 Apr 09:12 2015
Picon

converting bytea data to postgis raster

hello

I am trying to get "data(" bytea ")  , then convert it to postgis raster.

On this table:

  Column  |     Type      | Modifiers 
----------+---------------+-----------
 location | character(64) | not null
 data     | bytea         | 
Indexes:
    "tiletable_2_pk" PRIMARY KEY, btree (location)
​***  I tried to get "data(" bytea ")  as then convert to postgis raster

tr2=> select location, st_astext(ST_GeomFromWKB(data, 4326))   from tiletable_0 where  location='dem2_4326_06_11.tif';
ERROR:  Invalid endian flag value encountered.


how can I solve the problem ?

regards

--
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Bilgi İşlem  Dairesi Başkanlığı-CBS Grubu


________________________

Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency
_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
James Keener | 18 Apr 20:11 2015

Re: Beginning in PostGIS

OH, I think I understand: You want to copy and paste from a shapefile
layer into the appropriate postgis layer?

I don't know if you can do that directly.  You may want to write a
script to do it, or import the shapefile into a temporary table and then
using multiple sql statements to build up your normalized tables.

http://stackoverflow.com/questions/1310103/split-table-with-duplicates-into-2-normalized-tables

has a little example.  Basically you import the towns with a insert into
blah select distinct (town code, town description) and then continue
that, but for the foreign keys have your updates or inserts do a
subquery to find the correct foreign row.

Jim

On 04/18/2015 02:01 PM, Luciano wrote:
> Ok,
> 
> I have a shape file with the following structure.
> 
> Shape file, columns:
> town ​​code;
> town description;
> Neighborhood code;
> name of the neighborhood;
> block code;
> Street code;
> street name;
> 
> Using the How to Copy / paste a geometry fromshape file to postgiswith
> follow structure:
> 
> Cities table (data):
> - Town id
> - Description of town
> 
> Neighborhoods table (data):
> - Id of the neighborhood
> - Description of the neighborhood
> - Id of town (foreign key)
> 
> Blocks table:
> - Id of the court
> - Block of code
> - Town id (foreign key)
> - Geometry, polygon
> 
> Streets table:
> - Street id
> - Street name
> - Town id (foreign key)
> - Geometry, line
> 
> 
> 
> 2015-04-18 13:36 GMT-03:00 Rémi Cura <remi.cura <at> gmail.com
> <mailto:remi.cura <at> gmail.com>>:
> 
>     maintaining your data model is easy to do with triggers.
> 
>     About copy / past.
>     Sorry this just doesn't make much sense to me.
> 
>     You can import shapefile into postgres if it is the question.
>     You can also use trigger on the import table to fill you rmodel with
>     the imported data.
> 
>     Cheers,
>     Rémi-C
> 
>     2015-04-18 17:39 GMT+02:00 Luciano <br.analistagis <at> gmail.com
>     <mailto:br.analistagis <at> gmail.com>>:
> 
> 
>         Hi,
>         I wonder how can I update a postgresql postgis database before
>         the following scenario:
>         Always worked with shape files and update them used copy / paste
>         between files.
>         Now, think about creating a database in PostgreSQL and would
>         like to continue using copy / paste to update polygons, but in
>         my database structure is different from the shape file. For example:
>         Imagine that the shapefile have all the fields in one table,
>         already in the database, by reason of standardization, have
>         these columns in tables
>         distinct. Below is an example of a register of towns.
> 
>         File shape, columns:
>         town ​​code;
>         town description;
>         Neighborhood code;
>         name of the neighborhood;
>         block code;
>         Street code;
>         street name;
> 
>         In Postgres / Gis could look like this:
> 
>         Cities table (data):
>         - Town id
>         - Description of town
> 
>         Neighborhoods table (data):
>         - Id of the neighborhood
>         - Description of the neighborhood
>         - Id of town (foreign key)
> 
>         Blocks table:
>         - Id of the court
>         - Block of code
>         - Town id (foreign key)
>         - Geometry, polygon
> 
>         Streets table:
>         - Street id
>         - Street name
>         - Town id (foreign key)
>         - Geometry, line
> 
>         How could update (insert) a block in postgresql table using copy
>         / paste the shape file?
>         Would have to create a trigger/procedure (instead of) to
>         automate the process?
>         Fields of shape file should be equal to the fields of database
>         table?
>         Some practical example as a reference?
> 
>         tia
>         -- 
>         Luciano
> 
> 
>         _______________________________________________
>         postgis-users mailing list
>         postgis-users <at> lists.osgeo.org <mailto:postgis-users <at> lists.osgeo.org>
>         http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> 
> 
> 
>     _______________________________________________
>     postgis-users mailing list
>     postgis-users <at> lists.osgeo.org <mailto:postgis-users <at> lists.osgeo.org>
>     http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> 
> 
> 
> 
> -- 
> Luciano
> 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users <at> lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> 

_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Luciano | 18 Apr 17:39 2015
Picon

Beginning in PostGIS


Hi,
I wonder how can I update a postgresql postgis database before the following scenario:
Always worked with shape files and update them used copy / paste between files.
Now, think about creating a database in PostgreSQL and would like to continue using copy / paste to update polygons, but in my database structure is different from the shape file. For example:
Imagine that the shapefile have all the fields in one table, already in the database, by reason of standardization, have these columns in tables
distinct. Below is an example of a register of towns.

File shape, columns:
town ​​code;
town description;
Neighborhood code;
name of the neighborhood;
block code;
Street code;
street name;

In Postgres / Gis could look like this:

Cities table (data):
- Town id
- Description of town

Neighborhoods table (data):
- Id of the neighborhood
- Description of the neighborhood
- Id of town (foreign key)

Blocks table:
- Id of the court
- Block of code
- Town id (foreign key)
- Geometry, polygon

Streets table:
- Street id
- Street name
- Town id (foreign key)
- Geometry, line

How could update (insert) a block in postgresql table using copy / paste the shape file?
Would have to create a trigger/procedure (instead of) to automate the process?
Fields of shape file should be equal to the fields of database table?
Some practical example as a reference?

tia
--
Luciano

_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Roberto Lazarte Kaqui | 16 Apr 20:24 2015
Picon

Calculate area of raster/polygon intersections in PostGIS

I have a raster with one band that represents the deforested area in the Amazon. This raster has 13 categories representing the deforested area in each year from 2001 to 2013.

Beyond this raster data, i have a database with 800 polygons that represents 800 cities of the Amazon region.

 

My interest is calculate the total deforested area in each city of the region for each year. In other words, i need to calculate the intersection area between the raster and the polygons database for each category of the raster.

In this scenario, i have two main questions:

 

1 - What's the best way to do raster/polygon intersections? I read about two different approaches, one using ST_Intersection and the other one using ST_Clip. The second one apparently is faster and more efficient, but i don't know about its precision.

 

2 - Assuming that i used ST_Clip to do the intersections, the result it’s gonna be another raster. How can i calculate the area of each category of this raster?

_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Gmane