Re: [postgis-users] Creating a grid purely in SQL

2011-03-07 Thread Paragon Corporation
I think uDig still has that problem last we checked, but I don't think QGIS
does.  QGIS lets you pick the column.   

-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Mr.
Puneet Kishor
Sent: Monday, March 07, 2011 11:54 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Creating a grid purely in SQL

Thanks Leo, for the code fragment.

Re. storing multiple geometries in one column, I found the following caveat
--

[http://lists.refractions.net/pipermail/udig-users/2009-March/000553.html]

Briefly, is it possible that programs such as QGIS/uDig, etc. would get
confused about which column to draw? Does that concern still apply?


On Mar 7, 2011, at 11:50 PM, Paragon Corporation wrote:

> Puneet,
> 
> Something like this? This is a bit old.  We have some example in our 
> book using Common Table Expressions (CTEs) in chapter 8.  You can 
> download the code to see those as well.  
> http://www.postgis.us/chapter_08
> 
> http://www.bostongis.com/postgis_translate.snippet
> 
> As far as storing two geometry columns in one table.  Yes -- Just do 
> it by creating another column that is geometry (or using 
> AddGeometryColumn function).  We do it all the time.
> 
> Leo
> http://www.postgis.us
> 
> 
> 
> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net
> [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Mr.
> Puneet Kishor
> Sent: Monday, March 07, 2011 11:13 PM
> To: PostGIS Users Discussion
> Subject: [postgis-users] Creating a grid purely in SQL
> 
> Given a top-left starting point [ulx, uly], and a cell width 'w' and 
> height 'h', is it possible to create a table entirely in SQL populated 
> with rows increasing from left to right up to X and top to bottom up 
> to Y. The table schema would be something like --
> 
> CREATE TABLE cells (
>  cell_id INTEGER NOT NULL,
>  xmid DOUBLE PRECISION,
>  ymid DOUBLE PRECISION,
>  the_geom GEOMETRY,
>  CONSTRAINT cells_pkey PRIMARY KEY (cell_id) );
> 
> where xmid = (xmin + xmax) / 2 and ymid = (ymin + ymax) / 2, [xmin, 
> ymin, xmax, ymax] being the corners of each cell.
> 
> A bonus question -- is it possible to store two geometry columns in 
> one table? For example, if I wanted to store the geometry for both the 
> center points [xmin, ymid] as well as the box [xmin, ymin, xmax, 
> ymax], would that be possible? Would that even be recommended (for 
> example, to speed up queries/drawing, etc.).
> 
> Puneet.
> ___
> 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


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


Re: [postgis-users] images in postgresql

2011-03-07 Thread Paragon Corporation
Ben,
 
My understanding is the same (as long as you don't select the column that
is) otherwise has to be detoasted. As I recall, I think a small bit will be
stored and then the rest that doesn't fit into (I can't recall maximum
space), gets chunked into toast records.
 
Its true for most of the databases I've worked with - e.g. large text or
blobs just the pointer is stored in the main table, except PostgreSQL makes
this decision conditionally on size and other databases make it beforehand
based on data type.
 
However -- UPDATES will be painful I think because even though the data is
toasted, PostgreSQL will still create an MVCC copy of the whole record when
doing updates and slushing around big pictures and geometries can be
painful.  So if your other wind turbine info gets changed more often than
the photos, I would keep them separate.
 
 
Leo
http://www.postgis.us
 

  _  

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Ben
Madin
Sent: Monday, March 07, 2011 8:31 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] images in postgresql


Robert, 

On 06/03/2011, at 4:28 PM, Robert Buckley wrote:



The windturbine table exists in EPSG:4326. I made a seperate table for the
images because I didn´t wan´t to blow the size of the wind turbine table out
of proportion and jeopardize performance.



My understanding - and if I'm wrong I need to know(!) - is that the sort of
data you are talking about (large geometries or blobs - for your pictures)
are not stored in the primary table, but in associated storage space, known
as TOAST tables. 

This has important implications for indexing, but is brilliant because the
content of these data fields does not directly impact on the number of pages
that the table takes, hence rapid searching is still possible.

cheers

Ben







I am making a simple application to show wind turbines as wms and I wanted
to show the turbine in a popup. I´m not sure how to get the popup to display
though.

Any examples?
Thanks,

Rob




  _  

Von: Paragon Corporation 
An: PostGIS Users Discussion 
Gesendet: Samstag, den 5. März 2011, 18:21:49 Uhr
Betreff: Re: [postgis-users] images in postgresql


Robert,
 
Is there a reason why you have the points in a separate table or do you have
points in both tables and you want to relate by a spatial join?
 
  If its a 1 to 1 relationship, we would just put them in the same table.
 
As far as foreign keys go, you should have some identifier the same in the
two tables.  Do you? 
 
So it would be of the form
 
SELECT wt.wt_id, wt.geom, p.picture
FROM windturbines As wt INNER JOIN pictures As p ON wt.wt_id = p.wt_id
 
or if they are spatially related by space
 
 

SELECT wt.wt_id, wt.geom, p.picture
FROM windturbines As wt INNER JOIN pictures As p ON ST_DWithin(wt.geom,
pt.geom, 10)
 
 
The 10 depends on the spatial reference system or if you are using geography
type then it means 10 meters.  So I'm treating the wind turbine location and
picture location as the same if they are within 10 meters apart.
 
BTW: you might want to read the first chapter of our upcoming book.  It's a
free download and answers this type of question with concrete examples.
http://www.postgis.us/chapter_01
 
Leo
http://www.postgis.us
 
 

  _  

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Robert
Buckley
Sent: Saturday, March 05, 2011 5:39 AM
To: postgis-users@postgis.refractions.net
Subject: [postgis-users] images in postgresql


Hi,

I am just experimenting at the moment with a project and could do with some
advice.

I have created a database which contains photos of Windturbines.  I also
have a postgis database with the locations (points) of the wind turbines and
would like join the photos to the points via a link table or foreign key.

As you can tell, I haven´t too much experience with postgresql and
relational database design. But i can imagine that the task should not be
too difficult.

I am just a bit unsure how to go about it. The photos are on the linux
server and the creation of the table and the insert of the image was
successfull. But how do i get the  join and how would I display this photo
in a geoext project?

thanks for any tips,

Robert





___
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] Creating a grid purely in SQL

2011-03-07 Thread Mr. Puneet Kishor
Thanks Leo, for the code fragment.

Re. storing multiple geometries in one column, I found the following caveat --

[http://lists.refractions.net/pipermail/udig-users/2009-March/000553.html]

Briefly, is it possible that programs such as QGIS/uDig, etc. would get 
confused about which column to draw? Does that concern still apply?


On Mar 7, 2011, at 11:50 PM, Paragon Corporation wrote:

> Puneet,
> 
> Something like this? This is a bit old.  We have some example in our book
> using Common Table Expressions (CTEs) in chapter 8.  You can download the
> code to see those as well.  http://www.postgis.us/chapter_08
> 
> http://www.bostongis.com/postgis_translate.snippet
> 
> As far as storing two geometry columns in one table.  Yes -- Just do it by
> creating another column that is geometry (or using AddGeometryColumn
> function).  We do it all the time.
> 
> Leo
> http://www.postgis.us
> 
> 
> 
> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net
> [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Mr.
> Puneet Kishor
> Sent: Monday, March 07, 2011 11:13 PM
> To: PostGIS Users Discussion
> Subject: [postgis-users] Creating a grid purely in SQL
> 
> Given a top-left starting point [ulx, uly], and a cell width 'w' and height
> 'h', is it possible to create a table entirely in SQL populated with rows
> increasing from left to right up to X and top to bottom up to Y. The table
> schema would be something like --
> 
> CREATE TABLE cells (
>  cell_id INTEGER NOT NULL,
>  xmid DOUBLE PRECISION,
>  ymid DOUBLE PRECISION,
>  the_geom GEOMETRY,
>  CONSTRAINT cells_pkey PRIMARY KEY (cell_id) );
> 
> where xmid = (xmin + xmax) / 2 and ymid = (ymin + ymax) / 2, [xmin, ymin,
> xmax, ymax] being the corners of each cell.
> 
> A bonus question -- is it possible to store two geometry columns in one
> table? For example, if I wanted to store the geometry for both the center
> points [xmin, ymid] as well as the box [xmin, ymin, xmax, ymax], would that
> be possible? Would that even be recommended (for example, to speed up
> queries/drawing, etc.).
> 
> Puneet.
> ___
> 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] Creating a grid purely in SQL

2011-03-07 Thread Paragon Corporation
Puneet,

Something like this? This is a bit old.  We have some example in our book
using Common Table Expressions (CTEs) in chapter 8.  You can download the
code to see those as well.  http://www.postgis.us/chapter_08

http://www.bostongis.com/postgis_translate.snippet

As far as storing two geometry columns in one table.  Yes -- Just do it by
creating another column that is geometry (or using AddGeometryColumn
function).  We do it all the time.

Leo
http://www.postgis.us

 

-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Mr.
Puneet Kishor
Sent: Monday, March 07, 2011 11:13 PM
To: PostGIS Users Discussion
Subject: [postgis-users] Creating a grid purely in SQL

Given a top-left starting point [ulx, uly], and a cell width 'w' and height
'h', is it possible to create a table entirely in SQL populated with rows
increasing from left to right up to X and top to bottom up to Y. The table
schema would be something like --

CREATE TABLE cells (
  cell_id INTEGER NOT NULL,
  xmid DOUBLE PRECISION,
  ymid DOUBLE PRECISION,
  the_geom GEOMETRY,
  CONSTRAINT cells_pkey PRIMARY KEY (cell_id) );

where xmid = (xmin + xmax) / 2 and ymid = (ymin + ymax) / 2, [xmin, ymin,
xmax, ymax] being the corners of each cell.

A bonus question -- is it possible to store two geometry columns in one
table? For example, if I wanted to store the geometry for both the center
points [xmin, ymid] as well as the box [xmin, ymin, xmax, ymax], would that
be possible? Would that even be recommended (for example, to speed up
queries/drawing, etc.).

Puneet.
___
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] Creating a grid purely in SQL

2011-03-07 Thread Mr. Puneet Kishor
Given a top-left starting point [ulx, uly], and a cell width 'w' and height 
'h', is it possible to create a table entirely in SQL populated with rows 
increasing from left to right up to X and top to bottom up to Y. The table 
schema would be something like --

CREATE TABLE cells (
  cell_id INTEGER NOT NULL,
  xmid DOUBLE PRECISION,
  ymid DOUBLE PRECISION,
  the_geom GEOMETRY,
  CONSTRAINT cells_pkey PRIMARY KEY (cell_id)
);

where xmid = (xmin + xmax) / 2 and ymid = (ymin + ymax) / 2, [xmin, ymin, xmax, 
ymax] being the corners of each cell.

A bonus question -- is it possible to store two geometry columns in one table? 
For example, if I wanted to store the geometry for both the center points 
[xmin, ymid] as well as the box [xmin, ymin, xmax, ymax], would that be 
possible? Would that even be recommended (for example, to speed up 
queries/drawing, etc.).

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


Re: [postgis-users] images in postgresql

2011-03-07 Thread Ben Madin
Robert,

On 06/03/2011, at 4:28 PM, Robert Buckley wrote:

> The windturbine table exists in EPSG:4326. I made a seperate table for the 
> images because I didn´t wan´t to blow the size of the wind turbine table out 
> of proportion and jeopardize performance.

My understanding - and if I'm wrong I need to know(!) - is that the sort of 
data you are talking about (large geometries or blobs - for your pictures) are 
not stored in the primary table, but in associated storage space, known as 
TOAST tables. 

This has important implications for indexing, but is brilliant because the 
content of these data fields does not directly impact on the number of pages 
that the table takes, hence rapid searching is still possible.

cheers

Ben




> 
> I am making a simple application to show wind turbines as wms and I wanted to 
> show the turbine in a popup. I´m not sure how to get the popup to display 
> though.
> 
> Any examples?
> Thanks,
> 
> Rob
> 
> 
> Von: Paragon Corporation 
> An: PostGIS Users Discussion 
> Gesendet: Samstag, den 5. März 2011, 18:21:49 Uhr
> Betreff: Re: [postgis-users] images in postgresql
> 
> Robert,
>  
> Is there a reason why you have the points in a separate table or do you have 
> points in both tables and you want to relate by a spatial join?
>  
>   If its a 1 to 1 relationship, we would just put them in the same table.
>  
> As far as foreign keys go, you should have some identifier the same in the 
> two tables.  Do you? 
>  
> So it would be of the form
>  
> SELECT wt.wt_id, wt.geom, p.picture
> FROM windturbines As wt INNER JOIN pictures As p ON wt.wt_id = p.wt_id
>  
> or if they are spatially related by space
>  
>  
> SELECT wt.wt_id, wt.geom, p.picture
> FROM windturbines As wt INNER JOIN pictures As p ON ST_DWithin(wt.geom, 
> pt.geom, 10)
>  
>  
> The 10 depends on the spatial reference system or if you are using geography 
> type then it means 10 meters.  So I'm treating the wind turbine location and 
> picture location as the same if they are within 10 meters apart.
>  
> BTW: you might want to read the first chapter of our upcoming book.  It's a 
> free download and answers this type of question with concrete examples.
> http://www.postgis.us/chapter_01
>  
> Leo
> http://www.postgis.us
>  
>  
> 
> From: postgis-users-boun...@postgis.refractions.net 
> [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Robert 
> Buckley
> Sent: Saturday, March 05, 2011 5:39 AM
> To: postgis-users@postgis.refractions.net
> Subject: [postgis-users] images in postgresql
> 
> Hi,
> 
> I am just experimenting at the moment with a project and could do with some 
> advice.
> 
> I have created a database which contains photos of Windturbines.  I also have 
> a postgis database with the locations (points) of the wind turbines and would 
> like join the photos to the points via a link table or foreign key.
> 
> As you can tell, I haven´t too much experience with postgresql and relational 
> database design. But i can imagine that the task should not be too difficult.
> 
> I am just a bit unsure how to go about it. The photos are on the linux server 
> and the creation of the table and the insert of the image was successfull. 
> But how do i get the  join and how would I display this photo in a geoext 
> project?
> 
> thanks for any tips,
> 
> Robert
> 
> 
> 
> 
> ___
> 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] how to read a shapefile

2011-03-07 Thread Chad S
Hi all,

 I finally figured out that the examples of code on the website were for 2.7
only and not earlier versions. (unless there is an archive link i missed?).
Also i happened to come up on a link of some lab tutorial on how to read a
shapefile but it said
that the link was broken because of documentation updates and it gives you 2
links but the links are broken(there was a comment from last year regarding
this).

that link is here:
http://docs.codehaus.org/display/GEOTDOC/04+How+to+Read+a+Shapefile

Is there currently an up to date tutorial for 2.7 on how to read a
shapefile?


Also, I have old code that uses the vividsolutions Geometry & the WKTReader
to switch back and forth between this Geometry type and a srtext.

ex.

 com.vividsolutions.jts.geom.Geometry jtsArea = area.getJTSGeometry();
 CoordinateReferenceSystem originalCRS = area.getGtCRS();


Is there a way to interact or convert this to the org.geotools geometry
class or how are those packages different?

I guess my initial goal is to just be able to read a shapefile(possibly
casting a datastore to a shapefiledatastore or just using the datastore) and
be able to get things like the CRS of the shapefile, the boundaries, etc. I
am sure those things are easy once you can actually
connect to the shapefile that you want to read from.

Thanks for all the help!

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


[postgis-users] Editing a shapefile from PostGIS

2011-03-07 Thread Dheeraj Chand
Hello! have a shapefile of political districts that is giving me some grief. I 
thought that something had gone wrong in the shp2pgsql at first, so I opened 
the shapefile in QGIS.  Then I thought I had a bad shapefile, period, so I 
started looking for  as many different ones of the same geography as I could 
find, and the problem is replicated. Parts of district 9 are contained within 
parts of district 20, and vice versa.  

This is throwing off my labeling in a major way.  Is there some way so sort of 
take an eraser, so to speak, to those small islands of 9 and 20 that are 
contained in each other?


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


Re: [postgis-users] meters to degrees

2011-03-07 Thread Mike Toews
Hi Michal,

It looks like you declared your data in location.point using
longitude/latitude, rather than easting/northing. If you want to store
your data in projected EPSG:3044, you need to first transform it from
geographic units, e.g.:

SELECT ST_AsEWKT(ST_Transform(ST_SetSRID(ST_MakePoint(7.4545, 44.0),
4326), 3044));

looks like
"SRID=3044;POINT(376090.362129178 4873033.87926193)"

Now these units are in metres. You had previously declared your point
with Easting 7.4545 m and Northing 44.0 m, which is theoretically
somewhere near the equator. With geometry, you need to use all degrees
or all metres. You cannot mix units arbitrarily without transforming
them using ST_Transform.

If you are doing many things with mixed long/lat and measured metres,
you might want to take a look at the geography data type:
http://postgis.refractions.net/docs/ch04.html#PostGIS_Geography

-Mike

On 8 March 2011 04:49, michal nagy  wrote:
>
> Ok,
> basically I have table location(id int, point geometry(POINT)) and function 
> getallpointsincircle(longitude, latitude, radius) which gives set of internal 
> indexes from location table if point in table is in the radius of parameters 
> of function. Inside function I am using st_dwithin
>
> declare
> t2_row location%rowtype;
> po geometry;
> begin
> po:=st_geomfromtext('POINT('||lon||' '||lat||')',3044);
>
> for t2_row in select * from location
> loop
> if st_dwithin(t2_row.point,po, radius) is true
> then return next t2_row.id;
> end if;
> end loop;
> return;
> end;
>
> idst_astext
> 12
> POINT(7.4545 44)
> 13
> POINT(7.49785 44)
> 14
> POINT(7.6845 44)
> 15
> POINT(7.96311 44)
> 16
> POINT(55.859755 9.847419)
> these are test values in location table, as you can see point(16) has 
> measured coords, others are bogus.
> Now, when I execute my function select 
> getallpointsincircle(56.162882,10.203944,45000.0), all the indexes are 
> returned. Approximately the distance between these places is 40 km. But when 
> I exchange 45000.0 with 0.46 i will get proper index(16 in this case).
>
>
> 2011/3/7 Mike Toews 
>>
>> You are using EPSG:3044, correct? http://spatialreference.org/ref/epsg/3044/
>> This projection has units of metres. ST_DWithin and related functions use 
>> the same units of length as defined in the projection, which in this case is 
>> metres, not degrees. You may need to elaborate with an example.
>> -Mike
>>
>> On 7 March 2011 23:41, michal nagy  wrote:
>>>
>>> Well, it sitll does not solve my problem. As I said I am using 
>>> geometry(planar) with SRID 3044, where units are degrees, therefore when 
>>> using st_dwithin will still take input in degrees.
>>>
>>> 2011/3/7 Paragon Corporation 

 Use ST_DWithin instead.  
 http://www.postgis.org/documentation/manual-1.5SVN/ST_DWithin.html

 We cover this topic in detail in the first chapter of our book which is a 
 free download.

 http://www.postgis.us/chapter_01

 Leo and Regina
 
 From: postgis-users-boun...@postgis.refractions.net 
 [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of michal 
 nagy
 Sent: Monday, March 07, 2011 2:29 AM
 To: postgis-users@postgis.refractions.net
 Subject: [postgis-users] meters to degrees


 Hello everyone,

 I am new to Postgres and PostGIS. I have encountered one problem, that I
 can not deal with.I have table with various points that have SRID=3044,
 which should be UTM zone including Jutland. I have created function to
 loop through all points in table and check if they are within given
 radius(using geometry and function st_point_inside_circle). Now to the
 problem, for some reason st_point_inside_circle takes radius in degrees,
 which is very inconvenient for me. I would really need to  change to
 metres. If anyone has a suggestion, pls let me know.

 Thank you for help

 Michal
 ___
 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] meters to degrees

2011-03-07 Thread michal nagy
>
> Ok,
>
> basically I have table location(id int, point geometry(POINT)) and function
> getallpointsincircle(longitude, latitude, radius) which gives set of
> internal indexes from location table if point in table is in the radius of
> parameters of function. Inside function I am using st_dwithin
>
> declare
> t2_row location%rowtype;
> po geometry;begin
> po:=st_geomfromtext('POINT('||lon||' '||lat||')',3044);
> for t2_row in select * from location
> loop
> if st_dwithin(t2_row.point,po, radius) is truethen return next t2_row.id;end 
> if;end loop;return;end;
>
>
> idst_astext
> 12
> POINT(7.4545 44)
> 13
> POINT(7.49785 44)
> 14
> POINT(7.6845 44)
> 15
> POINT(7.96311 44)
> 16
> POINT(55.859755 9.847419)
>
> these are test values in location table, as you can see point(16) has
> measured coords, others are bogus.
> Now, when I execute my function select
> getallpointsincircle(56.162882,10.203944,45000.0), all the indexes are
> returned. Approximately the distance between these places is 40 km. But when
> I exchange 45000.0 with 0.46 i will get proper index(16 in this case).
>
>
>
> 2011/3/7 Mike Toews 
>
> You are using EPSG:3044, correct?
>> http://spatialreference.org/ref/epsg/3044/
>>
>> This projection has units of
>> metres. ST_DWithin and related functions use the same units of length as
>> defined in the projection, which in this case is metres, not degrees. You
>> may need to elaborate with an example.
>>
>> -Mike
>>
>>
>> On 7 March 2011 23:41, michal nagy  wrote:
>>
>>> Well, it sitll does not solve my problem. As I said I am using
>>> geometry(planar) with SRID 3044, where units are degrees, therefore when
>>> using st_dwithin will still take input in degrees.
>>>
>>> 2011/3/7 Paragon Corporation 
>>>
  Use ST_DWithin instead.
 http://www.postgis.org/documentation/manual-1.5SVN/ST_DWithin.html

 We cover this topic in detail in the first chapter of our book which is
 a free download.

 http://www.postgis.us/chapter_01

 Leo and Regina

  --
 *From:* postgis-users-boun...@postgis.refractions.net [mailto:
 postgis-users-boun...@postgis.refractions.net] *On Behalf Of *michal
 nagy
 *Sent:* Monday, March 07, 2011 2:29 AM
 *To:* postgis-users@postgis.refractions.net
 *Subject:* [postgis-users] meters to degrees


   Hello everyone,

 I am new to Postgres and PostGIS. I have encountered one problem, that I
 can not deal with.I have table with various points that have SRID=3044,
 which should be UTM zone including Jutland. I have created function to
 loop through all points in table and check if they are within given
 radius(using geometry and function st_point_inside_circle). Now to the
 problem, for some reason st_point_inside_circle takes radius in degrees,
 which is very inconvenient for me. I would really need to  change to
 metres. If anyone has a suggestion, pls let me know.

 Thank you for help

 Michal

 ___
 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] meters to degrees

2011-03-07 Thread Mike Toews
You are using EPSG:3044, correct? http://spatialreference.org/ref/epsg/3044/

This projection has units of
metres. ST_DWithin and related functions use the same units of length as
defined in the projection, which in this case is metres, not degrees. You
may need to elaborate with an example.

-Mike

On 7 March 2011 23:41, michal nagy  wrote:

> Well, it sitll does not solve my problem. As I said I am using
> geometry(planar) with SRID 3044, where units are degrees, therefore when
> using st_dwithin will still take input in degrees.
>
> 2011/3/7 Paragon Corporation 
>
>>  Use ST_DWithin instead.
>> http://www.postgis.org/documentation/manual-1.5SVN/ST_DWithin.html
>>
>> We cover this topic in detail in the first chapter of our book which is a
>> free download.
>>
>> http://www.postgis.us/chapter_01
>>
>> Leo and Regina
>>
>>  --
>> *From:* postgis-users-boun...@postgis.refractions.net [mailto:
>> postgis-users-boun...@postgis.refractions.net] *On Behalf Of *michal nagy
>> *Sent:* Monday, March 07, 2011 2:29 AM
>> *To:* postgis-users@postgis.refractions.net
>> *Subject:* [postgis-users] meters to degrees
>>
>>
>>   Hello everyone,
>>
>> I am new to Postgres and PostGIS. I have encountered one problem, that I
>> can not deal with.I have table with various points that have SRID=3044,
>> which should be UTM zone including Jutland. I have created function to
>> loop through all points in table and check if they are within given
>> radius(using geometry and function st_point_inside_circle). Now to the
>> problem, for some reason st_point_inside_circle takes radius in degrees,
>> which is very inconvenient for me. I would really need to  change to
>> metres. If anyone has a suggestion, pls let me know.
>>
>> Thank you for help
>>
>> Michal
>>
>> ___
>> 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] meters to degrees

2011-03-07 Thread michal nagy
Well, it sitll does not solve my problem. As I said I am using
geometry(planar) with SRID 3044, where units are degrees, therefore when
using st_dwithin will still take input in degrees.

2011/3/7 Paragon Corporation 

>  Use ST_DWithin instead.
> http://www.postgis.org/documentation/manual-1.5SVN/ST_DWithin.html
>
> We cover this topic in detail in the first chapter of our book which is a
> free download.
>
> http://www.postgis.us/chapter_01
>
> Leo and Regina
>
>  --
> *From:* postgis-users-boun...@postgis.refractions.net [mailto:
> postgis-users-boun...@postgis.refractions.net] *On Behalf Of *michal nagy
> *Sent:* Monday, March 07, 2011 2:29 AM
> *To:* postgis-users@postgis.refractions.net
> *Subject:* [postgis-users] meters to degrees
>
>
>   Hello everyone,
>
> I am new to Postgres and PostGIS. I have encountered one problem, that I
> can not deal with.I have table with various points that have SRID=3044,
> which should be UTM zone including Jutland. I have created function to
> loop through all points in table and check if they are within given
> radius(using geometry and function st_point_inside_circle). Now to the
> problem, for some reason st_point_inside_circle takes radius in degrees,
> which is very inconvenient for me. I would really need to  change to
> metres. If anyone has a suggestion, pls let me know.
>
> Thank you for help
>
> Michal
>
> ___
> 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] Convert from 3067 to 2393

2011-03-07 Thread Pena Kupen

I add +towgs4 to proj4text, conversion is working ok with sql below.

Thank's for your help and clarifying this!

--
AJL

Ralf Suhr [ralf.s...@itc-halle.de] kirjoitti: 

Hi Pena,

changing proj4text is almost save. EPSG:31467 as example have more then 3 
different towgs84. A better transformation can be NTv2 (+nadgrid parameter) 
with accuracy in centimeters or use towgs84 from 
http://www.kolumbus.fi/eino.uikkanen/geodocsgb/ficoords.htm with max error 
2meters.


The towgs84 parameter will only be affected in transformation from/ to wgs84 
ellipsoid. A direct transformation from ellipsoid "intl" to ellipsoid "grs80" 
will not use towgs84 parameter. That's a transformation will go intl->wgs84-
>grs80. One poor workaround is defining EPSG:3067 as "+proj=utm +zone=35 
+ellps=WGS84".


Gr
Ralf

Am Freitag 04 März 2011, 13:13:27 schrieben Sie:
> Ralf,
> 
> On our spatial_ref_sys at 2393 there is proj4text as

> +proj=tmerc +lat_0=0 +lon_0=27 +k=1.00 +x_0=350 +y_0=0 +ellps=intl
> +units=m +no_defs
> 
> It seems that +towgs4 is missing? If I change this, it it safe?
> 
> Do you mean like this?

> select x(ST_Transform(ST_Transform( tbl.p, 4326),2393)),
> y(ST_Transform(ST_Transform( tbl.p, 4326),2393)) from (select
> GeomFromText('POINT(108043 6683685)',3067) as p) as tbl
> 
> Result is same as before as:

> 3107866.533 6686516.654
> 
> --

> Pena
> 
> Ralf Suhr [ralf.s...@itc-halle.de] kirjoitti:

> > Hi Pena,
> > 
> > first verify EPSG:2393 is set with correct towgs84 parameters in

> > spatial_ref_sys (http://spatialreference.org/ref/epsg/2393/proj4/).
> > 
> > Because the destination EPSG is not based on WGS84 ellipsoid you have to

> > transform twice: ST_Transform( ST_Transform( POINT_FROM_3067, 4326),
> > 2393)
> > 
> > Gr

> > Ralf
> > 
> > Am Freitag 04 März 2011, 11:53:44 schrieb Pena Kupen:

> > > Hello all,
> > > 
> > > I try to do some conversion between different coordinates (3067 to 2393

> > > ) without saving them to database. My sql is following:
> > > select x(ST_Transform(tbl.p,2393)), y(ST_Transform(tbl.p,2393)) from
> > > (select GeomFromText('POINT(108043 6683685)',3067) as p) as tbl
> > > 
> > > result:

> > > 3107866.533 6686516.654
> > > 
> > > Correct one is:

> > > 3108053.305 6686493.081
> > > 
> > > location is about 200m too much on west.
> > > 
> > > Any ideas?






--
Wippies-vallankumous on täällä! Varmista paikkasi vallankumouksen eturintamassa 
ja liity Wippiesiin heti!
http://www.wippies.com/

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


Re: [postgis-users] Postgis installation on fedora.

2011-03-07 Thread Pedro Doria Meunier

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

yum install postgis

HTH
Pedro.

On 03/07/2011 08:23 AM, Smith Roman wrote:
> Hello,
>
> Postgis installation on fedora.
>
> I intend to try out the installation of postgis on fedora. I have
downloaded the postgresql 9 and successfully installed it on fedora.
> To install postgis I can use the stack builder application. I will like
to ask if there is a postgis bin or rpm installer similar to the
> windows .exe installer available ? Is stack builder the only option ?
>
> Cheers,
>
> Roman.
>
>
>
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk10l70ACgkQ2FH5GXCfxAsUMgCaAiAj+EXFd6nHsXIpZLzbGZ1g
cosAn22Re4J6+CkmhvXZ95oPjf1eMY/v
=sjko
-END PGP SIGNATURE-

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


Re: [postgis-users] Postgis installation on fedora.

2011-03-07 Thread Devrim GÜNDÜZ
On Mon, 2011-03-07 at 00:23 -0800, Smith Roman wrote:
>  I intend to try out the installation of postgis on fedora. I have
> downloaded the postgresql 9 and successfully installed it on fedora.
>  To install postgis I can use the stack builder application. I will
> like to ask if there is a postgis bin or rpm installer similar to the
>   windows .exe installer available ? 

http://yum.pgrpms.org

Regards,
-- 
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz


signature.asc
Description: This is a digitally signed message part
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Postgis installation on fedora.

2011-03-07 Thread Smith Roman
Hello,

Postgis installation on fedora.

 I intend to try out the installation of postgis on fedora. I have downloaded 
the postgresql 9 and successfully installed it on fedora.
 To install postgis I can use the stack builder application. I will like to ask 
if there is a postgis bin or rpm installer similar to the
  windows .exe installer available ? Is stack builder the only option ?

Cheers,

Roman.


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


Re: [postgis-users] meters to degrees

2011-03-07 Thread Paragon Corporation
Use ST_DWithin instead.
http://www.postgis.org/documentation/manual-1.5SVN/ST_DWithin.html
 
We cover this topic in detail in the first chapter of our book which is a
free download.
 
http://www.postgis.us/chapter_01
 
Leo and Regina

  _  

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of michal
nagy
Sent: Monday, March 07, 2011 2:29 AM
To: postgis-users@postgis.refractions.net
Subject: [postgis-users] meters to degrees





Hello everyone,

I am new to Postgres and PostGIS. I have encountered one problem, that I
can not deal with.I have table with various points that have SRID=3044,
which should be UTM zone including Jutland. I have created function to
loop through all points in table and check if they are within given
radius(using geometry and function st_point_inside_circle). Now to the
problem, for some reason st_point_inside_circle takes radius in degrees,
which is very inconvenient for me. I would really need to  change to
metres. If anyone has a suggestion, pls let me know.

Thank you for help

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