Re: [postgis-users] Unable to laod "C:/Program Files (x86)/PostgreSQL/9.1/lib/postgis-1.5.dll" unknown error 998

2012-02-27 Thread Paragon Corporation
Sebastian,
That's good to hear. It's possible that the new geos couldn't be overwritten
before since it is sometimes in use and 1.5 did come with a slightly newr
one.  Usually you get an error about that though and then you have to
restart the service to unlock it. Someitmes the old dll is jus tloaded in
memory too.   :) 

> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net 
> [mailto:postgis-users-boun...@postgis.refractions.net] On 
> Behalf Of Sebastian Matyas
> Sent: Sunday, February 26, 2012 11:30 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] Unable to laod "C:/Program Files 
> (x86)/PostgreSQL/9.1/lib/postgis-1.5.dll" unknown error 998
> 
> Dear Regina,
> 
> thank you very much for your help. Now it works again - I 
> also could install postgis with the stackbuilder again with 
> no problems (before that I was already able to view and dump 
> my database also again with no problems).
> 
> It seems restarting the service was the key - too bad I 
> didn´t thought about that earlier but as the database itself 
> was running fine (and only the tables with the geography 
> datatype were not working), I didn´t thought that would be 
> the problem. The only other thing I did was to put the 
> bin-/lib-folder in the PATH variable but I guess that doesn´t 
> make a difference.
> 
> Btw I did restart it through the windows menu as restarting 
> the service with the console led to a 1063 error. Anyway it 
> works now - though I am still not sure what caused the 
> problem in the first place.
> 
> Best
> Sebastian
> 
> 
> 2012/2/27 Paragon Corporation :
> > Sebastian,
> > That shouldn't matter.  That just affects what you see in pgAdmin.
> > As far as dependency walker goes those errors are fine 
> since the lib 
> > becomes part of path when postgresql launches so it can 
> find it then.
> >
> > Only other thoughts
> >
> > 1) is to look in the pg_log folder in your data folder at 
> the error.  
> > That sometimes gives more clues.
> > 2) In your services, verify the executable and data path 
> are what you 
> > think they aree.
> >
> > For example our 9.1 services path to executable looks like 
> this when 
> > we go to control -> Services
> >
> > C:/Program Files (x86)/PostgreSQL/9.1/bin/pg_ctl.exe runservice -N 
> > "postgresql-9.1" -D "E:/PGData91X32" -w
> >
> >
> > 3) Shut off the service and try to start postgres from the console 
> > instead of the service
> >  use pg_ctl -D path to your data folder.
> > e.g.
> >
> > "C:/Program Files (x86)/PostgreSQL/9.1/bin/pg_ctl.exe" -D 
> "E:/PGData91X32"
> > -w
> >
> > You also want to check your postgresql.conf file that is located in 
> > your datafolder to make sure it is listening on the port 
> you think it is.
> >
> > Aside from that its really hard to diagnose without seeing 
> your computer.
> >
> > Regina
> > http://www.postgis.us
> >
> >
> >
> >> -Original Message-
> >> From: postgis-users-boun...@postgis.refractions.net
> >> [mailto:postgis-users-boun...@postgis.refractions.net] On 
> Behalf Of 
> >> Sebastian Matyas
> >> Sent: Sunday, February 26, 2012 8:24 AM
> >> To: PostGIS Users Discussion
> >> Subject: Re: [postgis-users] Unable to laod "C:/Program Files 
> >> (x86)/PostgreSQL/9.1/lib/postgis-1.5.dll" unknown error 998
> >>
> >> Mmmhhh maybe another thing: I also checked the registry and under 
> >> HKEY_CURRENT_USER\Software\pgAdmin III\Servers I find 
> three identical 
> >> server 1, 2 and 3 with the exact same databases. Is that 
> correct? But 
> >> maybe that has nothing to do with the error message I get ...
> >>
> >>
> >> 2012/2/26 Paragon Corporation :
> >> > You might have multiple versions of PostgreSQL running on
> >> your server.
> >> > Maybe one of them already has postgis 1.5 and you didn't 
> change the 
> >> > port to the new one you have. It usually picks up the 
> port from the 
> >> > registry via stackbuilder, but sometimes it doesn't and 
> you have to 
> >> > manually change during installation.
> >> >
> >> > Check the folders:
> >> >
> >> > C:\Program Files (x86)\PostgreSQL (32-bit ones get 
> installed here) 
> >> > C:\Program Files\PostgreSQL (64 bit versions get installed here)
> >> >
> >> > We have 4 running on my windows server so I have subfolders
> >> in the x86
> >> > (8.4, 9.0, 9.1)
> >> >  and a 9.0, 9.1 in my 64-bit folder.
> >> >
> >> > All running on different ports.
> >> >
> >> >
> >> >
> >> >
> >> >> -Original Message-
> >> >> From: postgis-users-boun...@postgis.refractions.net
> >> >> [mailto:postgis-users-boun...@postgis.refractions.net] On
> >> Behalf Of
> >> >> Sebastian Matyas
> >> >> Sent: Sunday, February 26, 2012 1:58 AM
> >> >> To: PostGIS Users Discussion
> >> >> Subject: Re: [postgis-users] Unable to laod "C:/Program Files 
> >> >> (x86)/PostgreSQL/9.1/lib/postgis-1.5.dll" unknown error 998
> >> >>
> >> >> Hi,
> >> >>
> >> >> yeah I deinstalled postgis through control 
> panel/programs and the 
> >> >> stackbuilder also says, that is 

Re: [postgis-users] Creating lines from a geometry collection

