<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 10.00.9200.16521"></HEAD>
<BODY bgColor=#ffffff>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=184233922-07042013>Slight correction forgot the )</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=184233922-07042013></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=184233922-07042013><SPAN class=707582522-07042013><FONT color=#0000ff 
size=2 face=Arial>for /r %%z in (*.dbf) do (%SHP2PGSQL%   -s 4326 -g 
geom -W "latin1" %%z sometable | %PSQL% )</FONT></SPAN></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=184233922-07042013><SPAN 
class=707582522-07042013></SPAN></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=184233922-07042013><SPAN class=707582522-07042013>You can also chain 
commands by using &</SPAN></SPAN></FONT><FONT color=#0000ff size=2 
face=Arial><SPAN class=184233922-07042013><SPAN 
class=707582522-07042013></SPAN></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=184233922-07042013></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=184233922-07042013><SPAN class=707582522-07042013><FONT color=#0000ff 
size=2 face=Arial>for /r %%z in (*.dbf) do (%SHP2PGSQL%   -s 4326 -g 
geom -W "latin1" %%z sometable | %PSQL% & %PSQL% -c "SELECT 
postgis_full_version()" )</FONT></SPAN></SPAN></FONT><BR></DIV>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> postgis-users-bounces@lists.osgeo.org 
[mailto:postgis-users-bounces@lists.osgeo.org] <B>On Behalf Of </B>Paragon 
Corporation<BR><B>Sent:</B> Sunday, April 07, 2013 6:38 PM<BR><B>To:</B> 
'PostGIS Users Discussion'<BR><B>Subject:</B> Re: [postgis-users] unique id in 
QGIS/PostGIS<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=707582522-07042013>You can also use msys mingw. We use the mingw64 
chain which allows you to run linux shell scripts. That's what we use to 
compile PostGIS for windows.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=707582522-07042013></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=707582522-07042013>That aside, probably for what you want to do for 
starters as Brent suggested, batch scripts are sufficient.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=707582522-07042013></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=707582522-07042013>Our general batch script for loading up shape files 
looks something like this:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=707582522-07042013></SPAN></FONT> </DIV><SPAN 
class=707582522-07042013>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>set 
PGBIN=C:\Program Files\PostgreSQL\9.2\bin\<BR>set PGPORT=5432<BR>set 
PGHOST=localhost<BR>set PGUSER=postgres<BR>set PGPASSWORD=something</FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>set 
PGDATABASE=<SPAN class=707582522-07042013>mygisdb</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=707582522-07042013></SPAN>set PSQL="%PGBIN%psql"<BR>set 
SHP2PGSQL="%PGBIN%shp2pgsql"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=707582522-07042013></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial>%SHP2PGSQL% -c -s <SPAN 
class=707582522-07042013>4326 </SPAN> -g geom   -W 
"latin1" <SPAN class=707582522-07042013>somefile.shp</SPAN> <SPAN 
class=707582522-07042013>sometable</SPAN> | %PSQL%</FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV><SPAN class=707582522-07042013><FONT color=#0000ff size=2 face=Arial>If you 
need to load up a whole bunch of files in a table you can use the  for do 
batch command</FONT></SPAN></DIV>
<DIV><SPAN class=707582522-07042013><FONT color=#0000ff size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=707582522-07042013><FONT color=#0000ff size=2 face=Arial>for /r 
%%z in (*.dbf) do (%SHP2PGSQL%   -s 4326 -g geom -W "latin1" %%z 
sometable | %PSQL% </FONT></SPAN></DIV>
<DIV><SPAN class=707582522-07042013><FONT color=#0000ff size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=707582522-07042013></SPAN></FONT> </DIV>
<DIV><SPAN class=707582522-07042013><FONT color=#0000ff size=2 face=Arial>Hope 
that helps,</FONT></SPAN></DIV>
<DIV><SPAN class=707582522-07042013><FONT color=#0000ff size=2 face=Arial>Leo 
and Regina</FONT></SPAN></DIV>
<DIV><SPAN class=707582522-07042013><FONT color=#0000ff size=2 face=Arial><A 
href="http://www.postgis.us">http://www.postgis.us</A></FONT></SPAN></DIV>
<DIV><SPAN class=707582522-07042013><FONT color=#0000ff size=2 face=Arial><A 
href="http://postgis.net">http://postgis.net</A></FONT></SPAN></DIV>
<DIV><SPAN class=707582522-07042013></SPAN> </DIV>
<DIV><SPAN class=707582522-07042013><FONT color=#0000ff size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=707582522-07042013><FONT color=#0000ff size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV><BR></DIV>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> postgis-users-bounces@lists.osgeo.org 
[mailto:postgis-users-bounces@lists.osgeo.org] <B>On Behalf Of </B>Marjorie 
Roswell<BR><B>Sent:</B> Sunday, April 07, 2013 2:37 PM<BR><B>To:</B> 
pcreso@pcreso.com<BR><B>Cc:</B> postgis-users@lists.osgeo.org<BR><B>Subject:</B> 
Re: [postgis-users] unique id in QGIS/PostGIS<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Thanks immensely. Some years ago on a different computer, I installed 
cygwin.  Great reminder, and I appreciate it.  I'll be back at my 
computer this evening. <BR><BR>Sent from my iPhone</DIV>
<DIV><BR>On Apr 7, 2013, at 2:11 PM, <A 
href="mailto:pcreso@pcreso.com">pcreso@pcreso.com</A> wrote:<BR><BR></DIV>
<DIV></DIV>
<BLOCKQUOTE type="cite">
  <DIV>
  <TABLE cellSpacing=0 cellPadding=0 border=0>
    <TBODY>
    <TR>
      <TD vAlign=top>HI Margie,<BR><BR>I gave up on Windows as a productive 
        computing environment last century, & have zero regrets about that 
        these days, so I'm not the best person to offer Windows oriented help... 
        however...<BR><BR>There are three ways to run scripts under Windows - 
        Y<BR><BR>1. You can install Cygwin - which gives you a Linux-like 
        environment within Windows, but is somewhat complicated & arcane. 
        This does allow you to run the exact same bash scripts under Windows 
        & Linux.<BR><BR>2. You can install Windows powershell & write 
        your scripts using that "language":<BR><A 
        href="http://technet.microsoft.com/en-us/scriptcenter/dd742419.aspx"><A 
        href="http://technet.microsoft.com/en-us/scriptcenter/dd742419.aspx">http://technet.microsoft.com/en-us/scriptcenter/dd742419.aspx</A></A><BR><BR>3. 
        You can write your scripts as batch files. Batch files are pretty 
        limited, without text processing & other capabilities, but are 
        probably able to do what you are looking to do right now. All Windows 
        systems can run batch files with no additional software 
        installed.<BR> <BR>So, I'd suggest you look at batch files 
        initially.<BR><BR>Google "batch file tutorial" & there are plenty to 
        choose from, like <A 
        href="http://www.chebucto.ns.ca/~ak621/DOS/BatBasic.html"><A 
        href="http://www.chebucto.ns.ca/~ak621/DOS/BatBasic.html">http://www.chebucto.ns.ca/~ak621/DOS/BatBasic.html</A></A><BR><BR> If 
        you open a terminal window & type "psql -l" then press enter, you'll 
        know if your path is already set up as they need to be. This is probably 
        the only tricky thing you might need to configure. If it works, great, 
        if not you'll need to add the folder containing the psql command to your 
        path. If you do need to do this, see: <BR><A 
        href="http://www.computerhope.com/issues/ch000549.htm"><A 
        href="http://www.computerhope.com/issues/ch000549.htm">http://www.computerhope.com/issues/ch000549.htm</A></A><BR>but 
        it should be unecessary.<BR><BR>The simple shell script as a batch file 
        - if I remember correctly 
        :-)<BR>__________________________________________________________<BR>REM 
        script to load Legislative_shape.zip & create unique 
        index<BR><BR>SHP=Legislative_final_shapefile\Legislative_Final.shp<BR><BR>REM 
        create new, empty Postgres database<BR>dropdb test<BR>createdb 
        test<BR><BR>REM install postgis<BR>psql -d test -c "create extension 
        postgis;"<BR><BR>REM determine projection <BR>REM assume from these 
        links that the SRID is 3559 -<BR>REM   I couldn't find one to 
        match the prj file directly<BR>REM <A 
        href="http://planning.maryland.gov/msdc/S5_Map_GIS.shtml"><A 
        href="http://planning.maryland.gov/msdc/S5_Map_GIS.shtml">http://planning.maryland.gov/msdc/S5_Map_GIS.shtml</A></A><BR>REM 
        <A href="http://www.spatialreference.org/ref/sr-org/3559/"><A 
        href="http://www.spatialreference.org/ref/sr-org/3559/">http://www.spatialreference.org/ref/sr-org/3559/</A></A><BR><BR>REM 
        load the shapefile the easy way...<BR>shp2pgsql -s 3559 -I %SHP% 
        legislative_final | psql -d 
        test<BR>___________________________________________________________<BR><BR><BR>Cheers,<BR><BR>  
        Brent<BR>--- On <B>Mon, 4/8/13, Margie Roswell <I><<A 
        href="mailto:mroswell@gmail.com">mroswell@gmail.com</A>></I></B> 
        wrote:<BR>
        <BLOCKQUOTE 
        style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid"><BR>From: 
          Margie Roswell <<A 
          href="mailto:mroswell@gmail.com">mroswell@gmail.com</A>><BR>Subject: 
          Re: [postgis-users] unique id in QGIS/PostGIS<BR>To: <A 
          href="mailto:pcreso@pcreso.com"><A 
          href="mailto:pcreso@pcreso.com">pcreso@pcreso.com</A></A><BR>Cc: 
          "PostGIS Users Discussion" <<A 
          href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</A>><BR>Date: 
          Monday, April 8, 2013, 2:45 AM<BR><BR>
          <DIV id=yiv612757614>One step at a time. I figured out how to set the 
          path in windows, to access psql  
          <DIV><BR></DIV>
          <DIV>So, next, to try to figure out how to script... (on the windows 
          side)</DIV>
          <DIV><BR></DIV>
          <DIV>inching forward,</DIV>
          <DIV><BR></DIV>
          <DIV>Margie</DIV>
          <DIV><BR clear=all>
          <DIV>
          <DIV>--</DIV>
          <DIV><A href="http://FarmBillPrimer.org" rel=nofollow target=_blank><A 
          href="http://FarmBillPrimer.org">http://FarmBillPrimer.org</A></A></DIV><A 
          href="http://www.BaltimoreUrbanAg.org" rel=nofollow target=_blank><A 
          href="http://www.BaltimoreUrbanAg.org">http://www.BaltimoreUrbanAg.org</A></A> 
          (Please send events; This site is hungry.)<BR><A 
          href="http://www.ExcellentNutrition.org" rel=nofollow target=_blank><A 
          href="http://www.ExcellentNutrition.org">http://www.ExcellentNutrition.org</A></A><BR><A 
          href="http://www.packtpub.com/drupal-5-views-recipes/book" 
          rel=nofollow target=_blank><A 
          href="http://www.packtpub.com/drupal-5-views-recipes/book">http://www.packtpub.com/drupal-5-views-recipes/book</A></A><BR></DIV><BR><BR>
          <DIV class=yiv612757614gmail_quote>On Sun, Apr 7, 2013 at 10:35 AM, 
          Margie Roswell <SPAN dir=ltr><<A 
          href="/mc/compose?to=mroswell@gmail.com" rel=nofollow target=_blank 
          ymailto="mailto:mroswell@gmail.com"><A 
          href="mailto:mroswell@gmail.com">mroswell@gmail.com</A></A>></SPAN> 
          wrote:<BR>
          <BLOCKQUOTE class=yiv612757614gmail_quote 
          style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Thanks 
            very much. I like the idea of scripting these routine 
            behaviors.<BR><BR>1. I figured out that the correct CRS is <BR><A 
            href="http://spatialreference.org/ref/epsg/4019/" rel=nofollow 
            target=_blank><A 
            href="http://spatialreference.org/ref/epsg/4019/">http://spatialreference.org/ref/epsg/4019/</A></A><BR><BR>It 
            basically says (in QGIS) <BR>Unknown datum based upon the GRS 1980 
            ellipsoid EPSG:4019<BR>but it does exactly match the PRJ file for 
            legislative_final shapefile.<BR><BR>A friend suggests using Maryland 
            State Plan, so, I'll likely switch that command to <BR><BR>shp2pgsql 
            -s 3559:26985 -I $SHP legislative_final | psql -d test<BR><BR>2. I 
            do have access to a PostGIS install on a mac or an EC2, but right 
            now my preferred environment is windows, with my large screen, and 
            special wrist-friendly keyboard.<B> So, I'm going to have to figure 
            out how to run this script.</B> (or even how run anything from the 
            command line on the windows side.)<BR><BR>If anyone has some insight 
            into how to run or replicate a bash script on a windows 
            installation, let me know. The<B> psql tool that comes with windows 
            starts right inside a database</B>, so I haven't actually yet 
            figured out how to even run a simple postgres command on the windows 
            side. No success from either the SQL shell or the regular windows 
            command prompt.<BR>
            <DIV><BR>The scripting approach:</DIV>
            <DIV>- offers helpful comments to remind us of the data 
            source. </DIV>
            <DIV>- offers a record of exactly what we did. (Part of the reason 
            I've been using PgAdmin III is that I have appreciated the history 
            file there.)<BR><BR>Since I like this scripting approach, I'm off to 
            try to figure out how to do it on the windows side.... Is anyone 
            here running postgres on windows, with command line 
            success?</DIV><SPAN class=yiv612757614HOEnZb><FONT color=#888888>
            <DIV><BR></DIV></FONT></SPAN>
            <DIV><SPAN class=yiv612757614HOEnZb><FONT 
            color=#888888>Margie</FONT></SPAN> 
            <DIV class=yiv612757614im><BR><BR clear=all>
            <DIV>
            <DIV>--</DIV>
            <DIV><A href="http://FarmBillPrimer.org" rel=nofollow 
            target=_blank><A 
            href="http://FarmBillPrimer.org">http://FarmBillPrimer.org</A></A></DIV><A 
            href="http://www.BaltimoreUrbanAg.org" rel=nofollow target=_blank><A 
            href="http://www.BaltimoreUrbanAg.org">http://www.BaltimoreUrbanAg.org</A></A> 
            (Please send events; This site is hungry.)<BR><A 
            href="http://www.ExcellentNutrition.org" rel=nofollow 
            target=_blank><A 
            href="http://www.ExcellentNutrition.org">http://www.ExcellentNutrition.org</A></A><BR><A 
            href="http://www.packtpub.com/drupal-5-views-recipes/book" 
            rel=nofollow target=_blank><A 
            href="http://www.packtpub.com/drupal-5-views-recipes/book">http://www.packtpub.com/drupal-5-views-recipes/book</A></A><BR></DIV><BR><BR></DIV>
            <DIV>
            <DIV class=yiv612757614h5>
            <DIV class=yiv612757614gmail_quote>On Sat, Apr 6, 2013 at 6:37 PM, 
            <SPAN dir=ltr><<A href="/mc/compose?to=pcreso@pcreso.com" 
            rel=nofollow target=_blank ymailto="mailto:pcreso@pcreso.com"><A 
            href="mailto:pcreso@pcreso.com">pcreso@pcreso.com</A></A>></SPAN> 
            wrote:<BR>
            <BLOCKQUOTE class=yiv612757614gmail_quote 
            style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
              <TABLE cellSpacing=0 cellPadding=0 border=0>
                <TBODY>
                <TR>
                  <TD vAlign=top>Hi again,<BR><BR>In your screencap your SRID 
                    seems to be set to zero. Even if the data displays in QGIS, 
                    it will not be in the correct place, unless you have this 
                    set correctly. So with the unique index/prikary key - you 
                    still probably won't see the data unless you zoom the that 
                    layer extent.<BR><BR>I have scribbled out a quick Linux 
                    script which uses the shp2pgsql command to load the 
                    shapefile, & which creates the unique index 
                    automatically... I'm not certain I got the SRID correct - so 
                    it will be worth checking.<BR><BR>HTH,<BR><BR>  Brent 
                    Wood<BR><BR><BR>#! /bin/bash<BR># script to load 
                    Legislative_shape.zip & create unique 
                    index<BR><BR>SHP=Legislative_final_shapefile/Legislative_Final.shp<BR><BR># 
                    create new, empty Postgres database<BR>dropdb 
                    test<BR>createdb test<BR><BR># install postgis<BR>psql -d 
                    test -c "create extension postgis;"<BR><BR># determine 
                    projection <BR># assume from these links that the SRID is 
                    3559 -<BR>#   I couldn't find one to match the prj 
                    file directly<BR># <A 
                    href="http://planning.maryland.gov/msdc/S5_Map_GIS.shtml" 
                    rel=nofollow target=_blank><A 
                    href="http://planning.maryland.gov/msdc/S5_Map_GIS.shtml">http://planning.maryland.gov/msdc/S5_Map_GIS.shtml</A></A><BR># 
                    <A href="http://www.spatialreference.org/ref/sr-org/3559/" 
                    rel=nofollow target=_blank><A 
                    href="http://www.spatialreference.org/ref/sr-org/3559/">http://www.spatialreference.org/ref/sr-org/3559/</A></A><BR><BR># 
                    load the shapefile the easy way...<BR># use -I to create the 
                    primary key<BR>shp2pgsql -s 3559 -I $SHP legislative_final | 
                    psql -d test 
                    <DIV><BR><BR>--- On <B>Sat, 4/6/13, Margie Roswell <I><<A 
                    href="/mc/compose?to=mroswell@gmail.com" rel=nofollow 
                    target=_blank ymailto="mailto:mroswell@gmail.com"><A 
                    href="mailto:mroswell@gmail.com">mroswell@gmail.com</A></A>></I></B> 
                    wrote:<BR></DIV>
                    <BLOCKQUOTE 
                    style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">
                      <DIV><BR>From: Margie Roswell <<A 
                      href="/mc/compose?to=mroswell@gmail.com" rel=nofollow 
                      target=_blank ymailto="mailto:mroswell@gmail.com"><A 
                      href="mailto:mroswell@gmail.com">mroswell@gmail.com</A></A>><BR>Subject: 
                      [postgis-users] unique id in QGIS/PostGIS<BR>To: "PostGIS 
                      Users Discussion" <<A 
                      href="/mc/compose?to=postgis-users@lists.osgeo.org" 
                      rel=nofollow target=_blank 
                      ymailto="mailto:postgis-users@lists.osgeo.org"><A 
                      href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</A></A>><BR>Date: 
                      Saturday, April 6, 2013, 9:18 PM<BR><BR></DIV>
                      <DIV>
                      <DIV>
                      <DIV>I've been googling up a storm, now that I've got a 
                      local postgis database with QGIS. But still haven't 
                      figured out how to display a newly created table. 
                      <BR><BR>The query I used to create the table:<BR>
                      <DIV style="MARGIN-LEFT: 40px">CREATE TABLE 
                      smaller_leg_final AS<BR>SELECT ST_Buffer(geom,-500) AS 
                      geom, legislative_final.district<BR>FROM 
                      legislative_final<BR>WHERE area > 30;<BR></DIV><BR>I 
                      then discovered that I needed a unique ID, and did the 
                      following:<BR>
                      <DIV style="MARGIN-LEFT: 40px">ALTER TABLE 
                      smaller_leg_final ADD COLUMN id serial not 
                      null;<BR></DIV><BR>This successfully populated the ID 
                      field with unique integers.<BR><BR>However when I go into 
                      QGIS, the Primary Key column offers no options. when I 
                      click into it, it just asks me to choose an SRID, which I 
                      believe I've already done. The table loads, but nothing 
                      displays. <BR><BR>I honestly feel a bit like a toddler 
                      given ice skates and placed on an icy rink. I'm toddling 
                      my way around, falling, getting back up, and then looking 
                      up and asking: why did I fall?<BR><BR>Once upon a time I 
                      was at the true cutting edge of GIS... I purchased MapInfo 
                      versions 1.1, and upgraded from there for many years. 
                      Moving into QGIS/Posgres/postGIS now, and well on the path 
                      to success, but .... not... quite... there.<BR><BR>Are 
                      there any QGIS users here who can help me to display my 
                      new table?<BR><BR>Do I need a different postgres 
                      statement? Is there a different field name expected? Maybe 
                      my query generated invalid shapes... But still, the geom 
                      field is displaying in the "Add PostGIS layers "Geometry 
                      column", but the Primary key column option doesn't allow 
                      me to select my 'id' field.<BR><BR>Insight 
                      welcome.<BR><BR><BR><BR><BR clear=all>
                      <DIV>
                      <DIV>--</DIV>
                      <DIV><A href="http://FarmBillPrimer.org" rel=nofollow 
                      target=_blank><A 
                      href="http://FarmBillPrimer.org">http://FarmBillPrimer.org</A></A></DIV><A 
                      href="http://www.BaltimoreUrbanAg.org" rel=nofollow 
                      target=_blank><A 
                      href="http://www.BaltimoreUrbanAg.org">http://www.BaltimoreUrbanAg.org</A></A> 
                      (Please send events; This site is hungry.)<BR><A 
                      href="http://www.ExcellentNutrition.org" rel=nofollow 
                      target=_blank><A 
                      href="http://www.ExcellentNutrition.org">http://www.ExcellentNutrition.org</A></A><BR><A 
                      href="http://www.packtpub.com/drupal-5-views-recipes/book" 
                      rel=nofollow target=_blank><A 
                      href="http://www.packtpub.com/drupal-5-views-recipes/book">http://www.packtpub.com/drupal-5-views-recipes/book</A></A><BR></DIV><BR><BR>
                      <DIV>On Thu, Apr 4, 2013 at 11:21 AM, Lelo - Luiz Rogério 
                      De Pieri <SPAN dir=ltr><<A 
                      href="http://mc/compose?to=lelo.pieri@gmail.com" 
                      rel=nofollow target=_blank><A 
                      href="mailto:lelo.pieri@gmail.com">lelo.pieri@gmail.com</A></A>></SPAN> 
                      wrote:<BR>
                      <BLOCKQUOTE 
                      style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
                        <DIV dir=ltr>
                        <DIV>
                        <DIV>
                        <DIV>Hi all,<BR><BR></DIV>I'm having a problem to 
                        execute a pgsql2shp command using java.<BR><BR></DIV>My 
                        OS is Ubuntu and it's frequently I use to generate shp 
                        files using pgsql2shp, but now I want to do it <SPAN 
                        lang=en><SPAN>through java.<BR><BR></SPAN></SPAN></DIV>
                        <DIV><SPAN lang=en><SPAN>The follow command works fine 
                        on terminal<BR>pgsql2shp -f pontos_05600202_teste -h 
                        myhost -u myuser -P mypasswd -g coordinates my_database 
                        "SELECT * from points where id_uploaded_file = 
                        37995";<BR><BR></SPAN></SPAN></DIV>
                        <DIV><SPAN lang=en><SPAN>Now I'm trying to execute the 
                        follow code:<BR><BR><SPAN 
                        style="FONT-FAMILY: courier new, monospace">ProcessBuilder 
                        pb = new ProcessBuilder("pgsql2shp", "-f 
                        pontos_05600202_teste", "-h myhost", "-u myuser", "-P 
                        mypasswd", "-g </SPAN></SPAN></SPAN><SPAN 
                        lang=en><SPAN><SPAN 
                        style="FONT-FAMILY: courier new, monospace"><SPAN 
                        lang=en><SPAN><SPAN 
                        style="FONT-FAMILY: courier new, monospace">coordinates</SPAN></SPAN></SPAN>", 
                        "my_database", "SELECT coordinates, date from points 
                        where id_uploaded_file = 37995");<BR><BR>Process 
                        proc;<BR>proc = pb.start();<BR>InputStream stdin = 
                        proc.getInputStream();<BR>InputStreamReader isr = new 
                        InputStreamReader(stdin);<BR>BufferedReader br = new 
                        BufferedReader(isr);<BR><BR>String line = 
                        null;<BR>System.out.println("<OUTPUT>");<BR><BR>while 
                        ((line = br.readLine()) != null)<BR>    
                        System.out.println(line);<BR><BR>System.out.println("</OUTPUT>");<BR>int 
                        exitVal = proc.waitFor();<BR>System.out.println("Process 
                        exitValue: " + exitVal);</SPAN><BR></SPAN></SPAN></DIV>
                        <DIV><BR clear=all>
                        <DIV>
                        <DIV>
                        <DIV>
                        <DIV>
                        <DIV>
                        <DIV>
                        <DIV>
                        <DIV><BR></DIV>
                        <DIV>And the result is:<BR><BR><SPAN 
                        style="FONT-FAMILY: courier new, monospace"><OUTPUT><BR>Preparing 
                        table for user query... Done.<BR>Initializing...  
                        </SPAN><SPAN 
                        style="FONT-FAMILY: courier new, monospace"><SPAN 
                        lang=en><SPAN><SPAN 
                        style="FONT-FAMILY: courier new, monospace">coordinates</SPAN></SPAN></SPAN>: 
                        no such attribute in table 
                        __pgsql2shp14493_tmp_table<BR></OUTPUT></SPAN><BR><BR></DIV>
                        <DIV>Does anybody as any idea about it?<BR><BR></DIV>
                        <DIV>Thank you for all<BR><BR>Best regards<SPAN><FONT 
                        color=#888888><BR></FONT></SPAN></DIV><SPAN><FONT 
                        color=#888888>
                        <DIV>-- <BR>Rogério De Pieri  (Lelo) 
                        <DIV>SCJP 5<BR>
                        <DIV>
                        <DIV>Buscando melhorar a cada dia<BR>Áudio, Hardware 
                        & Software</DIV></DIV>
                        <DIV><A href="http://www.twitter.com/lelopieri" 
                        rel=nofollow target=_blank><A 
                        href="http://www.twitter.com/lelopieri">www.twitter.com/lelopieri</A></A></DIV>
                        <DIV><A href="http://blogdolelo.wordpress.com" 
                        rel=nofollow target=_blank><A 
                        href="http://blogdolelo.wordpress.com">blogdolelo.wordpress.com</A></A></DIV></DIV></DIV></FONT></SPAN></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV><BR>_______________________________________________<BR>postgis-users 
                        mailing list<BR><A 
                        href="http://mc/compose?to=postgis-users@lists.osgeo.org" 
                        rel=nofollow target=_blank><A 
                        href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</A></A><BR><A 
                        href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" 
                        rel=nofollow target=_blank><A 
                        href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</A></A><BR><BR></BLOCKQUOTE></DIV><BR></DIV><BR></DIV></DIV>-----Inline 
                      Attachment Follows----- 
                      <DIV><BR><BR>
                      <DIV>_______________________________________________<BR>postgis-users 
                      mailing list<BR><A 
                      href="http://mc/compose?to=postgis-users@lists.osgeo.org" 
                      rel=nofollow target=_blank><A 
                      href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</A></A><BR><A 
                      href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" 
                      rel=nofollow target=_blank><A 
                      href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</A></A><BR></DIV></DIV></BLOCKQUOTE></TD></TR></TBODY></TABLE></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></BLOCKQUOTE></TD></TR></TBODY></TABLE></DIV></BLOCKQUOTE></BODY></HTML>