Re: [postgis-users] Tiger Geocoder 2010 setup issues

2011-06-28 Thread Paragon Corporation
Daniel,
 
Yap.  what we had done is move the declaration up above the CD call since we
rna into same issue when testing in Linux.  As I recall I think when people
complained about the issue, the CD call came before the STATEDIR.
 
Regarding 1.5.3.  You should be fine to run with that.  For our production
work involving tiger geocoder, we are using PostGIS 1.5 and I think most
people are actually and just testing on PostGIS 2.0. 
 
However we did make changes that now require PostgreSQL 8.4 or above.  So
you need to be running at least PostGIS 1.5 and PostgreSQL 8.4+.
 
 
Did you verify you have a tiger schema in your database and that it does
have tables -- addr,  county, edges, faces etc?
 
>From the addr fatal error you described we guessed 1 of 3 things was
happening
 
a) Your script was pointing at the wrong database and not the one you loaded
tiger in
b) The tiger schema wasn't in your search path --- If you look at the
create_geocode.sh (you'll see a remarked out line to alter db to add tiger
to your database search path), this is a common mistake people make not
having that line
which causes the error you described. We left it remarked out since some
people have custom search paths and we didn't want to overwrite them.
 
c) Your database just doesn't have the skeleton and lookup tables or is
missing one of them 
 
Like I said your next issue is your pg_hba.conf or you have another instance
of PostgreSQL running and you are pointing at the wrong instance.
 
Regina and Leo,
http://www.postgis.us
 
 
  _  

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Daniel
Weitzenfeld
Sent: Tuesday, June 28, 2011 6:52 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Tiger Geocoder 2010 setup issues


Thank you Regina and Leo. It sounds like I might have a version issue. 

I'm using PostGIS 1.5.3, as per the installation instructions here:
http://postgis.refractions.net/docs/ch02.html

When you suggested redownloading, did you mean all of PostGIS, or just the
geocoder?

Is the code here the up to date version?  here =
http://svn.osgeo.org/postgis/trunk/extras/tiger_geocoder/tiger_2010/
Because in tiger_loader.sql at that location, there's the line:

E'STATEDIR="${staging_fold}/${website_root}/${state_fold}"





Is that the fixed version?  

In the meantime, I'll work on my ident issues. 







On Tue, Jun 28, 2011 at 11:46 PM, Paragon Corporation  wrote:


Daniel,

Haven't had a chance to recheck our script to confirm its not something
amiss.

Which version of PostGIS  are you working with?

 You can ignore the does not exist, skipping errors -- those are trying to
drop tables which wouldn't exist for new installs.

The addr does not exist often happens if you don't have tiger in your
database search_path.  Make sure its in your search_path.  Also you can
verify the table exists
By making sure you have a tiger schema and it has tables like addr, edges
etc.

Regarding your ident problem.

PostgreSQL can listen on localhost or local port and depending on which that
has to be registered in pg_hba.conf

You can try taking out the PGHOST line since you may be running only on a
non-IP port and see if that helps or change your pg_hba.conf to allow.

Regarding this issue:

STATEDIR="/gisdata/www2.census.gov/geo/pvs/tiger2010st/36_New_York"

especially because an early command is

 cd $STATEDIR


I'm pretty sure we fixed that so I suspect your version is probably out of
data and you may want to just redownload from PostGIS site (either the SVN
tar ball or directly from svn)

Regina and Leo
http://www.postgis.us


-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Daniel
Weitzenfeld
Sent: Tuesday, June 28, 2011 6:51 AM
To: postgis-users@postgis.refractions.net
Subject: [postgis-users] Tiger Geocoder 2010 setup issues


Hi,
I'm trying to setup the TIGER Geocoder, following the readme here:
http://svn.osgeo.org/postgis/trunk/extras/tiger_geocoder/tiger_2010/README
I'm setting it up on a centos 5.5 server.
My questions are below, organized by the step in the README.

--| Step 3.  Edit the tiger_loader.sql to the paths of your
executables server etc.
Is the UNZIPTOOL variable supposed to be changed, or left at its default?
UNZIPTOOL=unzip

--| Step 4.  Edit the create_geocode.bat or create_geocode.sh and
--| run

When I ran the file, I got a boatload of NOTICEs like the following,
interspersed throughout the output:

psql:tables/lookup_tables_2010.sql:4: NOTICE:  table "direction_lookup" does
not exist, skipping
psql:tables/lookup_tables_2010.sql:39: NOTICE:  table
"secondary_unit_lookup" does not exist, skipping

Is this something I should be concerned about?  Did I skip something?

Perhaps more alarmingly, the output finished with this:

COMMIT
ERROR:  relation "addr" does not exist

Again, what should I do?

--| 8. Run this com

Re: [postgis-users] Noob request - using ST_SimplifyPreserveTopology() on Tiger Data

2011-06-28 Thread Greg Williamson
I saw a thread recently on the the Open Source Mapping / US mail list ... see 
for instance:

 

There is a reference in there to running a "simplify" from the JOSM code base 
-- that is almost certainly open source, and may help.

I hope ...

Greg WIlliamson


From: Christian Guirreri 
To: PostGIS Users Discussion ; Christian 
Guirreri 
Sent: Tuesday, June 28, 2011 3:07 PM
Subject: Re: [postgis-users] Noob request - using ST_SimplifyPreserveTopology() 
on Tiger Data


On Tue, Jun 28, 2011 at 5:32 PM, Sandro Santilli  wrote:

Does it mean the source code is publically accessible ?

Yes via a SWF Decompiler. But Flash is only rendering shapes and passing them 
onto backend scripts, thanks to vanrijkom's shape reader for actionscript. As 
far as I know, Flash does not do any of the actual shapefile simplification

Do you have a link to source code of the backend too ?

Nope 
___
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] Tiger Geocoder 2010 setup issues

2011-06-28 Thread fork
Daniel Weitzenfeld  gmail.com> writes:

> 
> Hi,
> I'm trying to setup the TIGER Geocoder, following the readme here:
> http://svn.osgeo.org/postgis/trunk/extras/tiger_geocoder/tiger_2010/README
> I'm setting it up on a centos 5.5 server.

As a completely different approach, not yet organized, here is some code I 
wrote:

https://gist.github.com/885803#file_tiger_postgis_loader.sh

It probably won't run as-is, or be completely obvious, and it will probably
require you edit which state you are downloading near the top of the script, but
it might be helpful nevertheless.  I would happily answer any questions about
it.  I had hoped to get it to be purely command line driven (instead of fiddling
with variables in the script itself), but I haven't had time.

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


Re: [postgis-users] Tiger Geocoder 2010 setup issues

2011-06-28 Thread Daniel Weitzenfeld
Thank you Regina and Leo. It sounds like I might have a version issue.

I'm using PostGIS 1.5.3, as per the installation instructions here:
http://postgis.refractions.net/docs/ch02.html

When you suggested redownloading, did you mean all of PostGIS, or just the
geocoder?

Is the code here the up to date version?  here =
http://svn.osgeo.org/postgis/trunk/extras/tiger_geocoder/tiger_2010/
Because in tiger_loader.sql at that location, there's the line:

E'STATEDIR="${staging_fold}/${website_root}/${state_fold}"

Is that the fixed version?

In the meantime, I'll work on my ident issues.







On Tue, Jun 28, 2011 at 11:46 PM, Paragon Corporation  wrote:

> Daniel,
>
> Haven't had a chance to recheck our script to confirm its not something
> amiss.
>
> Which version of PostGIS  are you working with?
>
>  You can ignore the does not exist, skipping errors -- those are trying to
> drop tables which wouldn't exist for new installs.
>
> The addr does not exist often happens if you don't have tiger in your
> database search_path.  Make sure its in your search_path.  Also you can
> verify the table exists
> By making sure you have a tiger schema and it has tables like addr, edges
> etc.
>
> Regarding your ident problem.
>
> PostgreSQL can listen on localhost or local port and depending on which
> that
> has to be registered in pg_hba.conf
>
> You can try taking out the PGHOST line since you may be running only on a
> non-IP port and see if that helps or change your pg_hba.conf to allow.
>
> Regarding this issue:
> STATEDIR="/gisdata/www2.census.gov/geo/pvs/tiger2010st/36_New_York"
>
> especially because an early command is
>
>  cd $STATEDIR
>
> I'm pretty sure we fixed that so I suspect your version is probably out of
> data and you may want to just redownload from PostGIS site (either the SVN
> tar ball or directly from svn)
>
> Regina and Leo
> http://www.postgis.us
>
>
> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net
> [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Daniel
> Weitzenfeld
> Sent: Tuesday, June 28, 2011 6:51 AM
> To: postgis-users@postgis.refractions.net
> Subject: [postgis-users] Tiger Geocoder 2010 setup issues
>
> Hi,
> I'm trying to setup the TIGER Geocoder, following the readme here:
> http://svn.osgeo.org/postgis/trunk/extras/tiger_geocoder/tiger_2010/README
> I'm setting it up on a centos 5.5 server.
> My questions are below, organized by the step in the README.
>
> --| Step 3.  Edit the tiger_loader.sql to the paths of your
> executables server etc.
> Is the UNZIPTOOL variable supposed to be changed, or left at its default?
> UNZIPTOOL=unzip
>
> --| Step 4.  Edit the create_geocode.bat or create_geocode.sh and
> --| run
>
> When I ran the file, I got a boatload of NOTICEs like the following,
> interspersed throughout the output:
>
> psql:tables/lookup_tables_2010.sql:4: NOTICE:  table "direction_lookup"
> does
> not exist, skipping
> psql:tables/lookup_tables_2010.sql:39: NOTICE:  table
> "secondary_unit_lookup" does not exist, skipping
>
> Is this something I should be concerned about?  Did I skip something?
>
> Perhaps more alarmingly, the output finished with this:
>
> COMMIT
> ERROR:  relation "addr" does not exist
>
> Again, what should I do?
>
> --| 8. Run this command at psql or pgAdmin III query window to
> generate the script.
> The first line of the generated script doesn't look right:
>
> STATEDIR="/gisdata/www2.census.gov/geo/pvs/tiger2010st/36_New_York"
>
> especially because an early command is
>
>  cd $STATEDIR
>
> Also, when I try to run the generated script anyway, I get a boatload of
> these:
>
> psql: FATAL:  Ident authentication failed for user "daniel"
>
> ...which is strange to me because I user I thought user daniel had rights
> on
> the PGDATABASE.  Indeed, user daniel can create/delete schemas on it.  Am I
> misunderstanding something about postgres permissions?
>
> Thanks in advance for any guidance you can provide.
> Best,
> -Daniel
> ___
> 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] Noob request - using ST_SimplifyPreserveTopology() on Tiger Data

2011-06-28 Thread Christian Guirreri
On Tue, Jun 28, 2011 at 5:32 PM, Sandro Santilli  wrote:

> Does it mean the source code is publically accessible ?
>

Yes via a SWF Decompiler. But Flash is only rendering shapes and passing
them onto backend scripts, thanks to vanrijkom's shape reader for
actionscript. As far as I know, Flash does not do any of the actual
shapefile simplification


> Do you have a link to source code of the backend too ?
>

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


[postgis-users] ST_OffsetCurve

2011-06-28 Thread Felipe Provenzale
Hello everyone!!

I need to add a .patch file in Postgis, ST_OffsetCurve developed by Rafal
Magda. I'm using Windows XP, Postgre 9.0 and Postgis 1.5, and I couldn't
find a way to add this .patch file. I need to create parallel lines in a
MULTILINESTRING table, with more of 600 lines, and I think that this
function will be helpfull.

Somebody could tell me how can I include this function on Postgis?

Any help is welcome.

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


Re: [postgis-users] Noob request - using ST_SimplifyPreserveTopology() on Tiger Data

2011-06-28 Thread Sandro Santilli
On Tue, Jun 28, 2011 at 05:19:31PM -0400, Christian Guirreri wrote:
> I'm actually quite the flash wizard myself and have also looked through
> their code extensively.

Does it mean the source code is publically accessible ?

> There's a PHP backend driving things via Flash
> remoting and its actually described in some detail here, written by the
> authors:
> http://www.cartogis.org/docs/proceedings/2006/bloch_harrower.pdf

The paper describes the process as following the first 
proceeding I suggested in my previous mails: building a topology first.

Do you have a link to source code of the backend too ?

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Noob request - using ST_SimplifyPreserveTopology() on Tiger Data

2011-06-28 Thread Christian Guirreri
I'm actually quite the flash wizard myself and have also looked through
their code extensively. There's a PHP backend driving things via Flash
remoting and its actually described in some detail here, written by the
authors:
http://www.cartogis.org/docs/proceedings/2006/bloch_harrower.pdf



On Tue, Jun 28, 2011 at 4:26 PM, Sandro Santilli  wrote:

> On Tue, Jun 28, 2011 at 03:57:17PM -0400, Christian Guirreri wrote:
>
> > Out of curiosity, how does MapShaper handle this on the backend?
>
> I've no idea, I've never looked at MapShaper.
> Now that you mentioned it I tried launching it but it's implemented
> in AS3 and compiled in ABC bytecode which currently requires use of
> proprietary software for being run (an AVM2 capable flash player).
>
> I didnt' find any download link from the mapshaper.org website
> so I guess it's not even meant to give you the freedom to look
> at how things are done.
>
> You shouldn't be using it, it's a trap...
>
> Anyway, try kindly asking their authors.
>
> --strk;
>
>  ()   Free GIS & Flash consultant/developer
>  /\   http://strk.keybit.net/services.html
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] PostGIS query layer in ArcMap - Double valueslooklike integers

2011-06-28 Thread Sheara Cohen
Rob - That was exactly the problem. I had no idea that setting was in there (or 
where it was). Thank you!

Sheara


-Original Message-
From: postgis-users-boun...@postgis.refractions.net on behalf of 
robert_cl...@doh.state.fl.us
Sent: Tue 6/28/2011 1:06 PM
To: postgis-users@postgis.refractions.net
Subject: Re: [postgis-users] PostGIS query layer in ArcMap - Double 
valueslooklike integers
 
Could it be the Rounding settings in the Number Format dialog? You can
access the Number Format dialog by clicking the [...] to the right of
the word "Numeric" in the Field Properties dialog.
 
-Rob
 



From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of
Sheara Cohen
Sent: Tuesday, June 28, 2011 3:17 PM
To: postgis-users@postgis.refractions.net
Subject: [postgis-users] PostGIS query layer in ArcMap - Double values
looklike integers



Does anyone know why the values in a double field would appear like
integers when a PostGIS file is viewed as a query layer in ArcMap?

In other words, I've added a PostGIS table as a query layer to ArcMap,
and when I open the attribute table, several fields only have integer
values (no decimal places) even though you can check the properties of
those fields and verify that they are indeed double. When the same table
is viewed in PGAdmin the values display with all their appropriate
decimal places.

What gives?

Thank you.

Sheara 


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


Re: [postgis-users] Noob request - using ST_SimplifyPreserveTopology() on Tiger Data

2011-06-28 Thread Sandro Santilli
On Tue, Jun 28, 2011 at 03:00:47PM -0400, Christian Guirreri wrote:
> OK works- thanks.
> 
> So I'm learning now about the difference between what MapShaper does and
> what ST_Stimplify does. Is there any way to make sure that simplified
> boundary lines will match other boundary lines? i.e. even the smallest
> simplifications (like 0.05) produces very visible gaps between adjacent
> districts.

What you could do is convert your layer to a topological representation,
simplify each edge of the topology and then convert back to simple features.

I'm looking for a sponsor to make the first part easier.
Second part is easy already.

If you're unfamiliar with postgis topology,
here's a presentation I gave in Paris last week:
http://strk.keybit.net/projects/postgis/Paris2011_TopologyWithPostGIS_2_0.pdf
And, there's info on the wiki too.

Another approach could be using ST_Snap to snap each simplified geometry
against the collected vertices of each previously simplified one falling 
within a slightly enlarged bounding box of the geometry you're simplifying.

--strk;

> On Tue, Jun 28, 2011 at 1:12 PM, Sandro Santilli  wrote:
> 
> > Christian,
> > I suggest you create a new geometry field w/out enforcing type constraints
> > on it, write the simplified version in there and then see what you get.
> >
> > --strk;
> >
> > On Tue, Jun 28, 2011 at 12:15:13PM -0400, Christian Guirreri wrote:
> > > Same error. Tried both Polygon and Multipolygon. I'm not sure which the
> > > Tiger Data is.
> > >
> > > On Tue, Jun 28, 2011 at 11:41 AM, Ben Madin
> > > wrote:
> > >
> > > > Christian,
> > > >
> > > > My guess here is that because you've told the geometry to be a
> > > > MULTIPOLYGON, but you may have returned a POLYGON, you have indeed
> > violated
> > > > the check constraint on the geometry type.
> > > >
> > > > try using st_multi() to get around it, as in :
> > > >
> > > > update public.tl_2010_us_cd111 set simple_geom =
> > > > ST_Multi(ST_SimplifyPreserveTopology(the_geom, 15));
> > > >
> > > >
> > > > cheers
> > > >
> > > > Ben
> > > >
> > > >
> > > >
> > > > On 28/06/2011, at 11:23 PM, Christian Guirreri wrote:
> > > >
> > > > I get the following error:
> > > > ERROR: new row for relation "tl_2010_us_cd111" violates check
> > constraint
> > > > "enforce_geotype_simple_geom"
> > > > SQL state: 23514
> > > >
> > > > Here's my SQL:
> > > > select addGeometryColumn('public', 'tl_2010_us_cd111', 'simple_geom',
> > 4326,
> > > > 'MULTIPOLYGON', 2);
> > > > update public.tl_2010_us_cd111 set simple_geom =
> > > > ST_SimplifyPreserveTopology(the_geom, 15);
> > > >
> > > >
> > > > On Mon, Jun 27, 2011 at 2:07 PM, Stephen Woodbridge <
> > > > wood...@swoodbridge.com> wrote:
> > > >
> > > >> On 6/27/2011 1:37 PM, Christian Guirreri wrote:
> > > >>
> > > >>> I'm trying to do something fairly simple. I'd like to take the Tiger
> > > >>> 2010 Data - tl_2010_us_cd111 and tl_2010_us_county10 - and create
> > shape
> > > >>> files that are considerably smaller and more simplified. In the past
> > > >>> I've just used MapShaper and been OK with that, but I was having
> > trouble
> > > >>> uploading tl_2010_us_county10 into it and I've decided its time to
> > learn
> > > >>> some GIS basics anyway.
> > > >>>
> > > >>> I've definitely successfully setup my environment - PostegreSQL 9
> > with
> > > >>> PostGIS. I've used the shp2pgsql wizard included with pgadmin to
> > import
> > > >>> the data sets into their own databases, without the "Load Geography
> > > >>> column" checked. I've been able to export this data back to shp
> > > >>> using pgsql2shp and view the resulting shp in QuantumGIS and ACDSee
> > > >>> Canvas.
> > > >>>
> > > >>> But when it comes to simplification - I'm not sure where to even
> > > >>> start. I'm no database expert beyond some simple mysql so GIS is
> > > >>> especially overwhelming. I only know that I want to
> > > >>> use ST_SimplifyPreserveTopology() as I'm fairly certain a number of
> > > >>> things will disappear if I don't.
> > > >>>
> > > >>> Would love if someone could provide me with the SQL to make this
> > happen!
> > > >>>
> > > >>
> > > >> First you should understand that ST_SimplifyPreserveTopology() works
> > on a
> > > >> single geometry at a time and not on multiple geometries in a
> > coverage. The
> > > >> difference is in a coverage the the polygons that share a common edge
> > that
> > > >> is simplified would continue to have a common simplified edge. When
> > polygons
> > > >> are simplified individually with knowledge of the adjacent polygons it
> > is
> > > >> possible for gaps and overlaps to occur along the simplified edge.
> > > >> ST_SimplifyPreserveTopology() is designed to try and minimize these
> > effects
> > > >> but there are no guarantees.
> > > >>
> > > >> You might try something like:
> > > >>
> > > >> select addGeometryColum('myschema', 'mytable', 'simple_geom', 4326,
> > > >> 'MULTIPOLYGON', 2);
> > > >> update myschema.mytable set simple_geom =
> > ST_SimplifyPreserveT

Re: [postgis-users] Noob request - using ST_SimplifyPreserveTopology() on Tiger Data

2011-06-28 Thread Sandro Santilli
On Tue, Jun 28, 2011 at 03:57:17PM -0400, Christian Guirreri wrote:

> Out of curiosity, how does MapShaper handle this on the backend?

I've no idea, I've never looked at MapShaper.
Now that you mentioned it I tried launching it but it's implemented
in AS3 and compiled in ABC bytecode which currently requires use of
proprietary software for being run (an AVM2 capable flash player).