2012-02-27 Thread Birgit Laggner

Hi David,

I would think working with a subselect would solve your problem:

SELECT
generate_series(1,ST_NumGeometries(geom)) as gid,
geom
FROM (
SELECT
ST_GeomFromEWKB((ST_Dump(ST_Split(g.geom, blade.geom))).geom) 
As geom,

FROM
points as blade,
lines as g
WHERE
ST_Intersects(g.geom, blade.geom)
) as sel;

Hope that helps,

Birgit.



Am 25.02.2012 22:01, schrieb David Quinn:
After re-reading the documentation I realized I missed an example, so 
I figured out what I need to do (in part):


SELECT
ST_GeomFromEWKB((ST_Dump(ST_Split(g.geom, blade.geom))).geom) As geom
FROM
points as blade,
lines as g
WHERE
ST_Intersects(g.geom, blade.geom)

This works fine, but I also want to include a column that is an 
identifier. I've tried doing the following:


SELECT
ST_GeomFromEWKB((ST_Dump(ST_Split(g.geom, blade.geom))).geom) As geom,
generate_series(1,ST_NumGeometries((ST_Split(g.geom, 
blade.geom as gid

FROM
points as blade,
lines as g
WHERE
ST_Intersects(g.geom, blade.geom)

While this does generate a series, it starts counting for each line 
that it splits so it is 1,2,3,1,2,1,2,3,4. How can I have a sequential 
GID (or get the total geometry count)?


-David

On Sat, Feb 25, 2012 at 2:54 PM, David Quinn > wrote:


Hello,

I'm trying to split up a line using points into several smaller
lines. I'm using ST_Split but I don't understand how to combine
the returned values into a line. My code is as follows:

SELECT
   ST_Dump(ST_Split(g.geom, blade.geom)) AS geom
FROM
points as blade,
lines as g
WHERE
ST_Intersects(g.geom, blade.geom)

I've tried using a few different geometry constructors such as
ST_LineFromMultiPoint() and ST_GeomFromEWKB() to convert what
ST_Dump() returns to create lines but my syntax/approach is not
correct. What is the correct approach?

Thanks,
David




___
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] Problem using ST_MapAlgebraExpr

2012-02-27 Thread DavidRA
Hello, I'm willing to create a PL/pgSQL function in orden to obtain
normalized (0-1) rasters. This is what I have so far:



The thing is that I don't know how to handle the variables inside the
ST_MapAlgebraExpr expression. As it is now, I get an error when running the
function because it takes the minVal and maxVal variables as if they where
columns of some table.

Is there a way to use inside the expression those variables I defined
previously? Thanks a lot!

--
View this message in context: 
http://postgis.17.n6.nabble.com/Problem-using-ST-MapAlgebraExpr-tp4514561p4514561.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Raster + Geometry Intersection

2012-02-27 Thread Ed Linde
Hi,
I am trying to compute elevations for a road network that I have downloaded
and installed into my pg database using osm2pgsql. I also have loaded SRTM
tif files and they are stored as type RASTER in my table.
I am now trying to compute an intersection between the SRTM rasters and the
OSM road geometries... with no luck! :(
I am following this tutorial -->
http://trac.osgeo.org/postgis/wiki/WKTRasterTutorial01
but I think it might be slightly outdated.

 SELECT o.osm_id,
ST_Intersection(s.rast, o.way)
 FROM planet_osm_line o,
  srtm_tiled s
 WHERE ST_Intersects(s.rast, o.way);

way type -->   *way geometry(LineString,900913)*

CREATE TABLE public.srtm_tiled
(
  rid integer NOT NULL DEFAULT nextval('srtm_tiled_rid_seq'::regclass),
 * rast raster,*
  CONSTRAINT srtm_tiled_pkey PRIMARY KEY (rid)
)
WITH (
  OIDS=FALSE
);

performing the above query returns no rows. So I am not sure what is
wrong.. or if I am doing this query correctly. Is the SRID set differently
in the raster and geometry?
I also loaded the tif files using the tutorial, but I used the C version
not the python loader because I understand its been deprecated.
Can someone help?


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


Re: [postgis-users] How to Import geojson data into postgis

2012-02-27 Thread Nicolas Ribot
On 27 February 2012 08:13, Robert Buckley  wrote:
> Hi,
> I have never worked with geojson data before, but have a data source which
> outputs geojson. I have to serve this with geoserver and have no idea how to
> import geojson into a postgis database.
>
> Would anyone have any instructions or know of a tutorial that would show me
> how to do this.
>
> Google doesn´t come up with much!
>
> yours,
>
> Robert
>

Hi Robert

GDAL/OGR can convert from geojson to postgis format:
http://www.gdal.org/ogr/drv_geojson.html

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


Re: [postgis-users] Transform

2012-02-27 Thread Pierre Racine
So Steve could you fix this problem? Any update?

Pierre

> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-
> boun...@postgis.refractions.net] On Behalf Of Stephen Crawford
> Sent: Tuesday, February 21, 2012 3:11 PM
> To: postgis-users@postgis.refractions.net
> Subject: Re: [postgis-users] Transform
> 
> Spoke too soon.  Now the new table is in the correct projection, but almost 
> all
> of the data have been changed to "0" (should be a % such as
> 93.25 etc).  The original raster is tiled; do I need to do a Union first, or
> something else I'm missing?
> 
> Thanks,
> Steve
> 
> On 2/21/2012 2:20 PM, Bborie Park wrote:
> > Steve,
> >
> > Are you running Windows?  If so, I believe there is a known issue with
> > GDAL not finding the proj.4 DLL.  You'll need to set the env variable
> > PROJSO to the full path to the DLL.
> >
> > http://trac.osgeo.org/gdal/wiki/ConfigOptions
> >
> > -bborie
> >
> > On 02/21/2012 11:06 AM, Stephen Crawford wrote:
> >> Hi All,
> >>
> >> I'm trying to transform as raster set in this way:
> >>
> >> SELECT rid, observation_date, ST_Transform(rast, 4326) AS rast INTO
> >> risk_wgs84
> >> FROM spring_ms
> >> WHERE observation_date = '2012-02-20';
> >>
> >> I would expect the target table "risk_wgs84" to be in lat/lon, but if
> >> I
> >> run:
> >>
> >> ST_Extent(rast) from risk_wgs84 I get values in meters (same as the
> >> original table "spring_ms"):
> >>
> >> any ideas?
> >>
> >> Thanks,
> >> Steve
> >>
> >> Stephen Crawford
> >> Center for Environmental Informatics
> >> The Pennsylvania State University
> >>
> >>
> >>
> >> ___
> >> postgis-users mailing list
> >> postgis-users@postgis.refractions.net
> >> http://postgis.refractions.net/mailman/listinfo/postgis-users
> >>
> >
> 
> --
> Stephen Crawford
> Center for Environmental Informatics
> The Pennsylvania State University
> src...@psu.edu
> 814.865.9905
> 
> 
> ___
> 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] Raster + Geometry Intersection

2012-02-27 Thread Pierre Racine


> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-
> boun...@postgis.refractions.net] On Behalf Of Ed Linde
> Sent: Monday, February 27, 2012 7:21 AM
> To: postgis-users@postgis.refractions.net
> Subject: [postgis-users] Raster + Geometry Intersection
> 
> Hi,
> I am trying to compute elevations for a road network that I have downloaded
> and installed into my pg database using osm2pgsql. I also have loaded SRTM tif
> files and they are stored as type RASTER in my table.
> I am now trying to compute an intersection between the SRTM rasters and the
> OSM road geometries... with no luck! :( I am following this tutorial -->
> http://trac.osgeo.org/postgis/wiki/WKTRasterTutorial01
> but I think it might be slightly outdated.

The base queries to do the intersection are still valid. Only the uploading 
changed. And not much.

>  SELECT o.osm_id,
> ST_Intersection(s.rast, o.way)
>  FROM planet_osm_line o,
>   srtm_tiled s
>  WHERE ST_Intersects(s.rast, o.way);
> 
> way type -->   way geometry(LineString,900913)
> 
> CREATE TABLE public.srtm_tiled
> (
>   rid integer NOT NULL DEFAULT nextval('srtm_tiled_rid_seq'::regclass),
>   rast raster,
>   CONSTRAINT srtm_tiled_pkey PRIMARY KEY (rid)
> )
> WITH (
>   OIDS=FALSE
> );
> 
> performing the above query returns no rows. So I am not sure what is wrong.. 
> or
> if I am doing this query correctly. Is the SRID set differently in the raster 
> and
> geometry?

You should do ST_Intersection(o.way , s.rast) instead of 
ST_Intersection(s.rast, o.way). The first operates in the vector world and the 
second in the raster world. Let me know if that makes a difference in terms of 
results.

Are the SRIDs identical? Did you make sure that the raster were loaded properly 
by displaying values with ST_Value() or ST_DumpAsPolygons() or simply 
displaying the raster in QGIS? Does the raster align with the roads properly?

> I also loaded the tif files using the tutorial, but I used the C version not 
> the
> python loader because I understand its been deprecated.

Should not make any difference.

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


Re: [postgis-users] Problem using ST_MapAlgebraExpr

2012-02-27 Thread Pierre Racine
> Hello, I'm willing to create a PL/pgSQL function in orden to obtain 
> normalized (0-
> 1) rasters. This is what I have so far:

Just describe me in detail how you want to compute the normalized raster and I 
will help with the steps.

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


Re: [postgis-users] Raster + Geometry Intersection

2012-02-27 Thread Ed Linde
Hi Pierre,
I used --> */root/postgis-svn/raster/loader/raster2pgsql -s 4326 -t 50x50
-I *.tif public.srtm_tiled > elev.sql*
for the loading. The switch in args did not make a difference
unfortunately! :(
I am pretty sure that the OSM roads geometry used SRID = 4326, and I think
the arguments I have
used to get in the tif files with the -s option also is right.
One warning I got while loading was (maybe it makes sense to you?) :

*/root/postgis-svn/raster/loader/raster2pgsql -s 4326 -t 50x50 -I *.tif
public.srtm_tiled > elev.sql
*Processing 1/4: srtm_38_01.tif
Processing 2/4: srtm_38_02.tif
*WARNING: Different geotransform matrices found in the set of rasters being
converted to PostGIS raster
*Processing 3/4: srtm_39_01.tif
Processing 4/4: srtm_39_02.tif

I tried loading the rasters and the roads in qgis, but it didn't manage to
show them together, so I am not sure why its
not aligning. I am sure its some sort of alignment issue, but do not see
where its wrong. I am getting the SRTM files
from http://gis-lab.info/data/srtm-tif/
And the OSM road was just the map for Denmark on OSM -->
http://download.geofabrik.de/osm/europe/

Is it possible for you to intersect these? I understand you are the author
of the postgis tutorial that I am trying to follow
to achieve the same...hence I ask. :)

Cheers,
Ed


On Mon, Feb 27, 2012 at 2:58 PM, Pierre Racine
wrote:

>
>
> > -Original Message-
> > From: postgis-users-boun...@postgis.refractions.net [mailto:
> postgis-users-
> > boun...@postgis.refractions.net] On Behalf Of Ed Linde
> > Sent: Monday, February 27, 2012 7:21 AM
> > To: postgis-users@postgis.refractions.net
> > Subject: [postgis-users] Raster + Geometry Intersection
> >
> > Hi,
> > I am trying to compute elevations for a road network that I have
> downloaded
> > and installed into my pg database using osm2pgsql. I also have loaded
> SRTM tif
> > files and they are stored as type RASTER in my table.
> > I am now trying to compute an intersection between the SRTM rasters and
> the
> > OSM road geometries... with no luck! :( I am following this tutorial -->
> > http://trac.osgeo.org/postgis/wiki/WKTRasterTutorial01
> > but I think it might be slightly outdated.
>
> The base queries to do the intersection are still valid. Only the
> uploading changed. And not much.
>
> >  SELECT o.osm_id,
> > ST_Intersection(s.rast, o.way)
> >  FROM planet_osm_line o,
> >   srtm_tiled s
> >  WHERE ST_Intersects(s.rast, o.way);
> >
> > way type -->   way geometry(LineString,900913)
> >
> > CREATE TABLE public.srtm_tiled
> > (
> >   rid integer NOT NULL DEFAULT nextval('srtm_tiled_rid_seq'::regclass),
> >   rast raster,
> >   CONSTRAINT srtm_tiled_pkey PRIMARY KEY (rid)
> > )
> > WITH (
> >   OIDS=FALSE
> > );
> >
> > performing the above query returns no rows. So I am not sure what is
> wrong.. or
> > if I am doing this query correctly. Is the SRID set differently in the
> raster and
> > geometry?
>
> You should do ST_Intersection(o.way , s.rast) instead of
> ST_Intersection(s.rast, o.way). The first operates in the vector world and
> the second in the raster world. Let me know if that makes a difference in
> terms of results.
>
> Are the SRIDs identical? Did you make sure that the raster were loaded
> properly by displaying values with ST_Value() or ST_DumpAsPolygons() or
> simply displaying the raster in QGIS? Does the raster align with the roads
> properly?
>
> > I also loaded the tif files using the tutorial, but I used the C version
> not the
> > python loader because I understand its been deprecated.
>
> Should not make any difference.
>
> Pierre
> ___
> 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] Raster + Geometry Intersection

2012-02-27 Thread Ed Linde
Hi,

I noticed that the OSM data is using srid = 900913. So I reloaded the tif
files as the same srid, yet
no luck with the intersection query! :(
*ALTER TABLE public.planet_osm_line ADD COLUMN way
geometry(LineString,900913);
*
Cheers,
Ed
On Mon, Feb 27, 2012 at 3:25 PM, Ed Linde  wrote:

> Hi Pierre,
> I used --> */root/postgis-svn/raster/loader/raster2pgsql -s 4326 -t 50x50
> -I *.tif public.srtm_tiled > elev.sql*
> for the loading. The switch in args did not make a difference
> unfortunately! :(
> I am pretty sure that the OSM roads geometry used SRID = 4326, and I think
> the arguments I have
> used to get in the tif files with the -s option also is right.
> One warning I got while loading was (maybe it makes sense to you?) :
>
> */root/postgis-svn/raster/loader/raster2pgsql -s 4326 -t 50x50 -I *.tif
> public.srtm_tiled > elev.sql
> *Processing 1/4: srtm_38_01.tif
> Processing 2/4: srtm_38_02.tif
> *WARNING: Different geotransform matrices found in the set of rasters
> being converted to PostGIS raster
> *Processing 3/4: srtm_39_01.tif
> Processing 4/4: srtm_39_02.tif
>
> I tried loading the rasters and the roads in qgis, but it didn't manage to
> show them together, so I am not sure why its
> not aligning. I am sure its some sort of alignment issue, but do not see
> where its wrong. I am getting the SRTM files
> from http://gis-lab.info/data/srtm-tif/
> And the OSM road was just the map for Denmark on OSM -->
> http://download.geofabrik.de/osm/europe/
>
> Is it possible for you to intersect these? I understand you are the author
> of the postgis tutorial that I am trying to follow
> to achieve the same...hence I ask. :)
>
> Cheers,
> Ed
>
>
>
> On Mon, Feb 27, 2012 at 2:58 PM, Pierre Racine <
> pierre.rac...@sbf.ulaval.ca> wrote:
>
>>
>>
>> > -Original Message-
>> > From: postgis-users-boun...@postgis.refractions.net [mailto:
>> postgis-users-
>> > boun...@postgis.refractions.net] On Behalf Of Ed Linde
>> > Sent: Monday, February 27, 2012 7:21 AM
>> > To: postgis-users@postgis.refractions.net
>> > Subject: [postgis-users] Raster + Geometry Intersection
>> >
>> > Hi,
>> > I am trying to compute elevations for a road network that I have
>> downloaded
>> > and installed into my pg database using osm2pgsql. I also have loaded
>> SRTM tif
>> > files and they are stored as type RASTER in my table.
>> > I am now trying to compute an intersection between the SRTM rasters and
>> the
>> > OSM road geometries... with no luck! :( I am following this tutorial -->
>> > http://trac.osgeo.org/postgis/wiki/WKTRasterTutorial01
>> > but I think it might be slightly outdated.
>>
>> The base queries to do the intersection are still valid. Only the
>> uploading changed. And not much.
>>
>> >  SELECT o.osm_id,
>> > ST_Intersection(s.rast, o.way)
>> >  FROM planet_osm_line o,
>> >   srtm_tiled s
>> >  WHERE ST_Intersects(s.rast, o.way);
>> >
>> > way type -->   way geometry(LineString,900913)
>> >
>> > CREATE TABLE public.srtm_tiled
>> > (
>> >   rid integer NOT NULL DEFAULT nextval('srtm_tiled_rid_seq'::regclass),
>> >   rast raster,
>> >   CONSTRAINT srtm_tiled_pkey PRIMARY KEY (rid)
>> > )
>> > WITH (
>> >   OIDS=FALSE
>> > );
>> >
>> > performing the above query returns no rows. So I am not sure what is
>> wrong.. or
>> > if I am doing this query correctly. Is the SRID set differently in the
>> raster and
>> > geometry?
>>
>> You should do ST_Intersection(o.way , s.rast) instead of
>> ST_Intersection(s.rast, o.way). The first operates in the vector world and
>> the second in the raster world. Let me know if that makes a difference in
>> terms of results.
>>
>> Are the SRIDs identical? Did you make sure that the raster were loaded
>> properly by displaying values with ST_Value() or ST_DumpAsPolygons() or
>> simply displaying the raster in QGIS? Does the raster align with the roads
>> properly?
>>
>> > I also loaded the tif files using the tutorial, but I used the C
>> version not the
>> > python loader because I understand its been deprecated.
>>
>> Should not make any difference.
>>
>> Pierre
>> ___
>> 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] Raster + Geometry Intersection

2012-02-27 Thread Pierre Racine
1) Make sure ST_SRID on the geometries and ST_SRID on the raster give the same 
result.

2) Use OpenJump to display vector queries from PostGIS and make sure everything 
align properly.

Pierre

> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-
> boun...@postgis.refractions.net] On Behalf Of Ed Linde
> Sent: Monday, February 27, 2012 9:25 AM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] Raster + Geometry Intersection
> 
> Hi Pierre,
> I used --> /root/postgis-svn/raster/loader/raster2pgsql -s 4326 -t 50x50 -I 
> *.tif
> public.srtm_tiled > elev.sql for the loading. The switch in args did not make 
> a
> difference unfortunately! :( I am pretty sure that the OSM roads geometry used
> SRID = 4326, and I think the arguments I have used to get in the tif files 
> with the
> -s option also is right.
> One warning I got while loading was (maybe it makes sense to you?) :
> 
> /root/postgis-svn/raster/loader/raster2pgsql -s 4326 -t 50x50 -I *.tif
> public.srtm_tiled > elev.sql Processing 1/4: srtm_38_01.tif Processing 2/4:
> srtm_38_02.tif
> WARNING: Different geotransform matrices found in the set of rasters being
> converted to PostGIS raster Processing 3/4: srtm_39_01.tif Processing 4/4:
> srtm_39_02.tif
> 
> I tried loading the rasters and the roads in qgis, but it didn't manage to 
> show
> them together, so I am not sure why its not aligning. I am sure its some sort 
> of
> alignment issue, but do not see where its wrong. I am getting the SRTM files
> from http://gis-lab.info/data/srtm-tif/
> And the OSM road was just the map for Denmark on OSM -->
> http://download.geofabrik.de/osm/europe/
> 
> Is it possible for you to intersect these? I understand you are the author of 
> the
> postgis tutorial that I am trying to follow to achieve the same...hence I 
> ask. :)
> 
> Cheers,
> Ed
> 
> 
> 
> On Mon, Feb 27, 2012 at 2:58 PM, Pierre Racine 
> wrote:
> 
> 
> 
> 
>   > -Original Message-
>   > From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-
> users-
>   > boun...@postgis.refractions.net] On Behalf Of Ed Linde
>   > Sent: Monday, February 27, 2012 7:21 AM
>   > To: postgis-users@postgis.refractions.net
>   > Subject: [postgis-users] Raster + Geometry Intersection
>   >
>   > Hi,
>   > I am trying to compute elevations for a road network that I have
> downloaded
>   > and installed into my pg database using osm2pgsql. I also have loaded
> SRTM tif
>   > files and they are stored as type RASTER in my table.
>   > I am now trying to compute an intersection between the SRTM rasters
> and the
>   > OSM road geometries... with no luck! :( I am following this tutorial 
> -->
>   > http://trac.osgeo.org/postgis/wiki/WKTRasterTutorial01
>   > but I think it might be slightly outdated.
> 
> 
>   The base queries to do the intersection are still valid. Only the 
> uploading
> changed. And not much.
> 
> 
>   >  SELECT o.osm_id,
>   > ST_Intersection(s.rast, o.way)
>   >  FROM planet_osm_line o,
>   >   srtm_tiled s
>   >  WHERE ST_Intersects(s.rast, o.way);
>   >
>   > way type -->   way geometry(LineString,900913)
>   >
>   > CREATE TABLE public.srtm_tiled
>   > (
>   >   rid integer NOT NULL DEFAULT
> nextval('srtm_tiled_rid_seq'::regclass),
>   >   rast raster,
>   >   CONSTRAINT srtm_tiled_pkey PRIMARY KEY (rid)
>   > )
>   > WITH (
>   >   OIDS=FALSE
>   > );
>   >
>   > performing the above query returns no rows. So I am not sure what is
> wrong.. or
>   > if I am doing this query correctly. Is the SRID set differently in the
> raster and
>   > geometry?
> 
> 
>   You should do ST_Intersection(o.way , s.rast) instead of
> ST_Intersection(s.rast, o.way). The first operates in the vector world and the
> second in the raster world. Let me know if that makes a difference in terms of
> results.
> 
>   Are the SRIDs identical? Did you make sure that the raster were loaded
> properly by displaying values with ST_Value() or ST_DumpAsPolygons() or simply
> displaying the raster in QGIS? Does the raster align with the roads properly?
> 
> 
>   > I also loaded the tif files using the tutorial, but I used the C 
> version not
> the
>   > python loader because I understand its been deprecated.
> 
> 
>   Should not make any difference.
> 
>   Pierre
>   ___
>   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] Transform

