[gdal-dev] Can't get 1*N dataset in HDFfile

2009-09-02 Thread jor sion
Hi,
I can't get 1*N dataset in HDF file by GDAL,

The dataset looks like this:
[image: dataset.png]
It shows in HDF Explorer
[image: show.png]

Any suggestions?

Best wishes,

-- 
JoSn
show.pngdataset.png___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] Problem In reading S-63 Chart

2009-09-02 Thread vinod bholla
Hi Friends


I m vinod... i m woking over reading of S-63 charts,i m following test
procedure to decrypt the information.
i m unable to read the information, can you provide any information
regarding this,that will be appricable.
for its reading.



thnx
vinod
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

[Gdal-dev] How to save picture into bmp-file?

2009-09-02 Thread ryabis

Sorry, but I`m just started to use C++ and GDAL library... :thinking:
I have opened the image, using this code:

void BIScrollView::loadFile(QString biFileName)
{
   canv-resize(biLbl-width(), biLbl-height());
if( biFileName.isEmpty() )
{
biClose();
biFileName = QFileDialog::getOpenFileName( /data/ );
}
pszFilename = biFileName;
if( biIsOpen )
{
biClose();
}
if( !biFileName.isEmpty() ){
m_Dataset_1 = NULL;
GDALAllRegister();
m_Dataset_1 = ( GDALDataset* )GDALOpen( biFileName, GA_ReadOnly );
if( m_Dataset_1 != NULL ){
biIsOpen = true;
imgInfo_1.DriverMeta  = m_Dataset_1-GetDriver()-GetMetadataItem(
GDAL_DMD_LONGNAME );
imgInfo_1.DriverDescr = m_Dataset_1-GetDriver()-GetDescription();
imgInfo_1.RasterXSize = m_Dataset_1-GetRasterXSize();
imgInfo_1.RasterYSize = m_Dataset_1-GetRasterYSize();
imgInfo_1.RasterCount = m_Dataset_1-GetRasterCount();
imgInfo_1.DataType = m_Dataset_1-GetRasterBand( 1
)-GetRasterDataType();

GDALColorTable * ColorTable = m_Dataset_1-GetRasterBand( 1
)-GetColorTable();
if( ColorTable ){
if( imgInfo_1.RasterCount == 1 ){
imgInfo_1.ColorEntryCount = 
ColorTable-GetColorEntryCount();
}
}
xScrollBar-setMaxValue( imgInfo_1.RasterXSize - biLbl-width() );
yScrollBar-setMaxValue( imgInfo_1.RasterYSize - biLbl-height() );
qWarning( RasterXSize = +QString::number( imgInfo_1.RasterXSize -
biLbl-width() ) );
qWarning( RasterYSize = +QString::number( imgInfo_1.RasterYSize -
biLbl-height() ) );
switch( imgInfo_1.DataType )
{
case GDT_Byte : qWarning( DataType = Eight bit unsigned 
integer
);  break;
case GDT_UInt16   : qWarning( DataType = Sixteen bit unsigned 
integer
);break;
case GDT_Int16: qWarning( DataType = Sixteen bit signed 
integer
);  break;
case GDT_UInt32   : qWarning( DataType = Thirty two bit unsigned
integer ); break;
case GDT_Int32: qWarning( DataType = Thirty two bit signed
integer );   break;
case GDT_Float32  : qWarning( DataType = Thirty two bit floating
point );   break;
case GDT_Float64  : qWarning( DataType = Sixty four bit floating
point );   break;
case GDT_CInt16   : qWarning( DataType = Complex Int16 ); 
 
break;
case GDT_CInt32   : qWarning( DataType = Complex Int32 ); 
 
break;
case GDT_CFloat32 : qWarning( DataType = Complex Float32 );   
 
break;
case GDT_CFloat64 : qWarning( DataType = Complex Float64 );   
 
break;
}
poBand_1 = m_Dataset_1-GetRasterBand( 1 );
imgInfo_1.ColorInterp = poBand_1-GetColorInterpretation();
switch( imgInfo_1.ColorInterp )
{
case GCI_GrayIndex  : qWarning( ColorInterp = Greyscale );

break;
case GCI_PaletteIndex   : qWarning( ColorInterp = Paletted (see
associated color table) ); break;
case GCI_RedBand: qWarning( ColorInterp = Red band of RGBA
image );break;
case GCI_GreenBand  : qWarning( ColorInterp = Green band of 
RGBA
image );  break;
case GCI_BlueBand   : qWarning( ColorInterp = Blue band of RGBA
image );   break;
case GCI_AlphaBand  : qWarning( ColorInterp = Alpha
(0=transparent, 255=opaque) ); break;
case GCI_HueBand: qWarning( ColorInterp = Hue band of HLS
image ); break;
case GCI_SaturationBand : qWarning( ColorInterp = Saturation band 
of
HLS image );  break;
case GCI_LightnessBand  : qWarning( ColorInterp = Lightness band of
HLS image );   break;
case GCI_CyanBand   : qWarning( ColorInterp = Cyan band of CMYK
image );   break;
case GCI_MagentaBand: qWarning( ColorInterp = Magenta band of 
CMYK
image );break;
case GCI_YellowBand : qWarning( ColorInterp = Yellow band of 
CMYK
image ); break;
case GCI_BlackBand  : qWarning( ColorInterp = Black band of 
CMLY
image );  break;
//  case GCI_YCbCr_YBand: qWarning( ColorInterp = Y Luminance );  

break;
//  case GCI_YCbCr_CbBand   : qWarning( ColorInterp = Cb Chroma );

break;
//  case GCI_YCbCr_CrBand   : qWarning( ColorInterp = Cr Chroma );

break;
case GCI_Undefined  : qWarning( ColorInterp = GCI_Undefined 
);
break;
//case GCI_Max: qWarning( 

Re: [Gdal-dev] How to save picture into bmp-file?

2009-09-02 Thread Frank Warmerdam

ryabis wrote:

Sorry, but I`m just started to use C++ and GDAL library... :thinking:
I have opened the image, using this code:


...


poBand_1-RasterIO( GF_Read, x_off, y_off, xsize, ysize, 
pafScanline,
xsize, ysize, GDT_Byte, 1, xsize );



...


if (poBand-RasterIO( GF_Write, 0, 0, 512, 512, abyRaster, 512, 512,
GDT_Byte, 0, 0 ) == CE_Failure) 

...

What should I write instead of abyRaster?


Ryabis,

You would presumably need to read the region from the source file as you
did above for one band images into pafScanline, and then write that
same buffer into the output file in plcae of abyRaster.

Best regards,
--
---+--
I set the clouds in motion - turn up   | Frank Warmerdam, warmer...@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush| Geospatial Programmer for Rent

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] OGR about s_57

2009-09-02 Thread s duclos
Hi Frank,

 I know lots of people have made various levels of effort
 in
 following the S52 specification based on OGR as a feature
 reader.  Perhaps some of them will speak up and
 volunteer
 additional information.
 

Here's info I send to Randy. It's border line related to OGR/S57 but
googler might find this useful:

Old IHO's S-52 Manual at 'the Wayback Machine': 
http://web.archive.org/web/20030323010814/http://www.iho.shom.fr/general/ecdis/pslb03_2.pdf

This manual explain how to link OGR/S-57 to S-52 for rendering.
Note that the audience is ECDIS manufacturer. Note also that is old stuff.
Finally note that this whole S-57/S-52 is about to be replace by
S-100/S-101, an extended and XML'ised version aligned on 0GC/ISO.

If all you want is color then you can find decent RGB for recent S-52
color palette by Googling.

XML'ing S-57/S-52 is just an other way to serialize ENC data.
There is provision in S-100/S-101 to embed GeoTIFF (for bathymetric stuff)
also. So, to GDAL/OGR this new stuff is not that alien.


rgds,

Sylvain.

--- On Tue, 9/1/09, Frank Warmerdam warmer...@pobox.com wrote:

 From: Frank Warmerdam warmer...@pobox.com
 Subject: Re: [gdal-dev] OGR about s_57
 To: Randy randyqi...@hotmail.com
 Cc: GDAL/OGR mailing list gdal-dev@lists.osgeo.org
 Received: Tuesday, September 1, 2009, 9:46 PM
 Randy wrote:
  Hi, everyone,
  
     I’m now interesting in displaying
 ENCs.
  
     I know the OGR can support the s57 format
 files and it can get some 
  data like point、line、polygon. But it cannot
 support the styles as Mr 
  Frank Warmerdam told me. Now, I have such questions:
  
  1.       Where can I know
 what OGR does support and does not support 
  about s57 ? Does it get the symbols(no, right?)?
 
 Randy,
 
 OGR does not read the actual graphical symbols.  For
 instance,
 we might have a feature from the WRECKS layer like below
 with
 various valuable attributes, but actual wreck symbol.
 
 OGRFeature(WRECKS):2163
   RCID (Integer) = 2164
   PRIM (Integer) = 1
   GRUP (Integer) = 2
   OBJL (Integer) = 159
   RVER (Integer) = 1
   AGEN (Integer) = 540
   FIDN (Integer) = 2135161787
   FIDS (Integer) = 688
   LNAM (String) = 021C7F43FBBB02B0
   NAME_RCNM (IntegerList) = (1:110)
   NAME_RCID (IntegerList) = (1:517)
   ORNT (IntegerList) = (1:255)
   USAG (IntegerList) = (1:255)
   MASK (IntegerList) = (1:255)
   CATWRK (Integer) = 1
   QUASOU (String) = 2
   WATLEV (Integer) = 3
   POINT (61.1031909 -32.4450159)
 
  2.       If I have got the
 color and symbols, How could I know which 
  kind of color the line(or polygon or something else
 which I get with the 
  help of OGR) should match with?
 
 You would normally read the S52 specification and use it
 to
 determine appropriate coloring, styling and symbolization
 from the attributes of a feature.   I
 haven't actually reviewed
 the S52 specification, but I imagine it has rules for how
 to draw wrecks that might indicate different symbols
 depending
 on the CATWRK (Category of Wreck) and WATLEV (Water level
 effect) attributes of the feature.
 
  3.       Has anyone done such
 things, can you help me something?
 
 I know lots of people have made various levels of effort
 in
 following the S52 specification based on OGR as a feature
 reader.  Perhaps some of them will speak up and
 volunteer
 additional information.
 
  4.       I know the file
 “IHO ECDIS Presentation Library” can help me 
  but I don’t know how to get it, can you?
 
 Normally the IHO web site should have instructions on
 ordering.
 
 Best regards,
 -- 
 ---+--
 I set the clouds in motion - turn up   |
 Frank Warmerdam, warmer...@pobox.com
 light and sound - activate the windows | http://pobox.com/~warmerdam
 and watch the world go round - Rush    |
 Geospatial Programmer for Rent
 
 ___
 gdal-dev mailing list
 gdal-dev@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/gdal-dev
 


  __
Looking for the perfect gift? Give the gift of Flickr! 

http://www.flickr.com/gift/
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Problem In reading S-63 Chart

2009-09-02 Thread Frank Warmerdam

vinod bholla wrote:

Hi Friends


I m vinod... i m woking over reading of S-63 charts,i m following test 
procedure to decrypt the information.
i m unable to read the information, can you provide any information 
regarding this,that will be appricable.

for its reading.


Vinod,

There is no support in GDAL/OGR for reading encrypted enc files (I assume
S-63 is what is sometimes called S-ENC?).  My understanding is that it would
be hard to do this in open source software since the folks responsible are
very particular about who they provide decryption keys to.

Best regards,
--
---+--
I set the clouds in motion - turn up   | Frank Warmerdam, warmer...@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush| Geospatial Programmer for Rent

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] extract vector/raster data from GeoPDF

2009-09-02 Thread Klokan Petr Přidal
Hi,

There is a great blog post (and the linked worked example post with details):
http://geopdf.blogspot.com/2009/02/geopdf-map-for-worked-example.html

It shows you how to create geopdf via GhostScript - so there is
already a practical open-source example how to encode the georeference
into the PDF/PS according the OGC standard - for use in Acrobat
Reader. To add support for such tag in MapServer, which generates pdf
dynamicaly via pdflib, should not be totally problematic.

Decoding is not as hard either, there are nice libraries like poppler
(http://poppler.freedesktop.org/), which allows you to parse vectors
(and convert them to SVG for example) or rasterize the PDF files (into
TIFF,...) via Cairo.
The work is in assigning correct geographic coordinates to the
coordinate system internally used in PDF files and especially write
the bridge to the outside world (with GDAL/OGR).
I am afraid that authors of the GeoPDF standard would not like this,
as it seems that the idea of GeoPDF is see it in the Acrobat, print
it, but that's all. At least I think so, because they discontinued
their Geopdf2geotiff product and all the conversion tools are just one
way - into GeoPDF. Please correct me...

Anyway, in this moment you can quite easily use utility like
pdfimages to extract full quality image tiles from any GeoPDF (like
those from USGS) and merge it based on their location in PDF into one
GDAL file via VRT (gdalbuildvrt) with a bit of hacking. This is what I
did for my favorite USGS DRG of Grand Canyon ;-).
Look at: http://klokan.mzk.cz/~klokan/geopdf/ - soon I will update the
MapTiler.org overlay examples...