I didnt' find any download link from the mapshaper.org website
so I guess it's not even meant to give you the freedom to look
at how things are done.

You shouldn't be using it, it's a trap...

Anyway, try kindly asking their authors.

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] PostGIS query layer in ArcMap - Double values looklike integers

2011-06-28 Thread Robert_Clift
Could it be the Rounding settings in the Number Format dialog? You can
access the Number Format dialog by clicking the [...] to the right of
the word "Numeric" in the Field Properties dialog.
 
-Rob
 



From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of
Sheara Cohen
Sent: Tuesday, June 28, 2011 3:17 PM
To: postgis-users@postgis.refractions.net
Subject: [postgis-users] PostGIS query layer in ArcMap - Double values
looklike integers



Does anyone know why the values in a double field would appear like
integers when a PostGIS file is viewed as a query layer in ArcMap?

In other words, I've added a PostGIS table as a query layer to ArcMap,
and when I open the attribute table, several fields only have integer
values (no decimal places) even though you can check the properties of
those fields and verify that they are indeed double. When the same table
is viewed in PGAdmin the values display with all their appropriate
decimal places.

What gives?

Thank you.

Sheara 

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


Re: [postgis-users] Noob request - using ST_SimplifyPreserveTopology() on Tiger Data

2011-06-28 Thread Christian Guirreri
Thanks - again, this is all fairly new, but I'm invested in learning at this
point. Will check out both.

Out of curiosity, how does MapShaper handle this on the backend?


On Tue, Jun 28, 2011 at 3:48 PM, Sandro Santilli  wrote:

> On Tue, Jun 28, 2011 at 03:00:47PM -0400, Christian Guirreri wrote:
> > OK works- thanks.
> >
> > So I'm learning now about the difference between what MapShaper does and
> > what ST_Stimplify does. Is there any way to make sure that simplified
> > boundary lines will match other boundary lines? i.e. even the smallest
> > simplifications (like 0.05) produces very visible gaps between adjacent
> > districts.
>
> What you could do is convert your layer to a topological representation,
> simplify each edge of the topology and then convert back to simple
> features.
>
> I'm looking for a sponsor to make the first part easier.
> Second part is easy already.
>
> If you're unfamiliar with postgis topology,
> here's a presentation I gave in Paris last week:
>
> http://strk.keybit.net/projects/postgis/Paris2011_TopologyWithPostGIS_2_0.pdf
> And, there's info on the wiki too.
>
> Another approach could be using ST_Snap to snap each simplified geometry
> against the collected vertices of each previously simplified one falling
> within a slightly enlarged bounding box of the geometry you're simplifying.
>
> --strk;
>
> > On Tue, Jun 28, 2011 at 1:12 PM, Sandro Santilli 
> wrote:
> >
> > > Christian,
> > > I suggest you create a new geometry field w/out enforcing type
> constraints
> > > on it, write the simplified version in there and then see what you get.
> > >
> > > --strk;
> > >
> > > On Tue, Jun 28, 2011 at 12:15:13PM -0400, Christian Guirreri wrote:
> > > > Same error. Tried both Polygon and Multipolygon. I'm not sure which
> the
> > > > Tiger Data is.
> > > >
> > > > On Tue, Jun 28, 2011 at 11:41 AM, Ben Madin
> > > > wrote:
> > > >
> > > > > Christian,
> > > > >
> > > > > My guess here is that because you've told the geometry to be a
> > > > > MULTIPOLYGON, but you may have returned a POLYGON, you have indeed
> > > violated
> > > > > the check constraint on the geometry type.
> > > > >
> > > > > try using st_multi() to get around it, as in :
> > > > >
> > > > > update public.tl_2010_us_cd111 set simple_geom =
> > > > > ST_Multi(ST_SimplifyPreserveTopology(the_geom, 15));
> > > > >
> > > > >
> > > > > cheers
> > > > >
> > > > > Ben
> > > > >
> > > > >
> > > > >
> > > > > On 28/06/2011, at 11:23 PM, Christian Guirreri wrote:
> > > > >
> > > > > I get the following error:
> > > > > ERROR: new row for relation "tl_2010_us_cd111" violates check
> > > constraint
> > > > > "enforce_geotype_simple_geom"
> > > > > SQL state: 23514
> > > > >
> > > > > Here's my SQL:
> > > > > select addGeometryColumn('public', 'tl_2010_us_cd111',
> 'simple_geom',
> > > 4326,
> > > > > 'MULTIPOLYGON', 2);
> > > > > update public.tl_2010_us_cd111 set simple_geom =
> > > > > ST_SimplifyPreserveTopology(the_geom, 15);
> > > > >
> > > > >
> > > > > On Mon, Jun 27, 2011 at 2:07 PM, Stephen Woodbridge <
> > > > > wood...@swoodbridge.com> wrote:
> > > > >
> > > > >> On 6/27/2011 1:37 PM, Christian Guirreri wrote:
> > > > >>
> > > > >>> I'm trying to do something fairly simple. I'd like to take the
> Tiger
> > > > >>> 2010 Data - tl_2010_us_cd111 and tl_2010_us_county10 - and create
> > > shape
> > > > >>> files that are considerably smaller and more simplified. In the
> past
> > > > >>> I've just used MapShaper and been OK with that, but I was having
> > > trouble
> > > > >>> uploading tl_2010_us_county10 into it and I've decided its time
> to
> > > learn
> > > > >>> some GIS basics anyway.
> > > > >>>
> > > > >>> I've definitely successfully setup my environment - PostegreSQL 9
> > > with
> > > > >>> PostGIS. I've used the shp2pgsql wizard included with pgadmin to
> > > import
> > > > >>> the data sets into their own databases, without the "Load
> Geography
> > > > >>> column" checked. I've been able to export this data back to shp
> > > > >>> using pgsql2shp and view the resulting shp in QuantumGIS and
> ACDSee
> > > > >>> Canvas.
> > > > >>>
> > > > >>> But when it comes to simplification - I'm not sure where to even
> > > > >>> start. I'm no database expert beyond some simple mysql so GIS is
> > > > >>> especially overwhelming. I only know that I want to
> > > > >>> use ST_SimplifyPreserveTopology() as I'm fairly certain a number
> of
> > > > >>> things will disappear if I don't.
> > > > >>>
> > > > >>> Would love if someone could provide me with the SQL to make this
> > > happen!
> > > > >>>
> > > > >>
> > > > >> First you should understand that ST_SimplifyPreserveTopology()
> works
> > > on a
> > > > >> single geometry at a time and not on multiple geometries in a
> > > coverage. The
> > > > >> difference is in a coverage the the polygons that share a common
> edge
> > > that
> > > > >> is simplified would continue to have a common simplified edge.
> When
> > > polygons
> > > > >> are simplified individually w

Re: [postgis-users] PostGIS query layer in ArcMap - Double values look like integers

2011-06-28 Thread Stephen Woodbridge

On 6/28/2011 3:17 PM, Sheara Cohen wrote:

Does anyone know why the values in a double field would appear like
integers when a PostGIS file is viewed as a query layer in ArcMap?

In other words, I've added a PostGIS table as a query layer to ArcMap,
and when I open the attribute table, several fields only have integer
values (no decimal places) even though you can check the properties of
those fields and verify that they are indeed double. When the same table
is viewed in PGAdmin the values display with all their appropriate
decimal places.

What gives?


I'm only quessing as I don't use ArcMap, but I'm thinking that ArcMap 
does not understand data type "double precision" and probably maps it to 
"numeric" but without any decimal points.


You could try creating a view or redefining the columns as numeric(14,7) 
or whatever is appropriate and see if that works better.


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


[postgis-users] PostGIS query layer in ArcMap - Double values look like integers

2011-06-28 Thread Sheara Cohen
Does anyone know why the values in a double field would appear like integers 
when a PostGIS file is viewed as a query layer in ArcMap? 

In other words, I've added a PostGIS table as a query layer to ArcMap, and when 
I open the attribute table, several fields only have integer values (no decimal 
places) even though you can check the properties of those fields and verify 
that they are indeed double. When the same table is viewed in PGAdmin the 
values display with all their appropriate decimal places.

What gives?

Thank you.

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


Re: [postgis-users] Noob request - using ST_SimplifyPreserveTopology() on Tiger Data

2011-06-28 Thread Christian Guirreri
OK works- thanks.

So I'm learning now about the difference between what MapShaper does and
what ST_Stimplify does. Is there any way to make sure that simplified
boundary lines will match other boundary lines? i.e. even the smallest
simplifications (like 0.05) produces very visible gaps between adjacent
districts.



On Tue, Jun 28, 2011 at 1:12 PM, Sandro Santilli  wrote:

> Christian,
> I suggest you create a new geometry field w/out enforcing type constraints
> on it, write the simplified version in there and then see what you get.
>
> --strk;
>
> On Tue, Jun 28, 2011 at 12:15:13PM -0400, Christian Guirreri wrote:
> > Same error. Tried both Polygon and Multipolygon. I'm not sure which the
> > Tiger Data is.
> >
> > On Tue, Jun 28, 2011 at 11:41 AM, Ben Madin
> > wrote:
> >
> > > Christian,
> > >
> > > My guess here is that because you've told the geometry to be a
> > > MULTIPOLYGON, but you may have returned a POLYGON, you have indeed
> violated
> > > the check constraint on the geometry type.
> > >
> > > try using st_multi() to get around it, as in :
> > >
> > > update public.tl_2010_us_cd111 set simple_geom =
> > > ST_Multi(ST_SimplifyPreserveTopology(the_geom, 15));
> > >
> > >
> > > cheers
> > >
> > > Ben
> > >
> > >
> > >
> > > On 28/06/2011, at 11:23 PM, Christian Guirreri wrote:
> > >
> > > I get the following error:
> > > ERROR: new row for relation "tl_2010_us_cd111" violates check
> constraint
> > > "enforce_geotype_simple_geom"
> > > SQL state: 23514
> > >
> > > Here's my SQL:
> > > select addGeometryColumn('public', 'tl_2010_us_cd111', 'simple_geom',
> 4326,
> > > 'MULTIPOLYGON', 2);
> > > update public.tl_2010_us_cd111 set simple_geom =
> > > ST_SimplifyPreserveTopology(the_geom, 15);
> > >
> > >
> > > On Mon, Jun 27, 2011 at 2:07 PM, Stephen Woodbridge <
> > > wood...@swoodbridge.com> wrote:
> > >
> > >> On 6/27/2011 1:37 PM, Christian Guirreri wrote:
> > >>
> > >>> I'm trying to do something fairly simple. I'd like to take the Tiger
> > >>> 2010 Data - tl_2010_us_cd111 and tl_2010_us_county10 - and create
> shape
> > >>> files that are considerably smaller and more simplified. In the past
> > >>> I've just used MapShaper and been OK with that, but I was having
> trouble
> > >>> uploading tl_2010_us_county10 into it and I've decided its time to
> learn
> > >>> some GIS basics anyway.
> > >>>
> > >>> I've definitely successfully setup my environment - PostegreSQL 9
> with
> > >>> PostGIS. I've used the shp2pgsql wizard included with pgadmin to
> import
> > >>> the data sets into their own databases, without the "Load Geography
> > >>> column" checked. I've been able to export this data back to shp
> > >>> using pgsql2shp and view the resulting shp in QuantumGIS and ACDSee
> > >>> Canvas.
> > >>>
> > >>> But when it comes to simplification - I'm not sure where to even
> > >>> start. I'm no database expert beyond some simple mysql so GIS is
> > >>> especially overwhelming. I only know that I want to
> > >>> use ST_SimplifyPreserveTopology() as I'm fairly certain a number of
> > >>> things will disappear if I don't.
> > >>>
> > >>> Would love if someone could provide me with the SQL to make this
> happen!
> > >>>
> > >>
> > >> First you should understand that ST_SimplifyPreserveTopology() works
> on a
> > >> single geometry at a time and not on multiple geometries in a
> coverage. The
> > >> difference is in a coverage the the polygons that share a common edge
> that
> > >> is simplified would continue to have a common simplified edge. When
> polygons
> > >> are simplified individually with knowledge of the adjacent polygons it
> is
> > >> possible for gaps and overlaps to occur along the simplified edge.
> > >> ST_SimplifyPreserveTopology() is designed to try and minimize these
> effects
> > >> but there are no guarantees.
> > >>
> > >> You might try something like:
> > >>
> > >> select addGeometryColum('myschema', 'mytable', 'simple_geom', 4326,
> > >> 'MULTIPOLYGON', 2);
> > >> update myschema.mytable set simple_geom =
> ST_SimplifyPreserveTopology(**the_geom,
> > >> );
> > >>
> > >> where  is replaces by an appropriate value. This will
> depend on
> > >> the some trial and error. The above assume srid=4326 which is probably
> not a
> > >> good projection for doing simplification so you might want to project
> your
> > >> data into some other UTM or Mercator projection depending on your
> coverage
> > >> area and tolerance needs to be set with respect to those units.
> > >>
> > >> -Steve W
> > >> __**_
> > >> postgis-users mailing list
> > >> postgis-users@postgis.**refractions.net<
> postgis-users@postgis.refractions.net>
> > >> http://postgis.refractions.**net/mailman/listinfo/postgis-**users<
> http://postgis.refractions.net/mailman/listinfo/postgis-users>
> > >>
> > >
> > > ___
> > > postgis-users mailing list
> > > postgis-users@postgis.refractions.net
> > > http://postgis.refractions.net/mailman/li

Re: [postgis-users] UTF8 Error when importing Tiger County shapefile

2011-06-28 Thread Stephen Woodbridge
I have not used the import wizard, but all Tiger data is in LATIN1 so 
when I import that data into postgis using the shp2pgsql utility into a 
UTF8 database, I specify -W LATIN1 so the import know to convert the 
LATIN1 data into UTF8.


-Steve

On 6/28/2011 1:32 PM, Christian Guirreri wrote:

