[gdal-dev] RE: gdal-dev Digest, Vol 45, Issue 16
Todd Fagin
tfagin at coordinatesolutions.com
Sat Feb 9 12:04:46 EST 2008
that's what you get for waiting.
Todd Fagin
Coordinate Solutions, Inc.
501 N.E. 15th St.
Oklahoma City, OK 73104
405.740.4324 (voice)
904.471.5548 (fax)
www.coordinatesolutions.com
-----Original Message-----
From: gdal-dev-bounces at lists.osgeo.org
[mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of
gdal-dev-request at lists.osgeo.org
Sent: Saturday, February 09, 2008 11:00 AM
To: gdal-dev at lists.osgeo.org
Subject: gdal-dev Digest, Vol 45, Issue 16
Send gdal-dev mailing list submissions to
gdal-dev at lists.osgeo.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.osgeo.org/mailman/listinfo/gdal-dev
or, via email, send a message with subject or body 'help' to
gdal-dev-request at lists.osgeo.org
You can reach the person managing the list at
gdal-dev-owner at lists.osgeo.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of gdal-dev digest..."
Today's Topics:
1. Re: Help on creating polygon shapefile (Frank Warmerdam)
2. Convert E00 into Shape (Chris Howell)
3. Re: Convert E00 into Shape (Frank Warmerdam)
4. BigTiff (cartrite)
5. gdal_translate on HDF data through absolute paths?!?!?!? (mattia)
6. gdal_translate on HDF data through absolute paths?!?!?!? (mattia)
----------------------------------------------------------------------
Message: 1
Date: Fri, 08 Feb 2008 21:06:44 -0500
From: Frank Warmerdam <warmerdam at pobox.com>
Subject: Re: [gdal-dev] Help on creating polygon shapefile
To: Limei Ran <lran at unc.edu>
Cc: gdal-dev at lists.osgeo.org
Message-ID: <47AD0AB4.6090704 at pobox.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Limei Ran wrote:
>
> Hi:
>
> I am new in using OGR. I tried to create a polygon shapefile using the
> following codes:
>
> ===============
> .......
> OGRPolygon *poG = new OGRPolygon();
> printf ("Declared OGRPolygon.\n");
>
> char mesg[256];
> unsigned char *geom;
> sprintf(mesg,
> "POLYGON(%f,%f,%f,%f,%f,%f,%f,%f,%f,%f)\0",x1,y1,x2,y2,x3,y3,x4,y4,x1,y1);
> geom = (unsigned char *) mesg;
> printf("POLYGON: %s\n",geom);
>
> printf ("Import Wkb.\n");
>
> if ( poG->importFromWkb(geom,0) != OGRERR_NONE )
> {
> printf( "Importing a Wkb polygon failed.\n" );
> exit( 1 );
> }
Limei,
Two major problems.
1) You are assembling WKT format geometry, but using importFromWkb().
Instead you need to use importFromWkt().
2) The format of the WKT is wrong. This is an example WKT polygon
with one ring. Note the two layers of brackets and that the x and
y values are separated by a space, while there is only a comma
between point pairs. Its programming - details matter!
POLYGON ((479750.6875 4764702.0,479658.59375 4764670.0,479640.09375
4764721.0,479735.90625 4764752.0,479750.6875 4764702.0))
Incidentally, assembling the polygon without going through WKT would
be more efficient. This is a reasonably clear example of creating
a polygon for a rectangle:
void OGRLayer::SetSpatialFilterRect( double dfMinX, double dfMinY,
double dfMaxX, double dfMaxY )
{
OGRLinearRing oRing;
OGRPolygon oPoly;
oRing.addPoint( dfMinX, dfMinY );
oRing.addPoint( dfMinX, dfMaxY );
oRing.addPoint( dfMaxX, dfMaxY );
oRing.addPoint( dfMaxX, dfMinY );
oRing.addPoint( dfMinX, dfMinY );
oPoly.addRing( &oRing );
SetSpatialFilter( &oPoly );
}
Best regards,
--
---------------------------------------+------------------------------------
--
I set the clouds in motion - turn up | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | President OSGeo, http://osgeo.org
------------------------------
Message: 2
Date: Fri, 8 Feb 2008 23:37:23 -0500
From: "Chris Howell" <chowell at pyxisinnovation.com>
Subject: [gdal-dev] Convert E00 into Shape
To: <gdal-dev at lists.osgeo.org>
Message-ID:
<8B5901C2B9E9094AA4028CF5E33980D702AEE8 at aristotle.PyxisInnovation.local>
Content-Type: text/plain; charset="iso-8859-1"
Please excuse this question if it has already been answered in some way
shape or form. I had difficulty finding an good answer to it on the web
little alone on the GDAL site. What is the best way to convert from an E00
into a shp format. Most of what I've read suggests I need to use an avenue
script however I was wondering if there was an easier way via something
provided in FWTools or anything like that. Any light you anyone could shed
on this issue would be must appreciated.
Cheers
Chris Howell
Software Engineer
the PYXIS innovation - Common Ground for Digital Earth
w. www.pyxisinnovation.com
p. 613-389-6619
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080208/75bcf1be/atta
chment-0001.html
------------------------------
Message: 3
Date: Fri, 08 Feb 2008 23:50:33 -0500
From: Frank Warmerdam <warmerdam at pobox.com>
Subject: Re: [gdal-dev] Convert E00 into Shape
To: Chris Howell <chowell at pyxisinnovation.com>
Cc: gdal-dev at lists.osgeo.org
Message-ID: <47AD3119.6030505 at pobox.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Chris Howell wrote:
> Please excuse this question if it has already been answered in some way
> shape or form. I had difficulty finding an good answer to it on the web
> little alone on the GDAL site. What is the best way to convert from an
> E00 into a shp format. Most of what I've read suggests I need to use an
> avenue script however I was wondering if there was an easier way via
> something provided in FWTools or anything like that. Any light you
> anyone could shed on this issue would be must appreciated.
Chris,
In theory you can do it with ogr2ogr. But there have been some problems
observed with reassembly of polygon geometry from E00 files with E00 so
you would want to check carefully if things seem to be working properly.
E00 is a topological format, but OGR assembles the polygon geometries
on the fly from lines to give a "whole polygon" view. Topological
relationships between features should be preserved as attributes referencing
the FIDs if that is important to you, though these relationships will be
mostly lost in a transfer to Shapefile which does not support the "integer
list" attributes required to keep some of them.
If ogr2ogr fails, you can use the avcimport.exe program
(http://avce00.maptools.org) to convert e00 to a binary arc/info coverage
which ogr can read without polygon assembly problems.
Best regards,
--
---------------------------------------+------------------------------------
--
I set the clouds in motion - turn up | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | President OSGeo, http://osgeo.org
------------------------------
Message: 4
Date: Sat, 09 Feb 2008 07:15:32 -0500
From: cartrite <stpoppy at ptd.net>
Subject: [gdal-dev] BigTiff
To: gdal-dev at lists.osgeo.org
Message-ID: <1202559332.5199.15.camel at linux-o863.site>
Content-Type: text/plain
Hi,
Thought I'd send a positive email.
I tried to add BigTiff support buy building tiff-4.0.0alpha and
libgeotiff-1.2.4. Then I built gdal with the svn last Thursday.
Everything looked like it worked out well. I was able to initilize a
92160x46080 8it file with gdal_tranlate. I also used gdalwarp to mosaic
2 46080x46080 geotiffs into the the 92160x46080 file. It was exactly 4
gb. I was not able to do this with gdal using the internal libtiff. Are
there any tests you would like me to do?
Steve
------------------------------
Message: 5
Date: Sat, 9 Feb 2008 14:32:11 -0200
From: mattia <mattia.parigiani at gmail.com>
Subject: [gdal-dev] gdal_translate on HDF data through absolute
paths?!?!?!?
To: gdal-dev at lists.osgeo.org
Message-ID:
<6b6f1c810802090832w799d255kcbb224a6199b503f at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
I would like to know if it is possible to call gdal_translate on an HDF 4
SUBDATASET specified with an absolute path..
At the moment I do something like:
*gdal_translate -of GTiff -b 1 -b 2 -b 3 -co "PHOTOMETRIC=RGB"
HDF4_SDS:UNKNOWN:"AMOD021KM20070202.hdf":0 out.tif*
This is called from the working directory (.), where the HDF file lies..
What if I want to call the gdal_translate utility from somewhere else in the
file system?? ie: specify the dataset through absolute path??
Other thing is that I am trying to do this because I will eventually want to
call GDAL utilities from within CGI scripts running in a Apache HTTPD
server... I am though still not sure if this is doable and how to link the
wanted libraries so that they can be seen by CGI scripts..
Dos anyone have any experience/suggestions about this ??
Thanks in advance to all
--
Mattia
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080209/ae3fc1f0/atta
chment-0001.html
------------------------------
Message: 6
Date: Sat, 9 Feb 2008 14:33:52 -0200
From: mattia <mattia.parigiani at gmail.com>
Subject: [gdal-dev] gdal_translate on HDF data through absolute
paths?!?!?!?
To: gdal-dev <gdal-dev at lists.maptools.org>, gdal-dev at lists.osgeo.org
Message-ID:
<6b6f1c810802090833x2afd6d2fg1d491eb2c7ebdba2 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
I would like to know if it is possible to call gdal_translate on an HDF 4
SUBDATASET specified with an absolute path..
At the moment I do something like:
*gdal_translate -of GTiff -b 1 -b 2 -b 3 -co "PHOTOMETRIC=RGB"
HDF4_SDS:UNKNOWN:"AMOD021KM20070202.hdf":0 out.tif*
This is called from the working directory (.), where the HDF file lies..
What if I want to call the gdal_translate utility from somewhere else in the
file system?? ie: specify the dataset through absolute path??
Other thing is that I am trying to do this because I will eventually want to
call GDAL utilities from within CGI scripts running in a Apache HTTPD
server... I am though still not sure if this is doable and how to link the
wanted libraries so that they can be seen by CGI scripts..
Dos anyone have any experience/suggestions about this ??
Thanks in advance to all
--
Mattia
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080209/9dc886d0/atta
chment-0001.html
------------------------------
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev
End of gdal-dev Digest, Vol 45, Issue 16
****************************************
More information about the gdal-dev
mailing list