Unfortunately all PDF parsing libraries I know are GPL, and that means
we can't use them for the gdal driver - because of the license issues.
But to create a GPL utility for converting GeoPDF to anything what
GDAL/OGR supports should be OK. Poppler can be the best base of such
GDAL-based utility for reading/rasterizing of the GeoPDF files.

Now just find a sponsor and time to make it ;-).

Best,

Klokan Petr Pridal
-- 
http://blog.klokan.cz/
http://www.maptiler.org/
http://www.oldmapsonline.org/
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] extract vector/raster data from GeoPDF

2009-09-02 Thread Frank Warmerdam

Klokan Petr Přidal wrote:

Unfortunately all PDF parsing libraries I know are GPL, and that means
we can't use them for the gdal driver - because of the license issues.
But to create a GPL utility for converting GeoPDF to anything what
GDAL/OGR supports should be OK. Poppler can be the best base of such
GDAL-based utility for reading/rasterizing of the GeoPDF files.


Folks,

I would note that it is fine to use external GPL libraries for optional
GDAL/OGR format drivers.  It just means we won't be copying the whole
source into GDAL for convenient building like we do for stuff like libtiff
and that some users of GDAL will not use that driver.

I'd prefer a more compatible license for supporting libraries, but it is
not all that important.

Best regards,
--
---+--
I set the clouds in motion - turn up   | Frank Warmerdam, warmer...@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush| Geospatial Programmer for Rent

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] gdal_translate problems...

2009-09-02 Thread Riki Tiki

hi,

i am using the following command to convert from raster to geotiff

gdal_translate -of GTiff test test.tif

it outputs the following:

ERROR 1: Unknown base item type : 4
ERROR 1: Unknown base item type : 4
Input file size is 221, 232
0...10...20...30...40...50...60...70...80...90...100 - done.


Please can you tell me what are those errors mean? And possible solution to 
avoid it,...?

thanks,
Riki

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] extract vector/raster data from GeoPDF

2009-09-02 Thread Brent Fraser
I see the example calculation of the transformation matrix, and a statement I 
created a GeoPDF by running the Postscript file through Ghostscript to create a 
Postscript file that looks like this


But I don't see where the georeferencing is written into PDF to make it a 
GeoPDF.  Is it a Ghostscript command line?


Brent

Klokan Petr Přidal wrote:

Hi,

There is a great blog post (and the linked worked example post with details):
http://geopdf.blogspot.com/2009/02/geopdf-map-for-worked-example.html

It shows you how to create geopdf via GhostScript - so there is
already a practical open-source example how to encode the georeference
into the PDF/PS according the OGC standard - for use in Acrobat
Reader. To add support for such tag in MapServer, which generates pdf
dynamicaly via pdflib, should not be totally problematic.

Decoding is not as hard either, there are nice libraries like poppler
(http://poppler.freedesktop.org/), which allows you to parse vectors
(and convert them to SVG for example) or rasterize the PDF files (into
TIFF,...) via Cairo.
The work is in assigning correct geographic coordinates to the
coordinate system internally used in PDF files and especially write
the bridge to the outside world (with GDAL/OGR).
I am afraid that authors of the GeoPDF standard would not like this,
as it seems that the idea of GeoPDF is see it in the Acrobat, print
it, but that's all. At least I think so, because they discontinued
their Geopdf2geotiff product and all the conversion tools are just one
way - into GeoPDF. Please correct me...

Anyway, in this moment you can quite easily use utility like
pdfimages to extract full quality image tiles from any GeoPDF (like
those from USGS) and merge it based on their location in PDF into one
GDAL file via VRT (gdalbuildvrt) with a bit of hacking. This is what I
did for my favorite USGS DRG of Grand Canyon ;-).
Look at: http://klokan.mzk.cz/~klokan/geopdf/ - soon I will update the
MapTiler.org overlay examples...

Unfortunately all PDF parsing libraries I know are GPL, and that means
we can't use them for the gdal driver - because of the license issues.
But to create a GPL utility for converting GeoPDF to anything what
GDAL/OGR supports should be OK. Poppler can be the best base of such
GDAL-based utility for reading/rasterizing of the GeoPDF files.

Now just find a sponsor and time to make it ;-).

Best,

Klokan Petr Pridal

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] gdal_translate problems...

2009-09-02 Thread Frank Warmerdam

Riki Tiki wrote:

hi,

i am using the following command to convert from raster to geotiff

gdal_translate -of GTiff test test.tif

it outputs the following:

ERROR 1: Unknown base item type : 4
ERROR 1: Unknown base item type : 4
Input file size is 221, 232
0...10...20...30...40...50...60...70...80...90...100 - done.


Please can you tell me what are those errors mean? And possible solution to 
avoid it,...?


Riki,

It means that a HFA (Erdas Imagine) format file had a BASEDATA object
with data inside it of a type not supported by GDAL.  This is likely not
too serious - perhaps you will have incorrect nodata values.

If it is a concern, consider filing a ticket with the data.  Assuming
you are working with an arc/info binary coverage, likely all we need
is the .aux file.

Best regards,
--
---+--
I set the clouds in motion - turn up   | Frank Warmerdam, warmer...@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush| Geospatial Programmer for Rent

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL Erdas LAN/GIS driver

2009-09-02 Thread Roger Bivand

On Thu, 27 Aug 2009, Roger Bivand wrote:


On Mon, 24 Aug 2009, Frank Warmerdam wrote:


Roger Bivand wrote:


(reverting to list)

Correction, the user reported that:

Apparently, gdalinfo retrieves the correct min, max, and statistics, 
despite the use of GDT_Int16.


on his Windows platform. The different GDAL versions ought to explain why 
his gdalinfo says Int16 but gives statistics from UInt16.

...
On the trunk, GDT_Int16 is used too, so how does gdalinfo detect that it 
is actually UInt16?


Roger,

I believe the min/max is actually being read from the file header in trunk
and is handled without regard to the actual imagery or it's type.

I skimmed the changelog for this driver and I didn't notice any obvious
changes in metadata / statistics handling so I'm surprised at this result.

Best regards,



Frank,

Having at last got the data and a current 1.7.0dev, I have to report that on 
x86 Linux, I cannot reproduce the reading of Int16 as UInt16 reported by the 
original questioner - I get Int16 and a negative minimum with gdalinfo, and 
in rgdal using the same *.so. How the difference arose is unclear, I can 
download FWTools and check on Windows.


Checked, same results. In the output sent by the original questioner, 
gdalinfo named two files:


C:\Program Files\FWTools2.4.2gdalinfo stand_bm.gis
Driver: LAN/Erdas .LAN/.GIS
Files: c:\landis\harvest_problem\FTT-N_MinT-N\stand_bm.gis
  c:\landis\harvest_problem\FTT-N_MinT-N\stand_bm.gsw
Size is 1758, 839
...

so I think that the statistics are coming from stand_bm.gsw. He hasn't 
responded to my request for this file.


I've submitted a fresh rgdal to CRAN for release, but without any 
guessing about which type is right. I've exposed by band what 
GetMinimum(), GetMaximum(), and GetRasterDataType() return, so that the 
user can investigate further, and documented that min/max may just be the 
range of the type, not of the band, unless given by pre-calculated sources 
(such as a header file).


I guess that there is no programmatic way for drivers to report what 
(internal) types they are putting into the GDTs, right?


With regard to LAN/GIS, I don't think that there are clear authorities for 
changing anything, but a slight change to the documentation, adding:


4bit and 8bit data are read unsigned, 16bit data are read signed.

after the second sentence in the first paragraph.

Best wishes,

Roger



I would argue for replacing Int16 by UInt16 in the LAN/GIS driver based on 
PCI and ESRI references to the data types as unsigned, but am open to other 
arguments.


Best wishes,

Roger




--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: roger.biv...@nhh.no

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] Motion: Commit access for Harsh Govind

2009-09-02 Thread Frank Warmerdam

Motion: Extent commit access to Harsh Govind.

---

PSC members,

Harsh reports:


I am a GIS Developer  at SPADAC Inc. and responsibilities include compiling and 
upgrading GDAL for our products. In the past 4+ years at SPADAC I have setup 
automated build process for compiling and building GDAL along with its SDE 
(multiple versions of ArcSDE) and OCI drivers as plug-ins and C# wrapper for 
.NET version of our product: Signature Analyst® (SA) [Details: 
http://www.spadac.com/SignatureAnalyst/]. The build process keeps debug and 
release versions separate so programmers may step into the code if required 
during development. My upcoming tasks include creating separate builds for 
32bit and 64bit machines.


I have implemented multiple export formats (vector) for results of SA utilizing 
GDAL/ OGR. I have been involved in development of tools for reading/writing 
vector data using GDAL/OGR and also using C# wrapper giving me experience in 
both C++ and C# (SDE, SHP and PGDB formats in particular). E.g. Export SA 
assessment as Shapefile, Read SDE data source as factor for SA, Read PGDB data 
source as factor in SA, etc... I recently fixed a bug in ogrsdedatasource.cpp 
which would cause a failure to return a particular layer if SDE version is 
SDE.DEFAULT.


Also, I am involved in multiple tasks relating GDAL/OGR with other Team members 
that include KML Super Overlay driver and supporting date query in SHP files.



Harsh and SPADAC have been contributing fixes through me and Trac and now have
several substantial improvements including a new KML Super Overlay driver they
would like to contribute.  I have suggested that Harsh become a committer so
that SPADAC can more directly contribute improvements.

I'll let Harsh confirm to the mailing list that he is prepared to adhere to
the RFC 3 GDAL Committer Guidelines.

Best regards,
--
---+--
I set the clouds in motion - turn up   | Frank Warmerdam, warmer...@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush| Geospatial Programmer for Rent

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] extract vector/raster data from GeoPDF

2009-09-02 Thread Joaquim Luis

Brent Fraser wrote:
I see the example calculation of the transformation matrix, and a 
statement I created a GeoPDF by running the Postscript file through 
Ghostscript to create a Postscript file that looks like this


But I don't see where the georeferencing is written into PDF to make it 
a GeoPDF.  Is it a Ghostscript command line?


Brent,

One only has to convert it to pdf using ghostscript.
I did it with GMT's ps2raster, like that

ps2raster quad.ps -Tf -A

Joaquim Luis



Brent

Klokan Petr Přidal wrote:

Hi,

There is a great blog post (and the linked worked example post with 
details):

http://geopdf.blogspot.com/2009/02/geopdf-map-for-worked-example.html

It shows you how to create geopdf via GhostScript - so there is
already a practical open-source example how to encode the georeference
into the PDF/PS according the OGC standard - for use in Acrobat
Reader. To add support for such tag in MapServer, which generates pdf
dynamicaly via pdflib, should not be totally problematic.

Decoding is not as hard either, there are nice libraries like poppler
(http://poppler.freedesktop.org/), which allows you to parse vectors
(and convert them to SVG for example) or rasterize the PDF files (into
TIFF,...) via Cairo.
The work is in assigning correct geographic coordinates to the
coordinate system internally used in PDF files and especially write
the bridge to the outside world (with GDAL/OGR).
I am afraid that authors of the GeoPDF standard would not like this,
as it seems that the idea of GeoPDF is see it in the Acrobat, print
it, but that's all. At least I think so, because they discontinued
their Geopdf2geotiff product and all the conversion tools are just one
way - into GeoPDF. Please correct me...

Anyway, in this moment you can quite easily use utility like
pdfimages to extract full quality image tiles from any GeoPDF (like
those from USGS) and merge it based on their location in PDF into one
GDAL file via VRT (gdalbuildvrt) with a bit of hacking. This is what I
did for my favorite USGS DRG of Grand Canyon ;-).
Look at: http://klokan.mzk.cz/~klokan/geopdf/ - soon I will update the
MapTiler.org overlay examples...

Unfortunately all PDF parsing libraries I know are GPL, and that means
we can't use them for the gdal driver - because of the license issues.
But to create a GPL utility for converting GeoPDF to anything what
GDAL/OGR supports should be OK. Poppler can be the best base of such
GDAL-based utility for reading/rasterizing of the GeoPDF files.

Now just find a sponsor and time to make it ;-).

Best,

Klokan Petr Pridal

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev




___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev