Re: [FWTools] org2org: import TIGER data into a specific schema in PostgreSQL

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [FWTools] org2org: import TIGER data into a specific schema in PostgreSQL

Shuo Liu

Hi, All,

I'm trying to import TIGER data into a PostgreSQL database. The command I use is:

ogr2ogr -f "PostgreSQL" PG:"dbname=test user=someuser host=localhost password=somepass" .

This command put the data into the "public" schema. I'm wondering if there is a way to import the data into a specific schema such as "mySchema". I tried to use the option "-dsco" as:

ogr2ogr -f "PostgreSQL" PG:"dbname=test user=someuser host=localhost password=somepass" -dsco schema=mySchema .

But it still put the data into the "public" schema. Could anyone please give any suggestion? Thanks.




_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

gdal_translate question

Christopher Condit
I'm trying to translate from an EHdr dataset to a GeoTIFF, but want to
incorporate the correct min/max values from the EHdr statistics file.
I'm currently using: gdal_translate -ot Int32 -scale 0 65535 -415 5778
input.DEM output.tiff
Is there any way to do this automatically since the statistics will vary
from DEM to DEM?

Thanks,
-Chris

gdalinfo output:

Driver: EHdr/ESRI .hdr Labelled
Files: E020N40.DEM
       E020N40.hdr
       E020N40.stx
       E020N40.prj
Size is 4800, 6000
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9108"]],
    AXIS["Lat",NORTH],
    AXIS["Long",EAST],
    AUTHORITY["EPSG","4326"]]