2012-02-27 Thread Stephen Crawford
I had to walk away for another project but I'll be back at it this week 
and I'll let you know. Thanks for the help.


Steve

On 2/27/2012 8:50 AM, Pierre Racine wrote:

So Steve could you fix this problem? Any update?

Pierre


-Original Message-
From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-
boun...@postgis.refractions.net] On Behalf Of Stephen Crawford
Sent: Tuesday, February 21, 2012 3:11 PM
To: postgis-users@postgis.refractions.net
Subject: Re: [postgis-users] Transform

Spoke too soon.  Now the new table is in the correct projection, but almost all
of the data have been changed to "0" (should be a % such as
93.25 etc).  The original raster is tiled; do I need to do a Union first, or
something else I'm missing?

Thanks,
Steve

On 2/21/2012 2:20 PM, Bborie Park wrote:

Steve,

Are you running Windows?  If so, I believe there is a known issue with
GDAL not finding the proj.4 DLL.  You'll need to set the env variable
PROJSO to the full path to the DLL.

http://trac.osgeo.org/gdal/wiki/ConfigOptions

-bborie

On 02/21/2012 11:06 AM, Stephen Crawford wrote:

Hi All,

I'm trying to transform as raster set in this way:

SELECT rid, observation_date, ST_Transform(rast, 4326) AS rast INTO
risk_wgs84
FROM spring_ms
WHERE observation_date = '2012-02-20';

I would expect the target table "risk_wgs84" to be in lat/lon, but if
I
run:

ST_Extent(rast) from risk_wgs84 I get values in meters (same as the
original table "spring_ms"):

any ideas?

Thanks,
Steve

Stephen Crawford
Center for Environmental Informatics
The Pennsylvania State University



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


--
Stephen Crawford
Center for Environmental Informatics
The Pennsylvania State University
src...@psu.edu
814.865.9905


___
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


--
Stephen Crawford
Center for Environmental Informatics
The Pennsylvania State University
src...@psu.edu
814.865.9905


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


Re: [postgis-users] Raster + Geometry Intersection

2012-02-27 Thread Pierre Racine
> I noticed that the OSM data is using srid = 900913. So I reloaded the tif 
> files as
> the same srid, yet no luck with the intersection query! :( ALTER TABLE
> public.planet_osm_line ADD COLUMN way geometry(LineString,900913);

Specifying -s 900913 at load time do not make the rasters to be 900913... You 
have to reproject something with ST_Transform. Go for reprojecting the 
geometries since we still have a bug with reprojectings rasters. 

Pierre

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


Re: [postgis-users] Raster + Geometry Intersection

2012-02-27 Thread Ed Linde
Hi Pierre,
I checked the srids of the geometry and the rasters and they are both now
set to --> 900913!
I was using qgis and I think I made a mistake because I think the tif files
on disk are using
srid = 4326, while the postgis layer I added was using 900913 for osm.
I have never used OpenJump.. is it possible to view both my raster and road
geometries from
postgis on to qgis? Or you recommend installing OpenJump?
Also, do I still need to do some sort of reprojection on the geometries? Is
the SRID of 900913
reported for my rasters...reliable information?

Cheers,
Ed


On Mon, Feb 27, 2012 at 3:40 PM, Pierre Racine
wrote:

> > I noticed that the OSM data is using srid = 900913. So I reloaded the
> tif files as
> > the same srid, yet no luck with the intersection query! :( ALTER TABLE
> > public.planet_osm_line ADD COLUMN way geometry(LineString,900913);
>
> Specifying -s 900913 at load time do not make the rasters to be 900913...
> You have to reproject something with ST_Transform. Go for reprojecting the
> geometries since we still have a bug with reprojectings rasters.
>
> Pierre
>
> ___
> 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] Raster + Geometry Intersection

2012-02-27 Thread David Quinn
Hi Ed,

There is a QGIS plugin 'Load PostGIS Raster to QGIS'. I've used that to
load rasters, and added vectors from the 'Add PostGIS Layer' without
problem. When I have used it, I made sure that both vector and raster were
using the same SRID.

David

On Mon, Feb 27, 2012 at 9:46 AM, Ed Linde  wrote:

> Hi Pierre,
> I checked the srids of the geometry and the rasters and they are both now
> set to --> 900913!
> I was using qgis and I think I made a mistake because I think the tif
> files on disk are using
> srid = 4326, while the postgis layer I added was using 900913 for osm.
> I have never used OpenJump.. is it possible to view both my raster and
> road geometries from
> postgis on to qgis? Or you recommend installing OpenJump?
> Also, do I still need to do some sort of reprojection on the geometries?
> Is the SRID of 900913
> reported for my rasters...reliable information?
>
> Cheers,
> Ed
>
>
>
> On Mon, Feb 27, 2012 at 3:40 PM, Pierre Racine <
> pierre.rac...@sbf.ulaval.ca> wrote:
>
>> > I noticed that the OSM data is using srid = 900913. So I reloaded the
>> tif files as
>> > the same srid, yet no luck with the intersection query! :( ALTER TABLE
>> > public.planet_osm_line ADD COLUMN way geometry(LineString,900913);
>>
>> Specifying -s 900913 at load time do not make the rasters to be 900913...
>> You have to reproject something with ST_Transform. Go for reprojecting the
>> geometries since we still have a bug with reprojectings rasters.
>>
>> Pierre
>>
>> ___
>> 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] Raster + Geometry Intersection

2012-02-27 Thread Pierre Racine
> I checked the srids of the geometry and the rasters and they are both now set 
> to
> --> 900913!

But you loaded the raster with -s 900913. Right? That does not make the raster 
coordinates to be transformed. You actually corrupted your rasters. You have to 
load them in their proper srid (4326) and reproject them afterward (or 
reproject the geometries) to 900913. I would go with reprojecting the 
geometries.

> I was using qgis and I think I made a mistake because I think the tif files 
> on disk
> are using srid = 4326, while the postgis layer I added was using 900913 for 
> osm.
> I have never used OpenJump.. is it possible to view both my raster and road
> geometries from postgis on to qgis? Or you recommend installing OpenJump?

I do. It's still the best/stable tool to work both raster and vectors. You 
can't display raster but you can display their extent and their vectorization 
(with ST_DumpAsPolygon()) as in the tutorial.

> Also, do I still need to do some sort of reprojection on the geometries? Is 
> the
> SRID of 900913 reported for my rasters...reliable information?

Again, the loader do not reproject. It just assign the srid you tell him. You 
have to reproject at some point (before or after loading, before or while 
intersecting).

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


Re: [postgis-users] Raster + Geometry Intersection

2012-02-27 Thread Ed Linde
ok, just to get this right.. :) , you are suggesting I keep my OSM as is
(id: 900913). Load in the tif rasters as srid (4326) and then "reproject"
the OSM road geometry to srid = 4326 right? So it matches the srid of my
raster! I ask because you said to reproject to 900913 in your mail.

Cheers,
Ed

On Mon, Feb 27, 2012 at 3:53 PM, Pierre Racine
wrote:

> > I checked the srids of the geometry and the rasters and they are both
> now set to
> > --> 900913!
>
> But you loaded the raster with -s 900913. Right? That does not make the
> raster coordinates to be transformed. You actually corrupted your rasters.
> You have to load them in their proper srid (4326) and reproject them
> afterward (or reproject the geometries) to 900913. I would go with
> reprojecting the geometries.
>
> > I was using qgis and I think I made a mistake because I think the tif
> files on disk
> > are using srid = 4326, while the postgis layer I added was using 900913
> for osm.
> > I have never used OpenJump.. is it possible to view both my raster and
> road
> > geometries from postgis on to qgis? Or you recommend installing OpenJump?
>
> I do. It's still the best/stable tool to work both raster and vectors. You
> can't display raster but you can display their extent and their
> vectorization (with ST_DumpAsPolygon()) as in the tutorial.
>
> > Also, do I still need to do some sort of reprojection on the geometries?
> Is the
> > SRID of 900913 reported for my rasters...reliable information?
>
> Again, the loader do not reproject. It just assign the srid you tell him.
> You have to reproject at some point (before or after loading, before or
> while intersecting).
>
> Pierre
> ___
> 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] Raster + Geometry Intersection

2012-02-27 Thread Ed Linde
Hi Pierre,
I will be back on in a couple of hours.. have to rush out. But thanks a
million for all your suggestions! Cannot get this working without your
help! :)

Cheers,
Ed

On Mon, Feb 27, 2012 at 3:59 PM, Ed Linde  wrote:

> ok, just to get this right.. :) , you are suggesting I keep my OSM as is
> (id: 900913). Load in the tif rasters as srid (4326) and then "reproject"
> the OSM road geometry to srid = 4326 right? So it matches the srid of my
> raster! I ask because you said to reproject to 900913 in your mail.
>
> Cheers,
> Ed
>
>
> On Mon, Feb 27, 2012 at 3:53 PM, Pierre Racine <
> pierre.rac...@sbf.ulaval.ca> wrote:
>
>> > I checked the srids of the geometry and the rasters and they are both
>> now set to
>> > --> 900913!
>>
>> But you loaded the raster with -s 900913. Right? That does not make the
>> raster coordinates to be transformed. You actually corrupted your rasters.
>> You have to load them in their proper srid (4326) and reproject them
>> afterward (or reproject the geometries) to 900913. I would go with
>> reprojecting the geometries.
>>
>> > I was using qgis and I think I made a mistake because I think the tif
>> files on disk
>> > are using srid = 4326, while the postgis layer I added was using 900913
>> for osm.
>> > I have never used OpenJump.. is it possible to view both my raster and
>> road
>> > geometries from postgis on to qgis? Or you recommend installing
>> OpenJump?
>>
>> I do. It's still the best/stable tool to work both raster and vectors.
>> You can't display raster but you can display their extent and their
>> vectorization (with ST_DumpAsPolygon()) as in the tutorial.
>>
>> > Also, do I still need to do some sort of reprojection on the
>> geometries? Is the
>> > SRID of 900913 reported for my rasters...reliable information?
>>
>> Again, the loader do not reproject. It just assign the srid you tell him.
>> You have to reproject at some point (before or after loading, before or
>> while intersecting).
>>
>> Pierre
>> ___
>> 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] Raster + Geometry Intersection

2012-02-27 Thread Pierre Racine
> ok, just to get this right.. :) , you are suggesting I keep my OSM as is (id: 
> 900913).
> Load in the tif rasters as srid (4326) and then "reproject" the OSM road 
> geometry
> to srid = 4326 right? So it matches the srid of my raster! I ask because you 
> said
> to reproject to 900913 in your mail.

Correct. We're on the right way.

You can  create a new raster table (after loading them properly with 4326) with 
your rasters reprojected to 900913 but as I said you might hit our bug:

http://trac.osgeo.org/postgis/ticket/1618

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


Re: [postgis-users] Problem using ST_MapAlgebraExpr

2012-02-27 Thread DavidRA
Hi, it's very simple, like any other normalization: we have some values (in
this case, the values of each cell of the input raster) and want to tranform
them into others between 0 and 1. The minimum value of the raster will be
transformed as 0, and the maximum as 1. And the formula used is (cellValue -
minValue)/(maxValue - minValue).

An example for a 2x2 raster:

-Input raster:

2 3
6 4

-Output raster:

0 0'25
1 0'5

I hope this is clear enough, else let me know and I'll try to be more
especific. Thanks.

--
View this message in context: 
http://postgis.17.n6.nabble.com/Problem-using-ST-MapAlgebraExpr-tp4514561p4515113.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Problem using ST_MapAlgebraExpr

2012-02-27 Thread Pierre Racine
Ho I see better now. My email was not showing your code.

You have to convert minVal & maxVal to text:

newrast := ST_MapAlgebraExpr(rast, '8BUI', 'CASE WHEN rast1 < 0 THEN null 
ELSE (((rast)-(' || minVal::float8 || '))/((' || maxVal::float8 || ')-(' || 
minVal::float8 || '))) END');

Pierre

> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-
> boun...@postgis.refractions.net] On Behalf Of DavidRA
> Sent: Monday, February 27, 2012 10:19 AM
> To: postgis-users@postgis.refractions.net
> Subject: Re: [postgis-users] Problem using ST_MapAlgebraExpr
> 
> Hi, it's very simple, like any other normalization: we have some values (in 
> this
> case, the values of each cell of the input raster) and want to tranform them 
> into
> others between 0 and 1. The minimum value of the raster will be transformed as
> 0, and the maximum as 1. And the formula used is (cellValue -
> minValue)/(maxValue - minValue).
> 
> An example for a 2x2 raster:
> 
> -Input raster:
> 
> 2 3
> 6 4
> 
> -Output raster:
> 
> 0 0'25
> 1 0'5
> 
> I hope this is clear enough, else let me know and I'll try to be more 
> especific.
> Thanks.
> 
> --
> View this message in context: http://postgis.17.n6.nabble.com/Problem-using-
> ST-MapAlgebraExpr-tp4514561p4515113.html
> Sent from the PostGIS - User mailing list archive at Nabble.com.
> ___
> 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] FOSS4G North America Call for Presentations Closes March 1

2012-02-27 Thread Paul Ramsey
FOSS4G-NA (April 10-12, in Washington DC) is shaping up to be very
successful: nearly half of our 400 registration slots are already
filled, and lots of sponsors have signed on. Now it's up to you to
bring the magic!

If you are planning to speak at FOSS4G-NA, you must submit a
presentation abstract by March 1. Please don't forget!

  http://foss4g-na.org/abstract-submission/

The conference program is being organized around three tracks:
 * open source technology best practices and tips;
 * deployment case studies; and
 * emerging ideas and trends in open source.

We have space for about 50 presentations and 20 Ignite sessions, so
get your submissions in!

For more information, please visit our site at http://foss4g-na.org/.

Space is limited to 300 attendees only, so you should sign up today to
ensure that you can be a part of this exciting event!

Related Links:
 * http://foss4g-na.org/registration/ FOSS4G-NA Registration
 * http://wiki.osgeo.org/wiki/North_America_Regional/ OSGeo North
America Chapter
 * http://www.osgeo.org/ Open Source Geospatial Foundation
 * http://2012.foss4g.org/ FOSS4G 2012 - Beijing, China
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Laurent PIERRE est absent(e).

2012-02-27 Thread Laurent PIERRE


Je serai absent(e) du  27/02/2012 au 02/03/2012.

Je répondrai à votre message dès mon retour.___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] ST_Raster question, Use spot heights and create an Elevation raster layer

2012-02-27 Thread Simon Greener

I have successfully created a PostGIS raster (I am using PostgreSQL 9.1 32bit 
on Windows 7 64bit with raster 2.0 extension)
and updated those pixels that have specific spot heights. The raster is a 
single band 32BF raster.

What I wish to now do is to use those spot heights to create an elevation 
raster layer via which all NoDataValued pixels
have an elevation set that is interpreted from the spot heights around it.

Has anyone any suggestions as to how this can be done by PostGIS's ST_Raster? 
(ST_MapAlgebra perhaps etc?)

regards
Simon
--
Holder of "2011 Oracle Spatial Excellence Award for Education and Research."
SpatialDB Advice and Design, Solutions Architecture and Programming,
Oracle Database 10g Administrator Certified Associate; Oracle Database 10g SQL 
Certified Professional
Oracle Spatial, SQL Server, PostGIS, MySQL, ArcSDE, Manifold GIS, FME, Radius 
Topology and Studio Specialist.
39 Cliff View Drive, Allens Rivulet, 7150, Tasmania, Australia.
Website: www.spatialdbadvisor.com
  Email: si...@spatialdbadvisor.com
  Voice: +61 362 396397
Mobile: +61 418 396391
Skype: sggreener
Longitude: 147.20515 (147° 12' 18" E)
Latitude: -43.01530 (43° 00' 55" S)
GeoHash: r22em9r98wg
NAC:W80CK 7SWP3
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users