vendredi 27 mars 2015

Specifying alternate symbology for print vs screen


Is there a way to specify an alternate symbology for print output in ArcMap (as opposed to what is currently on-screen? I am thinking along the lines of the functionality offered by CSS.


For instance, the on-screen representation of a line might be dashed, but in print it might need to be a double line with a thicker width.


The core issue is that we have users needing to view production layers with overlaid development layers on screen - so a non-standard symbology is helpful here. When design is complete, only the final design layers are printed, but should be represented with the "production" symbology.


Currently using Arc 10.0, but open to solutions requiring other versions and/or scripting.





Problem with geotiff images in geoserver


I'm trying to import a geotiff file in geoserver 2.6.2. Previously, the same image were successfully imported in geoserver 2.2.5. But in 2.6.2, I get the floowing message :



org.geotools.data.DataSourceException
at org.geotools.gce.geotiff.GeoTiffReader.<init>(GeoTiffReader.java:225)
at org.geotools.gce.geotiff.GeoTiffFormat.getReader(GeoTiffFormat.java:287)
...
Caused by: org.geotools.data.DataSourceException
at org.geotools.gce.geotiff.GeoTiffReader.getHRInfo(GeoTiffReader.java:412)
at org.geotools.gce.geotiff.GeoTiffReader.<init>(GeoTiffReader.java:212)


Here is the gdalinfo output for the file :



Driver: GTiff/GeoTIFF
Files: 201503251330_MSG3_RGB321_geotiff-1.tif
Size is 3712, 2868
Coordinate System is:
PROJCS["unnamed",
GEOGCS["WGS_1984",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT[,0.0174532925199433]],
PROJECTION["Mercator_1SP"],
PARAMETER["central_meridian",0],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",2454594.686213],
PARAMETER["false_northing",-9640998.385694999],
UNIT["unknown",1]]
Origin = (0.000000000000000,0.000000000000000)
Pixel Size = (2043.756208000000000,-2038.122442000000100)
Metadata:
AREA_OR_POINT=Area
TIFFTAG_DOCUMENTNAME=D:\2met\PROCES~1\TEMPOU~1\201503251330_MSG3_RGB321_geotiff-1.tif
TIFFTAG_SOFTWARE=@(#)ImageMagick 5.2.3 00/09/01 Q:8 cristy@mystic.es.dupont.com
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 0.0000000, 0.0000000) ( 22d 3' 0.00"W, 65d16'11.99"N)
Lower Left ( 0.000,-5845335.164) ( 22d 3' 0.00"W, 32d25'11.99"N)
Upper Right ( 7586423.044, 0.000) ( 46d 5'59.99"E, 65d16'11.99"N)
Lower Right ( 7586423.044,-5845335.164) ( 46d 5'59.99"E, 32d25'11.99"N)
Center ( 3793211.522,-2922667.582) ( 12d 1'30.00"E, 51d43'56.97"N)
Band 1 Block=3712x1 Type=Byte, ColorInterp=Red
Band 2 Block=3712x1 Type=Byte, ColorInterp=Green
Band 3 Block=3712x1 Type=Byte, ColorInterp=Blue


Thank you in advance for any suggestion to solve this problem.





Adjust hover window size


Is there a way to make hover windows larger? The CartoDB editor gives the option to make the windows larger on click, but not the hover windows.





Export Page Layout to PDF using ESRI add-in with vb.net


Note: This message is cross-posted on geonet (http://ift.tt/1CQvNd2)


I have been trying to convert a vba script to vb.net but I have hit a roadblock and I'm hoping someone can help me figure out the problem. I want to export the Page Layout of my map to a PDF using an add-in button. The roadblock occurs where I define my PDFCreate class. I keep receiving the error message:



"Unable to cast object of type 'CreatePDF_2.PDFCreate' to type ESRI.ArcGIS.Output.IExport".



I suspect the error is in my definition and relationship of the document, active view and page layout. I have looked at examples and tried different definitions and procedures but I have been unable to figure out how to fix the problem.


I am using Visual Studio 2010 Professional and ArcMap 10.2.2


Any assistance will be appreciated.


Code updated on March 27th. The code now works!


Many thanks to artwork21 and Dan Jurgella for their assistance.



Imports ESRI.ArcGIS.Carto
Imports ESRI.ArcGIS.esriSystem
Imports ESRI.ArcGIS.Geometry
Imports ESRI.ArcGIS.Output
Imports System.Windows.Forms
Imports ESRI.ArcGIS.ArcMapUI

Public Class PDFCreation
Inherits ESRI.ArcGIS.Desktop.AddIns.Button

Protected Overrides Sub OnClick()
PDFModule()
End Sub

Protected Overrides Sub OnUpdate()
Enabled = My.ArcMap.Application IsNot Nothing
End Sub

Public Sub PDFModule()
Dim pMxDoc As IMxDocument
Dim pActiveView As IActiveView
Dim pPageLayout As IPageLayout
Dim pExport As IExport
Dim pPixelEnv As IEnvelope
Dim lDPI As Long
Dim tExpRect As tagRECT
Dim hDC As Long
Dim res = 96

pMxDoc = My.ArcMap.Application.Document
pPageLayout = pMxDoc.PageLayout
pActiveView = pPageLayout

pExport = New ESRI.ArcGIS.Output.ExportPDF
pPixelEnv = New Envelope

lDPI = 300
pExport.Resolution = lDPI

tExpRect.left = 0
tExpRect.top = 0
tExpRect.bottom = My.ArcMap.Document.ActiveView.ExportFrame.bottom * (lDPI / res)
tExpRect.right = My.ArcMap.Document.ActiveView.ExportFrame.right * (lDPI / res)

pPixelEnv.PutCoords(tExpRect.left, tExpRect.top, tExpRect.right, tExpRect.bottom)
pExport.PixelBounds = pPixelEnv

Dim pdfName As String = ""
Dim saveFileDialog1 As New SaveFileDialog
saveFileDialog1.Filter = "PDF File|*.pdf"
saveFileDialog1.Title = "Save A PDF File"
saveFileDialog1.FileName = pdfName
saveFileDialog1.ShowDialog()

pExport.ExportFileName = saveFileDialog1.FileName
hDC = pExport.StartExporting
pActiveView.Output(hDC, lDPI, tExpRect, Nothing, Nothing)
pExport.FinishExporting()

MessageBox.Show("Finished Exporting Map")

pExport.Cleanup()

End Sub
End Class


Here is my code incorporating the coding used in the ESRI active page layout pdf export code snippet. I comment out pExportpdf and instead use ExportPDF in Select Case and change pExportpdf.EmbedFonts to pExport.EmbedFonts. I include Dim ExportPDF as String.


When I use this method, I receive the error message:



Implementing class ‘ESRI.ArcGIS.Output.ExportPDFClass’ for interface 'ESRI.ArcGIS.Output.ExportPDF’ cannot be found.




Imports ESRI.ArcGIS.Carto
Imports ESRI.ArcGIS.esriSystem
Imports ESRI.ArcGIS.Geometry
Imports ESRI.ArcGIS.Output
Imports System.Windows.Forms
Imports ESRI.ArcGIS.ArcMapUI

Public Class PDFCreate
Inherits ESRI.ArcGIS.Desktop.AddIns.Button

Public Sub New()

End Sub

Protected Overrides Sub OnClick()

PDFCreatemodule()

End Sub


Protected Overrides Sub OnUpdate()

Enabled = My.ArcMap.Application IsNot Nothing
End Sub

Public Sub PDFCreatemodule()
'
' TODO: Sample code showing how to access button host
'
Dim pMxDoc As IMxDocument
Dim pActiveView As IActiveView
Dim pPageLayout As IPageLayout
Dim pExport As ESRI.ArcGIS.Output.IExport
'Dim pExportpdf As ESRI.ArcGIS.Output.IExportPDF
Dim pPixelEnv As IEnvelope
Dim lDPI As Long
Dim tExpRect As tagRECT
Dim hDC As Long
Dim ExportFormat As String

'pMxApp = Application
pMxDoc = My.ArcMap.Application.Document
pActiveView = pMxDoc.PageLayout
pPageLayout = pMxDoc.PageLayout
pActiveView = pPageLayout

pExport = New PDFCreate
'pExportpdf = pExport

Select Case ExportFormat
Case "PDF"
pExport = New ExportPDF
End Select

pPixelEnv = New Envelope

pExport.ExportFileName = " " & ".pdf"
pExport.Resolution = lDPI

pExport.EmbedFonts = True

pPixelEnv.PutCoords(0, 0, lDPI * PageExtent(pPageLayout).UpperRight.X, _
lDPI * PageExtent(pPageLayout).UpperRight.Y)
pExport.PixelBounds = pPixelEnv

' (device coordinates origin is upper left, ypositive is down)
tExpRect.left = pExport.PixelBounds.LowerLeft.X
tExpRect.bottom = pExport.PixelBounds.UpperRight.Y
tExpRect.right = pExport.PixelBounds.UpperRight.X
tExpRect.top = pExport.PixelBounds.LowerLeft.Y

hDC = pExport.StartExporting
pActiveView.Output(hDC, lDPI, tExpRect, Nothing, Nothing)
System.Windows.Forms.Application.DoEvents()
pExport.FinishExporting()

End Sub

Public Function PageExtent(pPageLayout) As IEnvelope
Dim dWidth As Double, dHeight As Double
pPageLayout.Page.QuerySize(dWidth, dHeight)
Dim pEnv As IEnvelope
pEnv = New Envelope
pEnv.PutCoords(0.0#, 0.0#, dWidth, dHeight)
PageExtent = pEnv
End Function

End Class


This is an error message I am receiving...


enter image description here





Using the phase 1 habitat styles?


I am utilising the phase 1 habitat styles and wanted to show 'mixed scattered trees' which is essentially a layer with two different types of green dot. I cannot figure out how to do this and also have the legend in composer show the two different colours for a single entry?


Any help would be appreciated.





Reset Leaflet map


I'm creating a map like this:



var map_object = new L.Map('map', {
center: [39.8282, -98.5795],
zoom: 5,

});

var sublayers = [];

L.tileLayer('http://ift.tt/1v7mT0j',{
attribution: '&copy; <a href="http://ift.tt/ItuEqj">OpenStreetMap</a> contributors, &copy; <a href="http://ift.tt/1vMtqR2">CartoDB</a>'
}).addTo(map_object);

cartodb.createLayer(map_object,layerSource,options)
.addTo(map_object)
.done(function(layer) {
for (var i = 0; i < layer.getSubLayerCount(); i++) {
sublayers[i] = layer.getSubLayer(i);

}
})


This works great. I'm then changing the zoom and adding circles based on user clicking buttons.


Is there a simple way to get the map back to its original condition (i.e., before all the changes and additions created by user actions)? I'm looking to see if there's something better than removing each layer and rezooming, etc.


I tried to use map.remove and then run all the code above again, but this gives me an error:



Uncaught Error: Map container not found.


Which is referring to this line: var map_object = new L.Map('map', {





How to add new SRS/Projection/WKT to the GDAL database


I'm using GeoServer, OpenLayers(3.0) and the GDAL utilities.


GeoServer has one (or more) SRS/Projections that is/are NOT present in the GDAL database of SRS/Projections.


I can get the well-known text (WKT) for SRS/Projections from Geoserver. For example, EPSG:404000:


LOCAL_CS[“Wildcard 2D cartesian plane in metric unit”, LOCAL_DATUM["Unknown", 0], UNIT["m", 1.0], AXIS["x", EAST], AXIS["y", NORTH], AUTHORITY["EPSG","404000"]]


...the GDAL database of SRS/Projections consists of a bewildering number of csv, prj, and wkt files that installs to %GDAL_INSTALL_HOME%\bin\gdal_data


(apologies for windows-centric path conventions)


...is adding EPSG:404000 just a matter of editing one (or more) of the csvs? If so, which ones? If GDAL.org has documented the procedure, I'm having trouble finding it. Can anyone shed light on this?


Thanks


Jim Pollard