I'm trying to import the Tiger 2010 County and equivalent shapefile for
the entire US. Its tl_2010_us_county10 found here:
http://www.census.gov/cgi-bin/geo/shapefiles2010/main

I create a new database with Encoding UTF8, template_postgis. If I
choose anything other than UTF8, it will not allow me to use the postgis
template.

I then use the Shape to PostGIS Importer wizard, change the SRID to
4269, but otherwise leave everything on default. It starts to import,
but stops early and here's there error:

.
Shapefile type: Polygon
Postgis type: MULTIPOLYGON[2]
Importing shapefile (3221 records)...
Unable to convert data value to UTF-8 (iconv reports "Invalid
argument"). Current encoding is "UTF-8". Try "LATIN1" (Western
European), or one of the values described at
http://www.postgresql.org/docs/current/static/multibyte.html.

Shapefile import failed.





___
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] UTF8 Error when importing Tiger County shapefile

2011-06-28 Thread Christian Guirreri
I'm trying to import the Tiger 2010 County and equivalent shapefile for the
entire US. Its tl_2010_us_county10 found here:
http://www.census.gov/cgi-bin/geo/shapefiles2010/main

I create a new database with Encoding UTF8, template_postgis. If I choose
anything other than UTF8, it will not allow me to use the postgis template.

I then use the Shape to PostGIS Importer wizard, change the SRID to 4269,
but otherwise leave everything on default. It starts to import, but stops
early and here's there error:

.
Shapefile type: Polygon
Postgis type: MULTIPOLYGON[2]
Importing shapefile (3221 records)...
Unable to convert data value to UTF-8 (iconv reports "Invalid argument").
Current encoding is "UTF-8". Try "LATIN1" (Western European), or one of the
values described at
http://www.postgresql.org/docs/current/static/multibyte.html.

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


Re: [postgis-users] Noob request - using ST_SimplifyPreserveTopology() on Tiger Data

2011-06-28 Thread Christian Guirreri
Same error. Tried both Polygon and Multipolygon. I'm not sure which the
Tiger Data is.

On Tue, Jun 28, 2011 at 11:41 AM, Ben Madin
wrote:

> Christian,
>
> My guess here is that because you've told the geometry to be a
> MULTIPOLYGON, but you may have returned a POLYGON, you have indeed violated
> the check constraint on the geometry type.
>
> try using st_multi() to get around it, as in :
>
> update public.tl_2010_us_cd111 set simple_geom =
> ST_Multi(ST_SimplifyPreserveTopology(the_geom, 15));
>
>
> cheers
>
> Ben
>
>
>
> On 28/06/2011, at 11:23 PM, Christian Guirreri wrote:
>
> I get the following error:
> ERROR: new row for relation "tl_2010_us_cd111" violates check constraint
> "enforce_geotype_simple_geom"
> SQL state: 23514
>
> Here's my SQL:
> select addGeometryColumn('public', 'tl_2010_us_cd111', 'simple_geom', 4326,
> 'MULTIPOLYGON', 2);
> update public.tl_2010_us_cd111 set simple_geom =
> ST_SimplifyPreserveTopology(the_geom, 15);
>
>
> On Mon, Jun 27, 2011 at 2:07 PM, Stephen Woodbridge <
> wood...@swoodbridge.com> wrote:
>
>> On 6/27/2011 1:37 PM, Christian Guirreri wrote:
>>
>>> I'm trying to do something fairly simple. I'd like to take the Tiger
>>> 2010 Data - tl_2010_us_cd111 and tl_2010_us_county10 - and create shape
>>> files that are considerably smaller and more simplified. In the past
>>> I've just used MapShaper and been OK with that, but I was having trouble
>>> uploading tl_2010_us_county10 into it and I've decided its time to learn
>>> some GIS basics anyway.
>>>
>>> I've definitely successfully setup my environment - PostegreSQL 9 with
>>> PostGIS. I've used the shp2pgsql wizard included with pgadmin to import
>>> the data sets into their own databases, without the "Load Geography
>>> column" checked. I've been able to export this data back to shp
>>> using pgsql2shp and view the resulting shp in QuantumGIS and ACDSee
>>> Canvas.
>>>
>>> But when it comes to simplification - I'm not sure where to even
>>> start. I'm no database expert beyond some simple mysql so GIS is
>>> especially overwhelming. I only know that I want to
>>> use ST_SimplifyPreserveTopology() as I'm fairly certain a number of
>>> things will disappear if I don't.
>>>
>>> Would love if someone could provide me with the SQL to make this happen!
>>>
>>
>> First you should understand that ST_SimplifyPreserveTopology() works on a
>> single geometry at a time and not on multiple geometries in a coverage. The
>> difference is in a coverage the the polygons that share a common edge that
>> is simplified would continue to have a common simplified edge. When polygons
>> are simplified individually with knowledge of the adjacent polygons it is
>> possible for gaps and overlaps to occur along the simplified edge.
>> ST_SimplifyPreserveTopology() is designed to try and minimize these effects
>> but there are no guarantees.
>>
>> You might try something like:
>>
>> select addGeometryColum('myschema', 'mytable', 'simple_geom', 4326,
>> 'MULTIPOLYGON', 2);
>> update myschema.mytable set simple_geom = 
>> ST_SimplifyPreserveTopology(**the_geom,
>> );
>>
>> where  is replaces by an appropriate value. This will depend on
>> the some trial and error. The above assume srid=4326 which is probably not a
>> good projection for doing simplification so you might want to project your
>> data into some other UTM or Mercator projection depending on your coverage
>> area and tolerance needs to be set with respect to those units.
>>
>> -Steve W
>> __**_
>> 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] Optimise this query, point in polygon on quite a large scale

2011-06-28 Thread Mark Cave-Ayland

On 26/06/11 22:02, Louis Holford wrote:


So...I have a large list of points (~30,000). I need to count the number
of points that overlap a polygon (or multiple polyongs e.g. 100's). Each
polygon represents part of a grid that overlaps the envelope of the list
of points, so I need to know the count of points per grid cell.

Currently I can generate each grid cell "in memory" and feed them to a
query using ST_GeomFromText. Now, I know this takes a long time to
complete and is not optimal.

I would like any opinions as to what the best solution to implementing
the query would be. I am thinking along the lines of generating the full
grid as a table with either each cell stored separately or the whole
grid as a single multipolygon and then performing the ST_Intersects part
of the query.

And also I know I should generate an index to help the query
planning/search.


Hi Louis,

Yes - this is a good starting point. In-memory grids cannot use the 
index and so you'll need to materialise the resulting grid somehow 
whether that's just in a temporary table or somewhere more permanent, 
and then build an index on it in order to get worthwhile performance.


It's likely you'll be looking at a combination of a cross join based 
upon the && operator, ST_Intersects() and a GROUP BY over a SUM() 
aggregate in order to generate the totals for each grid square.



HTH,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Noob request - using ST_SimplifyPreserveTopology() on Tiger Data

2011-06-28 Thread Ben Madin
Christian,

My guess here is that because you've told the geometry to be a MULTIPOLYGON, 
but you may have returned a POLYGON, you have indeed violated the check 
constraint on the geometry type.

try using st_multi() to get around it, as in :

> update public.tl_2010_us_cd111 set simple_geom = 
> ST_Multi(ST_SimplifyPreserveTopology(the_geom, 15));

cheers

Ben



On 28/06/2011, at 11:23 PM, Christian Guirreri wrote:

> I get the following error:
> ERROR: new row for relation "tl_2010_us_cd111" violates check constraint 
> "enforce_geotype_simple_geom"
> SQL state: 23514
> 
> Here's my SQL:
> select addGeometryColumn('public', 'tl_2010_us_cd111', 'simple_geom', 4326, 
> 'MULTIPOLYGON', 2);
> update public.tl_2010_us_cd111 set simple_geom = 
> ST_SimplifyPreserveTopology(the_geom, 15);
> 
> 
> On Mon, Jun 27, 2011 at 2:07 PM, Stephen Woodbridge  
> wrote:
> On 6/27/2011 1:37 PM, Christian Guirreri wrote:
> I'm trying to do something fairly simple. I'd like to take the Tiger
> 2010 Data - tl_2010_us_cd111 and tl_2010_us_county10 - and create shape
> files that are considerably smaller and more simplified. In the past
> I've just used MapShaper and been OK with that, but I was having trouble
> uploading tl_2010_us_county10 into it and I've decided its time to learn
> some GIS basics anyway.
> 
> I've definitely successfully setup my environment - PostegreSQL 9 with
> PostGIS. I've used the shp2pgsql wizard included with pgadmin to import
> the data sets into their own databases, without the "Load Geography
> column" checked. I've been able to export this data back to shp
> using pgsql2shp and view the resulting shp in QuantumGIS and ACDSee Canvas.
> 
> But when it comes to simplification - I'm not sure where to even
> start. I'm no database expert beyond some simple mysql so GIS is
> especially overwhelming. I only know that I want to
> use ST_SimplifyPreserveTopology() as I'm fairly certain a number of
> things will disappear if I don't.
> 
> Would love if someone could provide me with the SQL to make this happen!
> 
> First you should understand that ST_SimplifyPreserveTopology() works on a 
> single geometry at a time and not on multiple geometries in a coverage. The 
> difference is in a coverage the the polygons that share a common edge that is 
> simplified would continue to have a common simplified edge. When polygons are 
> simplified individually with knowledge of the adjacent polygons it is 
> possible for gaps and overlaps to occur along the simplified edge. 
> ST_SimplifyPreserveTopology() is designed to try and minimize these effects 
> but there are no guarantees.
> 
> You might try something like:
> 
> select addGeometryColum('myschema', 'mytable', 'simple_geom', 4326, 
> 'MULTIPOLYGON', 2);
> update myschema.mytable set simple_geom = 
> ST_SimplifyPreserveTopology(the_geom, );
> 
> where  is replaces by an appropriate value. This will depend on 
> the some trial and error. The above assume srid=4326 which is probably not a 
> good projection for doing simplification so you might want to project your 
> data into some other UTM or Mercator projection depending on your coverage 
> area and tolerance needs to be set with respect to those units.
> 
> -Steve W
> ___
> 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] arc from points WGS84 projection.

2011-06-28 Thread Tambade, Kedar
I am new to postgis, and have a task to make an arc from 3 points, I tried 
circularstring and curvetoline functions in postgis but had no luck in getting 
the right output in WGS84 projections spheroid geometries.
Need help please

Thanks in advance,

Kedar Tambade
CGH Technologies, Inc.
Email: ktamb...@cghtech.com

This electronic mail message and any attached files contain information 
intended for the exclusive use of the individual or entity to whom it is 
addressed and may contain information that is propriety, privileged, 
confidential and/or exempt from disclosure under applicable law. If you are not 
the intended recipient, you are hereby notified that any viewing, copying, 
disclosure or distribution of this information may be subject to legal 
restriction or sanction. Please notify the sender, by electronic mail or 
telephone, of any unintended recipients and delete the original message without 
making any copies.

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


Re: [postgis-users] Noob request - using ST_SimplifyPreserveTopology() on Tiger Data

2011-06-28 Thread Christian Guirreri
I get the following error:
ERROR: new row for relation "tl_2010_us_cd111" violates check constraint
"enforce_geotype_simple_geom"
SQL state: 23514

Here's my SQL:
select addGeometryColumn('public', 'tl_2010_us_cd111', 'simple_geom', 4326,
'MULTIPOLYGON', 2);
update public.tl_2010_us_cd111 set simple_geom =
ST_SimplifyPreserveTopology(the_geom, 15);


On Mon, Jun 27, 2011 at 2:07 PM, Stephen Woodbridge  wrote:

> On 6/27/2011 1:37 PM, Christian Guirreri wrote:
>
>> I'm trying to do something fairly simple. I'd like to take the Tiger
>> 2010 Data - tl_2010_us_cd111 and tl_2010_us_county10 - and create shape
>> files that are considerably smaller and more simplified. In the past
>> I've just used MapShaper and been OK with that, but I was having trouble
>> uploading tl_2010_us_county10 into it and I've decided its time to learn
>> some GIS basics anyway.
>>
>> I've definitely successfully setup my environment - PostegreSQL 9 with
>> PostGIS. I've used the shp2pgsql wizard included with pgadmin to import
>> the data sets into their own databases, without the "Load Geography
>> column" checked. I've been able to export this data back to shp
>> using pgsql2shp and view the resulting shp in QuantumGIS and ACDSee
>> Canvas.
>>
>> But when it comes to simplification - I'm not sure where to even
>> start. I'm no database expert beyond some simple mysql so GIS is
>> especially overwhelming. I only know that I want to
>> use ST_SimplifyPreserveTopology() as I'm fairly certain a number of
>> things will disappear if I don't.
>>
>> Would love if someone could provide me with the SQL to make this happen!
>>
>
> First you should understand that ST_SimplifyPreserveTopology() works on a
> single geometry at a time and not on multiple geometries in a coverage. The
> difference is in a coverage the the polygons that share a common edge that
> is simplified would continue to have a common simplified edge. When polygons
> are simplified individually with knowledge of the adjacent polygons it is
> possible for gaps and overlaps to occur along the simplified edge.
> ST_SimplifyPreserveTopology() is designed to try and minimize these effects
> but there are no guarantees.
>
> You might try something like:
>
> select addGeometryColum('myschema', 'mytable', 'simple_geom', 4326,
> 'MULTIPOLYGON', 2);
> update myschema.mytable set simple_geom = 
> ST_SimplifyPreserveTopology(**the_geom,
> );
>
> where  is replaces by an appropriate value. This will depend on
> the some trial and error. The above assume srid=4326 which is probably not a
> good projection for doing simplification so you might want to project your
> data into some other UTM or Mercator projection depending on your coverage
> area and tolerance needs to be set with respect to those units.
>
> -Steve W
> __**_
> 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] Tiger Geocoder 2010 setup issues

2011-06-28 Thread Paragon Corporation
Daniel,

Haven't had a chance to recheck our script to confirm its not something
amiss.

Which version of PostGIS  are you working with?

 You can ignore the does not exist, skipping errors -- those are trying to
drop tables which wouldn't exist for new installs.

The addr does not exist often happens if you don't have tiger in your
database search_path.  Make sure its in your search_path.  Also you can
verify the table exists
By making sure you have a tiger schema and it has tables like addr, edges
etc.

Regarding your ident problem.

PostgreSQL can listen on localhost or local port and depending on which that
has to be registered in pg_hba.conf

You can try taking out the PGHOST line since you may be running only on a
non-IP port and see if that helps or change your pg_hba.conf to allow.

Regarding this issue:
STATEDIR="/gisdata/www2.census.gov/geo/pvs/tiger2010st/36_New_York"

especially because an early command is

 cd $STATEDIR

I'm pretty sure we fixed that so I suspect your version is probably out of
data and you may want to just redownload from PostGIS site (either the SVN
tar ball or directly from svn)

Regina and Leo
http://www.postgis.us


-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Daniel
Weitzenfeld
Sent: Tuesday, June 28, 2011 6:51 AM
To: postgis-users@postgis.refractions.net
Subject: [postgis-users] Tiger Geocoder 2010 setup issues

Hi,
I'm trying to setup the TIGER Geocoder, following the readme here:
http://svn.osgeo.org/postgis/trunk/extras/tiger_geocoder/tiger_2010/README
I'm setting it up on a centos 5.5 server.
My questions are below, organized by the step in the README.

--| Step 3.  Edit the tiger_loader.sql to the paths of your
executables server etc.
Is the UNZIPTOOL variable supposed to be changed, or left at its default?
UNZIPTOOL=unzip

--| Step 4.  Edit the create_geocode.bat or create_geocode.sh and 
--| run

When I ran the file, I got a boatload of NOTICEs like the following,
interspersed throughout the output:

psql:tables/lookup_tables_2010.sql:4: NOTICE:  table "direction_lookup" does
not exist, skipping
psql:tables/lookup_tables_2010.sql:39: NOTICE:  table
"secondary_unit_lookup" does not exist, skipping

Is this something I should be concerned about?  Did I skip something?

Perhaps more alarmingly, the output finished with this:

COMMIT
ERROR:  relation "addr" does not exist

Again, what should I do?

--| 8. Run this command at psql or pgAdmin III query window to
generate the script.
The first line of the generated script doesn't look right:

STATEDIR="/gisdata/www2.census.gov/geo/pvs/tiger2010st/36_New_York"

especially because an early command is

 cd $STATEDIR

Also, when I try to run the generated script anyway, I get a boatload of
these:

psql: FATAL:  Ident authentication failed for user "daniel"

...which is strange to me because I user I thought user daniel had rights on
the PGDATABASE.  Indeed, user daniel can create/delete schemas on it.  Am I
misunderstanding something about postgres permissions?

Thanks in advance for any guidance you can provide.
Best,
-Daniel
___
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] PostGIS 2.0 Install Error

2011-06-28 Thread Mark Cave-Ayland

On 27/06/11 19:45, Chris Seker wrote:


I have downloaded and installed PROJ4.6.1 and PostGIS-2.0 SVN.  Still
having the following error.

sh-3.2$ psql -d template_postgis20 -f postgis2.sql

SET

BEGIN

psql:postgis2.sql:65: ERROR: could not load library
"/usr/pgsql-9.1/lib/postgis-2.0.so": /usr/pgsql-9.1/lib/postgis-2.0.so:
undefined symbol: pj_set_searchpath

psql:postgis2.sql:70: ERROR: current transaction is aborted, commands ignore

Any ideas?


That still looks as if it's referencing an older version of PROJ.4 that 
doesn't have pj_set_searchpath() in it :(


What does "ldd /usr/pgsql-9.1/lib/postgis-2.0.so" show?


ATB,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] OT: Export/copy postgres geometry to sql server with bcp

2011-06-28 Thread Charles Galpin
Sorry for the somewhat off topic question, but I figured someone here has 
probably dealt with this.  I am using postgis and am very happy with it, but 
for various reasons I need to export some of our data to sql server 
periodically and want to automate it, preferably to fit into our existing 
framework which uses bcp to import from flat files.  However looking at the 
binary output of a straight "copy" to CSV the binary formats do not look the 
same. Is there any way to export to a format that bcp can understand?

I can export the wkt, strip quotes, import into a temp table and then use an 
insert select to fill the destination table converting the wkt back to a 
geometry but this is less than ideal.

tia,
charles

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


[postgis-users] Tiger Geocoder 2010 setup issues

2011-06-28 Thread Daniel Weitzenfeld
Hi,
I'm trying to setup the TIGER Geocoder, following the readme here:
http://svn.osgeo.org/postgis/trunk/extras/tiger_geocoder/tiger_2010/README
I'm setting it up on a centos 5.5 server.
My questions are below, organized by the step in the README.

--| Step 3.  Edit the tiger_loader.sql to the paths of your
executables server etc.
Is the UNZIPTOOL variable supposed to be changed, or left at its default?
UNZIPTOOL=unzip

--| Step 4.  Edit the create_geocode.bat or create_geocode.sh and run

When I ran the file, I got a boatload of NOTICEs like the following,
interspersed throughout the output:

psql:tables/lookup_tables_2010.sql:4: NOTICE:  table
"direction_lookup" does not exist, skipping
psql:tables/lookup_tables_2010.sql:39: NOTICE:  table
"secondary_unit_lookup" does not exist, skipping

Is this something I should be concerned about?  Did I skip something?

Perhaps more alarmingly, the output finished with this:

COMMIT
ERROR:  relation "addr" does not exist

Again, what should I do?

--| 8. Run this command at psql or pgAdmin III query window to
generate the script.
The first line of the generated script doesn't look right:

STATEDIR="/gisdata/www2.census.gov/geo/pvs/tiger2010st/36_New_York"

especially because an early command is

 cd $STATEDIR

Also, when I try to run the generated script anyway, I get a boatload of these:

psql: FATAL:  Ident authentication failed for user "daniel"

...which is strange to me because I user I thought user daniel had
rights on the PGDATABASE.  Indeed, user daniel can create/delete
schemas on it.  Am I misunderstanding something about postgres
permissions?

Thanks in advance for any guidance you can provide.
Best,
-Daniel
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Fwd: Live records and number of records are differents...

2011-06-28 Thread Nicolas Ribot
> Hello list,
>
> I use PostgreSQL 8.4 and Postgis 1.4.
>
> I use FME to insert 772185 records in a table (multipolygons that represent
> parcels).
>
> Everything seems fine but...
> If I type select count(*), I get the right number of records : 772185
> records.
>
> But If I use pgAdmin and have a look in the stats :
> - row inserted = 772185 OK fine,
> - but the number of live rows is 772308...
>
> I don't understand why the number of live rows and the number of rows is
> différent...
> Any explaination would be very appreciated !
> Thanks you
>

Hi, it probably means the table statistics should be updated.
try:  vacuum analyse 

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