Tam, Edison (IS | 9 Feb 22:13
Picon
Favicon

error: conversion to non-scalar type requested

Hi,

 

I try to build the PostGIS from source.  I followed the instruction until step 13: Compiling LibXML2.  For some reason the following error shows up:

 

testThreads.c: In function 'main':

testThreads.c:110:6: error: conversion to non-scalar type requested

 

However, if I compile it under Cygwin, it would not happen.  It only appears in MinGW.

 

Does anyone has any ideas?

 

Thank you!

 

Edison

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Stephen V. Mather | 9 Feb 21:57
Gravatar

Keeping vertices from lines in order... .

Hi All,

                If I’m converting from a line to its vertices, I use something like this (ala the postgis docs):

 

SELECT

   ST_PointN(

                  the_geom,

                  generate_series(1, ST_NPoints(the_geom))

   )

FROM ms_trails_test AS foo;

 

Now, if I want to make sure I keep all those vertices in order for later, I better give them an id, so here’s my original cludge:

 

SELECT

   ST_PointN(

                  the_geom,

                  generate_series(1, ST_NPoints(the_geom))

   ),

                generate_series(1, ST_NPoints(the_geom)) + foo.gid * 100000

FROM ms_trails_test AS foo;

 

Which is fine for most cases, but not really a general solution… .

Better yet, I’ll just keep my original gid as the feature id and have a separate vertex id:

 

SELECT

   ST_PointN(

                  the_geom,

                  generate_series(1, ST_NPoints(the_geom))

   ),

                gid as feature_id,

                generate_series(1, ST_NPoints(the_geom)) as vertex_id

FROM ms_trails_test AS foo;

 

Thus, I can play with the points and reassemble them back into lines later.  But, it seems inefficient to run generate_series twice.  Is this the best way?

 

 

 

 

 

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

svm <at> clevelandmetroparks.com
clevelandmetroparks.com

 

 

 

 

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Picon
Favicon
Gravatar

Postgis topology issue

Hi all,
i'm "playing" with Postgis 2.0 Topology function and i like it.. but i receive 
this error:

********** Error **********

ERROR: SQL/MM Spatial exception - point not on edge
SQL state: P0001
Context: PL/pgSQL function "topogeo_addpoint" line 66 at assignment
PL/pgSQL function "topogeo_addlinestring" line 111 at assignment
SQL statement "SELECT array_cat(edges, array_agg(x)) FROM ( select topology.
TopoGeo_addLinestring(atopology, rec.geom, tolerance) as x ) as foo"
PL/pgSQL function "topogeo_addpolygon" line 23 at assignment
SQL statement "INSERT INTO sample1.relation(topogeo_id, layer_id, 
element_type, element_id) SELECT 5, 1, 3, topogeo_addPolygon('sample1', 
'0103000000010000000A00000000000080AB6829413789412068EB284137894160A9682941000000002BEB2841C976BEDFA5682941000000C0C0EA2841C976BE1FA4682941378941A08AEA28410000008049682941378941A08DEA2841C976BE5F4B68294100000080C5EA2841000000804B68294100000080C7EA2841000000004F682941000000402FEB28410000000051682941000000406BEB284100000080AB6829413789412068EB2841'::
geometry, 0);"
PL/pgSQL function "totopogeom" line 125 at EXECUTE statement

these are my query that are "copy and paste " from 

http://postgis.refractions.net/pipermail/postgis-users/2012-January/032169.
html

--Create new togology ---
SELECT CreateTopology('sample1');

--Add topoGeomColumn---
SELECT AddTopoGeometryColumn('sample1',
                              'public', 'small_polygon', 'topogeom',
                              'POLYGON');

                              
UPDATE small_polygon SET topogeom = toTopoGeom(the_geom, 'sample1',1);

Do you have any suggestion? maybe i used a a wrong geometry..

Thanks

Francesco
David Quinn | 9 Feb 16:45
Picon
Gravatar

Question about using ST_Transform()

Hello All,

I'm trying to understand how to use ST_Transform() on a query. When I have everything in the same projection (in this case Albers Equal Area Conic) my query returns the correct result:

SELECT
    SUM((stats).sum)
FROM (
    select       
        ST_SummaryStats(ST_Clip(r.rast, 1, p.geom, NULL, TRUE)) as stats
    FROM        
        ny_albers as r,
        cities_albers as p
    WHERE
        p.name = 'new_york'
    AND
        ST_Intersects(r.rast, p.geom)
    )  as foo;

If I use a table with polygons in a different projection (in this case Web Mercator), I do not get any values returned:

SELECT
    SUM((stats).sum)
FROM (
    select       
        ST_SummaryStats(ST_Clip(r.rast, 1, ST_Transform(p.geom,102003), NULL, TRUE)) as stats
    FROM        
        ny_albers as r,
        cities_webMercator as p
    WHERE
        p.name = 'new_york'
    AND
        ST_Intersects(r.rast, ST_Transform(p.geom,102003))
    )  as foo;

I added the projection SRID:102003 using the following lines:

INSERT into
    spatial_ref_sys (
    srid,
    auth_name,
    auth_srid,
    srtext,
    proj4text
    )
values (
     102003, -- I changed this line as it was originally 9102003 which did not satisfy the constraints
     'esri',
     102003,      'PROJCS["USA_Contiguous_Albers_Equal_Area_Conic",GEOGCS["GCS_North_American_1983",DATUM["North_American_Datum_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Albers_Conic_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["longitude_of_center",-96],PARAMETER["Standard_Parallel_1",29.5],PARAMETER["Standard_Parallel_2",45.5],PARAMETER["latitude_of_center",37.5],UNIT["Meter",1],AUTHORITY["EPSG","102003"]]',
     '+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs ');

I had some problems when I tried to add this projection from http://spatialreference.org/ref/esri/102003/postgis/
The names and values of srtext, and proj4text were reversed, and the SRID seemed incorrect so I changed it. I don't know if this is related to my question above, but I thought it worth mentioning. I did import the raster and polygon using this SRID on the query that worked.

Thank you,
David

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
jituviju | 9 Feb 13:06
Picon
Gravatar

Re: postgis tutorial

Can someone point to a free tutorial of postgis for a fresher : a comp science student , having installed ( and
with familiarity with basics of gis ) qgis, postgres9.0, geoserver etc

Sent from BlackBerry® on Airtel
nikhil | 9 Feb 12:31
Picon
Favicon
Gravatar

Installing raster in POSTGIS 2.0

Hello friends,

I am trying to install, postgis 2.0 over postgresql 9.0, but i am not
successful. Can anyone give me a suitable link (which you have tried and
working properly) which explains the installation of Postgis 2.0 also with
raster capabilities (rtpostgis.sql).

thanks 

--
View this message in context: http://postgis.17.n6.nabble.com/Installing-raster-in-POSTGIS-2-0-tp4378919p4378919.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
=?UTF-8?Q?mzetka3 | 8 Feb 23:20

Using st_createarc(geometry, geometry, geometry, text)

Hello,
1. I need real example of use function st_createarc(startpoint geometry, endpoint geometry, arcenter
geometry, direction text). Function came from this pdf:
http://www.pgcon.org/2011/schedule/attachments/195_Using%20PostgreSQL%20for%20Flight%20Planning.pdf 
page: 33. 

2. I won't to use this to find route between two airports. And please explain me how to find third parameter
which is arcenter-geometry. If it possible please give me example on airports LAX and CDG. 
LAX: 33.9425000	-118.4080556 (lat, lon)
CDG: 49.0127778	2.5500000 (lat, lon)

Thanks for the help!!
Mateusz
Stephen Crawford | 8 Feb 19:53
Picon
Gravatar

raster aggregate query

Hi All,

I have a raster table "daily_temp" which has a month's worth of daily 
average temperate data for the USA.  The table looks like this:

rid   serial
obervation_date   date
rast   raster

Each day is tiled so for a given date there are 187 rows. I have been 
able to use "WHERE observation_date = '2011-12-01'" to select the data 
for one day, and this query worked create to clip it to the USA borders:

SELECT r.rid, ST_Clip(r.rast,g.the_geom) AS rast INTO cliptest FROM 
daily_temp r, usa_lcc g WHERE r.observation_date = '2011-12-01'

But what I would really like to do is aggregate multiple days to create 
a new raster table, for example "mean temperature for the last two 
weeks".  My "pseudo SQL" for this:

SELECT MEAN(rast) AS rast INTO mean_temp FROM avg_temp WHERE 
observation_date BETWEEN '2011-12-01' AND '2011-12-01'

Of course that doesn't work.  But I can't figure out how to do it.  Do I 
use ST_Union(rast, 'MEAN') for this?  Or ST_MapAlgebraExpr()?  Both??

Thanks,
Steve

--

-- 
Stephen Crawford
Center for Environmental Informatics
The Pennsylvania State University
Paul Ramsey | 8 Feb 18:45
Favicon
Gravatar

PostGIS 2.0.0alpha4

Pleased to provide a link to our weekly alpha tarball.

  http://postgis.org/download/postgis-2.0.0alpha4.tar.gz

The answer to the question "when will 2.0 be released" is a function
of the amount of testing and good bug reports we get and the number of
open tickets still to be closed or deferred. The ticket list is here:

  http://trac.osgeo.org/postgis/report/22

Thanks to all testers!

Paul
Roberto Marzocchi | 8 Feb 17:56
Picon
Gravatar

Running postgis from apache user

Dear all, 


I have a general question concerning postgis/postgresql access as apache user(www-data). 

Within a pywps script I want to access to postgresql database using Grass gis and I receive an error message: 
"ERROR 1: PostgreSQL ddriver doesn't currently support database creation."
I have already verified the correctness of the command running it from normal unix user and I think the problem is a misconfiguration of postgis/postgresql. 
I have already modified the postgresql.conf file with the line: listen_address = '*' 
and the pg_hba.conf file. Nevertheless I didn't obtain any appreciable result. I don't understand what is the problem.

Thanks in advanced for the attention and best regards, 
Roberto 
_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
DavidRA | 8 Feb 15:34
Picon
Gravatar

Why so terribly slow?

Hi everybody, I wanted to develop several PL/PGSQL functions in order to work
with rasters but at the first try I found myself in trouble: working at
pixel level results to be awfully slow.

For example, I created this VERY BASIC function that takes a raster and
returns a copy of it made pixel by pixel:

Executed with a very small raster (width = 146, height = 253) it takes about
15 seconds, which would be slow but yet acceptable.

Executed with a "normal" raster (width = 1737, height = 1040) it takes...
Who knows? I cancelled it before 2 hours.

What could be the reason? Am I doing something wrong? I'd really appreciate
a hand with this matter. Thanks! 

--
View this message in context: http://postgis.17.n6.nabble.com/Why-so-terribly-slow-tp4376157p4376157.html
Sent from the PostGIS - User mailing list archive at Nabble.com.

Gmane