Collaborating in geospatial context since 2000!

Wednesday, August 20, 2008

GeoPDF Round-trip

In previous versions of Map2PDF for ArcGIS there was no way to view the GeoPDF back in ArcGIS. The latest release of this application allows you to do this! We are now able to bring in all the PDF map frames and layers then toggle them on and off just as you would a standard ArcGIS layer. Because it is treated as a standard ArcGIS layer, you can also export the content back out as a GeoPDF. Create GeoPDF --> work with GeoPDF in Reader --> View GeoPDF and annotations back in ArcGIS for further analysis. Sounds kinda like a round trip to me..


The following VBA code is for those hackers out there who already have Map2PDF for ArcGIS version 4.0 and would like to wrap their heads around the GeoPDF View COM Interface. Note that first the “Map2PDF for ArcGIS View” type library must be added to the project from the VBA editor's Tools->Reference command. This Interface will allow the developer to control view state, annotations, scale, etc...

Cheers!

Labels: , ,

Thursday, July 17, 2008

ERDAS Image Web Server

Do you own large amounts of raster data? The ERDAS Image Web Server is a COTS solution that easily allows your organization to quickly integrate raster data in to your GIS. ESRI has a similar solution in the ArcGIS Image Server but wouldn't it be more adventageous to manage your raster data through a product whos main focus is the speedy delivery of large volumes of raster data? There are pros and cons to both products I'm sure...for example, both applications provide a way to extend the core functionality. ESRI gives you an API (more than likely through ArcObject programming) while ERDAS gives you the Image Integration Framework. I would be really interested to see a side by side comparison for both!!! NOTE: Leica (now ERDAS) acquired ERMapper last year.

vs.

Labels: , , ,

Monday, June 09, 2008

Map2PDF Software Integration

Can I customize my export to GeoPDF from ArcGIS? Of course you can!!! TerraGo has included a series of COM interfaces and objects which allows each user to customize their workflow. To get more information on this, please check out the compiled help that installs with the software. I included a little VBA routine that anyone can cut and paste in to the VBA compiler that installs with ArcGIS.



Sub ExportToGeoPDF()

' simple sample code presumes a specific, known MXD and uses a hardcoded output name

Dim fileName As String
fileName = "C:\temp\engine_geopdf2.pdf"

Dim pMxDocument As IMxDocument
Set pMxDocument = ThisDocument

Dim pPageLayout As IPageLayout
Set pPageLayout = pMxDocument.PageLayout

Dim pActiveView As IActiveView
Set pActiveView = pPageLayout

Dim pMap As IMap
Set pMap = pMxDocument.Maps.Item(0)
If pMap Is Nothing Then Exit Sub

Dim pLayer As ILayer
Set pLayer = pMap.Layer(0)
If pLayer Is Nothing Then Exit Sub

' cocreate the exporter
Dim pExport As IExport
Set pExport = New ExportGeoPDF
Dim pExport2 As IExportGeoPDF2
Set pExport2 = pExport

Dim pConfig As IGeoPDFConfig
Set pConfig = pExport

' set global options: PDF layering and PDF annotation type
pConfig.Layering = True
Config.Compatibility = geoPDFAnnotType.geoPDFAnnotTypeObjectData

' set the layer to receive PDF annotations
pConfig.PutAnnotate pLayer, True

' the rest is like any other exporter - except that IActiveView.Output is unnecessary

pExport.ExportFileName = fileName
pExport.Resolution = 300

Dim tmpDC As Long
tmpDC = GetDC(0)
Dim screenResolution As Integer
screenResolution = GetDeviceCaps(tmpDC, 88)
ReleaseDC 0, tmpDC

Dim scaleFactor As Double
scaleFactor = pExport.Resolution / screenResolution

Dim exportRECT As tagRECT
With exportRECT
.Left = pActiveView.ExportFrame.Left * scaleFactor
.Top = pActiveView.ExportFrame.Top * scaleFactor
.Right = pActiveView.ExportFrame.Right * scaleFactor
.bottom = pActiveView.ExportFrame.bottom * scaleFactor
End With

Dim pPixelBoundsEnv As IEnvelope
Set pPixelBoundsEnv = New Envelope
pPixelBoundsEnv.PutCoords exportRECT.Left, exportRECT.Top, exportRECT.Right, exportRECT.bottom

pExport.PixelBounds = pPixelBoundsEnv

Dim hdc As Long
hdc = pExport.StartExporting

' the usual call to IActiveView.Output at this point that is required by other exporters is not needed

pExport.FinishExporting
pExport.Cleanup

End Sub


Labels: , ,