Re: [postgis-users] setting up a read only user / group for AutoCAD, ArcGIS, QGIS, and MapServer.

2014-04-14 Thread Andy Colson

On 4/14/2014 7:25 AM, Mark Volz wrote:

Hello,

I would like to set up a user account in PostGIS / PostGRES with the
following:

·The user has read only access to all of the layers in a particular
database.

·The user also have read only access to any layers added or updated
through the shapefile uploader.

·The client software may be ArcGIS*, AutoCAD (Map), QGIS, MapServer, etc.

*ArcGIS will use “query layers”, not SDE.

If anyone has any cliff notes on how to properly  set up read only
permissions please let me know.

Thank You

Sincerely,

Mark Volz, GISP




You can think of users and groups pretty much the same.  user and 
role are mostly interchangeable.


Doesn't really matter who the owner of the db is, that can stay as-is.

We'll create a new role:

create user unwashed with password 'notpassword';
-- the difference between role and user is the can login right.  For 
me I was gonna grant them all login rights anyway.  You should be able 
to change the above to create role if you wanted to tighten it down.


-- grant it select
grant select on maintable to unwashed;

-- if you use sequences, they need rights
grant all on sequence maintable_id_seq to unwashed;

-- func's need exec:
grant execute on function update(userid integer) to unwashed;


-- There might be other's I'm missing.
-- Then create a new user in the unwashed group:

create user bob with nocreaterole password 'notpassword' in role unwashed;

Its simple to add/remove users now.  When you create new stuff, remember 
to grant the unwashed select rights. :-)


-Andy


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


Re: [postgis-users] curves geometries and topology

2014-04-14 Thread Eric Ladner
As long as they are simple circles, you should be able to convert back and
forth between curves and lines.  Splines, beziers, et al, are probably not
going to work at all and would need to be approximated as lines.

http://boundlessgeo.com/2012/01/getting-curvey/


On Mon, Apr 14, 2014 at 8:02 AM, Reijer Copier reijer.cop...@idgis.nlwrote:

 Dear list,

 According to the documentation, PostGIS Topology only supports edges made
 out of linestrings. However, we are currently working on a dataset that
 contains lots of curved geometries. It would be great if we could build
 topology based on those curved geometries without having to convert them to
 linestrings first. Is this possible? If not, what is the best way to deal
 with this situation?

 --

 Kind regards,

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




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

Re: [postgis-users] setting up a read only user / group for AutoCAD, ArcGIS, QGIS, and MapServer.

2014-04-14 Thread Richard Greenwood
On Mon, Apr 14, 2014 at 8:01 AM, Andy Colson a...@squeakycode.net wrote:

 On 4/14/2014 7:25 AM, Mark Volz wrote:

 Hello,

 I would like to set up a user account in PostGIS / PostGRES with the
 following:

 ·The user has read only access to all of the layers in a particular
 database.

 ·The user also have read only access to any layers added or updated
 through the shapefile uploader.

 ·The client software may be ArcGIS*, AutoCAD (Map), QGIS, MapServer, etc.

 *ArcGIS will use “query layers”, not SDE.

 If anyone has any cliff notes on how to properly  set up read only
 permissions please let me know.

 Thank You

 Sincerely,

 Mark Volz, GISP



 You can think of users and groups pretty much the same.  user and role
 are mostly interchangeable.

 Doesn't really matter who the owner of the db is, that can stay as-is.

 We'll create a new role:

 create user unwashed with password 'notpassword';
 -- the difference between role and user is the can login right.  For me
 I was gonna grant them all login rights anyway.  You should be able to
 change the above to create role if you wanted to tighten it down.

 -- grant it select
 grant select on maintable to unwashed;

 -- if you use sequences, they need rights
 grant all on sequence maintable_id_seq to unwashed;

 -- func's need exec:
 grant execute on function update(userid integer) to unwashed;


 -- There might be other's I'm missing.
 -- Then create a new user in the unwashed group:

 create user bob with nocreaterole password 'notpassword' in role unwashed;

 Its simple to add/remove users now.  When you create new stuff, remember
 to grant the unwashed select rights. :-)


There is also ALTER DEFAULT PRIVILEGES at the database level and at the
schema level. It is handy when you are adding stuff so that you don't have
to explicitly grant privileges every time.

ALTER DEFAULT PRIVILEGES IN SCHEMA some_schema
GRANT SELECT ON TABLES
TO unwashed;

-- 
Richard Greenwood
richard.greenw...@gmail.com
www.greenwoodmap.com
___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Re: [postgis-users] How to check if two linestring are near to each other

2014-04-14 Thread Åsmund Tokheim
Hi

The test
select st_hausdorffdistance(st_geometryfromtext('LineString(0 0, 1 0)'),
st_geometryfromtext('LineString(0 5, 1 5)'))
gives a distance of 5, not 0 as one would expect if HD only measured shape
similarity, so I think it still can be used for your task. Something like
hibernate spatial should provide programmatic interfaces for common gis
functions, but I suspect you have to write native sql if you want to use
postgis-specific functions like hausdorffdistance.

Åsmund


On Mon, Apr 14, 2014 at 9:36 AM, Rémi Cura remi.c...@gmail.com wrote:

 Hey,
 I'm not so sure Hausdorff distance is what you want.
 It measure how similar 2 shapes are, yet you could have two very similar
 parts of a road network that are very far away.
 In you case you are trying to express both lines that are close to each
 other __and__ that are similar in shape.

 Of course the obvious (but painfull) way to go would be to use postgis
 topology with the tolerance set to your GPS error (+ width of the road).
 This way close path would be merged automatically.

 Cheers,
 Rémi-C


 2014-04-13 23:56 GMT+02:00 Raghavan Krishnasamylakshmanaperumal 
 rkris...@uic.edu:

 Hi Åsmund,

 Thanks for suggesting ST_HausdorffDistance, I tried this function
 directly on the database using sql query and it looks like solving my
 problem.

 Are these functions ST_HausdorffDistance/ST_Distance available as java
 APIs? I am trying to use org.postgis(postgis-jdbc-1.3.1.jar) library but
 not sure how to access the above mentioned functions using java. Please
 suggest me which package to look into to make use of these functions
 programmatically?

 Thanks in advance.

 -Raghavan


 On Sun, Apr 13, 2014 at 1:45 PM, Åsmund Tokheim asmun...@gmail.comwrote:

 Hi

 I think you should be able to use hausdorff distance
 http://postgis.net/docs/ST_HausdorffDistance.html to recognize that the
 green, red and blue lines in your image are all similar. This method will
 fail to recognize shared portions of a path (e.g. if the blue line at some
 point diverges from the red and green line), but I'm not sure if this is a
 requirement for your task

 Åsmund


 On Sat, Apr 12, 2014 at 9:41 PM, Raghavan Krishnasamylakshmanaperumal 
 rkris...@uic.edu wrote:

 Hi,

 I have formed a graph using my GPS traces of running/biking activities
 in which I have many edges representing the same path. For example every
 time I run from node-A to node-B my GPS traces are noted close to each
 other like the red,green,blue lines in the attached image. Actually those 3
 lines are same(representing the same path), so I want to detect such
 linestrings automatically and keep only one linestring and ignore others.
 Is there any way in PostGIS which can help me to detect the
 nearness/closeness of the linestrings?

 --
 Thanks and Regards,
 Raghavan KL

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



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




 --
 Thanks and Regards,
 Raghavan KL

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



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

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