Origin = (20.000000000000004,39.999999999999993)
Pixel Size = (0.008333333333330,-0.008333333333330)
Corner Coordinates:
Upper Left  (  20.0000000,  40.0000000) ( 20d 0'0.00"E, 40d 0'0.00"N)
Lower Left  (  20.0000000, -10.0000000) ( 20d 0'0.00"E, 10d 0'0.00"S)
Upper Right (  60.0000000,  40.0000000) ( 60d 0'0.00"E, 40d 0'0.00"N)
Lower Right (  60.0000000, -10.0000000) ( 60d 0'0.00"E, 10d 0'0.00"S)
Center      (  40.0000000,  15.0000000) ( 40d 0'0.00"E, 15d 0'0.00"N)
Band 1 Block=4800x1 Type=UInt16, ColorInterp=Undefined
  Min=-415.000 Max=5778.000   Computed Min/Max=0.000,65535.000
  Minimum=-415.000, Maximum=5778.000, Mean=516.400, StdDev=573.400
  NoData Value=-9999



_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: [FWTools] org2org: import TIGER data into a specific schema in PostgreSQL

Tim Keitt-2
In reply to this post by Shuo Liu
Marvin <delphet <at> excite.com> writes:

> But it still put the data into the "public" schema. Could anyone please give
any suggestion? Thanks.

Yes. I was just doing that 5 minutes ago.
Use the -lco option eg -lco SCHEMA=<schema-name>

One catch though -- only lowercase schema names are accepted!

THK

>
> _______________________________________________
> Join Excite! - http://www.excite.com
> The most personalized portal on the Web!
>




_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

RE: Re: [FWTools] org2org: import TIGER data into a specificschema in PostgreSQL

Dean Mikkelsen
In reply to this post by Shuo Liu

Hi there.

Have you tried:

ogr2ogr -f "PostgreSQL" PG:"dbname=test user=someuser myschema
host=localhost password=somepass"

I've added the "myschema".

When I first started working with PostGIS last week, I found I had to do the
username and schema one after the other in order place the data in the
correct schema.

Let me know if this works.

Cheers,
Dean


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Marvin
Sent: Tuesday, July 31, 2007 1:11 PM
To: [hidden email]
Subject: [Gdal-dev] Re: [FWTools] org2org: import TIGER data into a
specificschema in PostgreSQL



Hi, All,

I'm trying to import TIGER data into a PostgreSQL database. The command I
use is:

ogr2ogr -f "PostgreSQL" PG:"dbname=test user=someuser host=localhost
password=somepass" .

This command put the data into the "public" schema. I'm wondering if there
is a way to import the data into a specific schema such as "mySchema". I
tried to use the option "-dsco" as:

ogr2ogr -f "PostgreSQL" PG:"dbname=test user=someuser host=localhost
password=somepass" -dsco schema=mySchema .

But it still put the data into the "public" schema. Could anyone please give
any suggestion? Thanks.




_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev


_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

RE: Re: [FWTools] org2org: import TIGER data into a specificschema in PostgreSQL

Shuo Liu

Hi, Dean,

Thanks for the info. I tried your command but got the following error message:

ogr2ogr -f "PostgreSQL" PG:"dbname=test user=someuser mySchema host=localhost password=somepass" .
ERROR 1: PQconnectdb failed.
missing "=" after "mySchema" in connection info string

ERROR 1: PostgreSQL driver doesn't currently support database creation.
Please create database with the `createdb' command.
PostgreSQL driver failed to create PG:dbname=test user=someuser mySchema host=localhost password=somepass

Do I need to insert anything between "mySchema" and the user name? BTW, I use TWTools 1.3.3. Is it the version you use?




 --- On Tue 07/31, Dean C. Mikkelsen < [hidden email] > wrote:
From: Dean C. Mikkelsen [mailto: [hidden email]]
To: [hidden email]
Date: Tue, 31 Jul 2007 19:18:54 -0700
Subject: RE: [Gdal-dev] Re: [FWTools] org2org: import TIGER data into a specificschema in PostgreSQL

Hi there.Have you tried:ogr2ogr -f "PostgreSQL" PG:"dbname=test user=someuser myschemahost=localhost password=somepass"I've added the "myschema".When I first started working with PostGIS last week, I found I had to do theusername and schema one after the other in order place the data in thecorrect schema.Let me know if this works.Cheers,Dean-----Original Message-----From: [hidden email][mailto:[hidden email]] On Behalf Of MarvinSent: Tuesday, July 31, 2007 1:11 PMTo: [hidden email]: [Gdal-dev] Re: [FWTools] org2org: import TIGER data into aspecificschema in PostgreSQLHi, All,I'm trying to import TIGER data into a PostgreSQL database. The command Iuse is:ogr2ogr -f "PostgreSQL" PG:"dbname=test user=someuser host=localhostpassword=somepass" .This command put the data into the "public" schema. I'm wondering if thereis a way to import the data into a specific schema such as "mySchema". Itried to use the option "-dsco"
as:ogr2ogr -f "PostgreSQL" PG:"dbname=test user=someuser host=localhostpassword=somepass" -dsco schema=mySchema .But it still put the data into the "public" schema. Could anyone please giveany suggestion? Thanks._______________________________________________Join Excite! - http://www.excite.comThe most personalized portal on the Web!_______________________________________________Gdal-dev mailing [hidden email]://lists.maptools.org/mailman/listinfo/gdal-dev_______________________________________________Gdal-dev mailing [hidden email]://lists.maptools.org/mailman/listinfo/gdal-dev

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: gdal_translate question

Frank Warmerdam
In reply to this post by Christopher Condit
Christopher Condit wrote:
> I'm trying to translate from an EHdr dataset to a GeoTIFF, but want to
> incorporate the correct min/max values from the EHdr statistics file.
> I'm currently using: gdal_translate -ot Int32 -scale 0 65535 -415 5778
> input.DEM output.tiff
> Is there any way to do this automatically since the statistics will vary
> from DEM to DEM?

Chris,

If you omit the min/max values to the -scale option, gdal_translate will
pick min/max values itself.  I *think* it uses the metadata min/max.

eg.

gdal_translate -ot Int32 -scale 0 65535 input.DEM output.tiff

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org

_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: [FWTools] org2org: import TIGER data into a specific schema in PostgreSQL

Shuo Liu
In reply to this post by Shuo Liu

Hi, Tim,

It worked. Thank you so much. BTW, was it mentioned in any documentation?




 --- On Tue 07/31, Tim Keitt < [hidden email] > wrote:
From: Tim Keitt [mailto: [hidden email]]
To: [hidden email]
Date: Tue, 31 Jul 2007 23:35:00 +0000 (UTC)
Subject: [Gdal-dev] Re: [FWTools] org2org: import TIGER data into a specific schema in PostgreSQL

Marvin <delphet <at> excite.com> writes:> But it still put the data into the "public" schema. Could anyone please giveany suggestion? Thanks.Yes. I was just doing that 5 minutes ago.Use the -lco option eg -lco SCHEMA=<schema-name>One catch though -- only lowercase schema names are accepted!THK> > _______________________________________________> Join Excite! - http://www.excite.com> The most personalized portal on the Web!> _______________________________________________Gdal-dev mailing [hidden email]://lists.maptools.org/mailman/listinfo/gdal-dev

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev