Affichage des articles dont le libellé est Recent Questions - Geographic Information Systems Stack Exchange. Afficher tous les articles
Affichage des articles dont le libellé est Recent Questions - Geographic Information Systems Stack Exchange. Afficher tous les articles

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





Assigning values of points outside a buffer to points within a buffer


I have 10m buffers around line features and a point shapefile which has some points intersecting the buffer. I would like to take each point that falls within the buffer and assign it the value of the point it is closest to outside of the buffer.


Anybody know how to accomplish this? I'm using version 10.1.





extracting the outline of raster imagery using GDAL


Salams I want some help regarding developing a code in GDAL to extract the outline of any raster file or group of raster data in vector format... any ideas please ??





Graphical modeler in QGIS. I can't find a model


I'm a doing a tutorial for QGIS and at one point I have to use 'Join attributes by location' model but I do not find it in the Graphical modeler. Does it have to be there? I have to download it from somewhere?


I am using QGIS 2.8.1.


Any help would be useful. Thx.





ODK Collect GPS Accuracy


Good day. Is it possible to require a minimum accuracy of the GPS widget? I know about accuracy threshold but what I need is to prevent forward swiping/finalization of the form if GPS accuracy is low.





ArcGIS JavaScript API 3.13 error with Measurement setTool() function


When upgrading to 3.13 the following code to disable the measurement tool returns an error:



measurement.setTool("distance", false);


Here is the error:



Uncaught TypeError: Cannot read property 'domNode' of undefined



When I switch back to 3.12 it works fine. I'm thinking it's a bug in 3.13, but wanted to see if anyone else has run across this?





Spatial Join Layer Derived from Zonal Raster on Original Polygon


I'm trying to do a 1:1 spatial join between polygons created from the zonal max of a slope raster on the original zonal features. The problem is that the jagged edges cause the target features to overlap neighboring polygons as well so it just uses the first join feature in the 1:1 join.


Example


So basically, in this picture, I want to use a spatial join to add the grid code 300 from the blue layer to the polygon (red outline) on the right and 100 to the polygon on the left. The overlap from the jagged lines are causing it to assign whichever value is first instead of whichever one has the greatest overlap.





Open/Import CityGML in AutoCAD


I have a CityGML file and want to open and further process it in AutoCAD. Any suggestions for a schmoove workflow?


For my specific use case, I only need the 2D coordinates of the file's <bldg:GroundSurface> elements' <gml:LinearRing><gml:posList>. That is, I'm only interested in the files' X and Y components. Maybe that makes it easier...





how to apply a canvas 'grid' to leaflet without curvature


I'm trying to create a grid of tiles in canvas to represent some data


the original data comes with UK OSEAST1m and OSNORTH1m, i'm the grouping the data up into aggregates of, say 40km (as per the image). I'm then taking the grouped data and and projecting it - from the grid ref to lat/lon using geodesy, and then creating a rectangle in canvas.


It works roughly, but this means that there is a grid, as such, but squares that roughly follow the curvature of the projection.


grid example


How can I make a grid, so that the squares are aligned?





Moving multiple features to snap to nearest edge


I have thousands of long rectangular polygons which I need to align to a specific/nearest edge. The screenshot below demonstrates what I need to achieve:


Yellow and white dotted features need to **maintain original width** (1m) but move and snap to the nearest edge


Yellow and white dotted features need to maintain original width (1m) but move and snap to the nearest edge.


I am working with ArcGIS 10.3.


I have looked at all of the Alignment Tools, but I'm just not clear on the best method. I tried Align to Shape but this adjusts the width of the polygons.


Any clues?





How to reduce Overpass way QL statement output to just tags?


I am new to Overpass API. Ran this query [way(around:10.0,37.559391,-122.301529);out;] in overpass-turbo.eu and getting lot of information about nodes. I just need to know whether it is valid way or not and does not require any other information such as node. Other purpose is not reduce the time taken below 10ms, currently i have local instance of Overpass which is taking more than 300ms. I want to run this query for 1 Millions records per day, it seems it wont be possible with this response time.


Tried with following approaches.



  1. using union queries.

  2. using custom wiki.


Still not able to reduce to response time. Please suggest.





qgis-bin.exe - System Error


I'm running QGIS 2.8 Wien on Windows 8.1. I got this error: "The program can't start because qgis_core.dll is missing from your computer. Try reinstalling the program to fix this problem."


I got the same error last week, uninstalled and reinstalled QGIS and it worked. But there must be a better way to fix the error than reinstalling QGIS every time it bombs out.





Merge multiple geojson-polygons


Lets say I have a very big image With a polygon in it:


enter image description here


I want to polygonize this very big image with gdal polygonize. But the image is too big, so I dont have enough memory to polygonize that properly (I know there are some options but forget them for a while). So I split this image into 4 images (black lines are the borders of each image):


enter image description here


Now I polygonize these 4 images and I obtain 4 GeoJSON-files with 2 polygons each (one bigger white polygon, and one smaller blue polygon). Then I put all polygons into one GeoJSON so that I have a GeoJSON with 8 polygons with it. When I import it in any GIS software it looks like the first picture but when I want to choose the blue polygon, I have to click on all 4 parts. Because in fact the result looks like this (orange = border of polygon)


enter image description here


So I need a way to merge polygons so that neighbour-polygons of the same color get merged to one polygon.


My images are of course a little bit more complex but I had to simplify it to a circle to show the problem





Load a shape file in postgresql DB with php


I am trying to load a shapefile in a postgis database using the exec() command. I have read the format I have to follow from here and I checked several similar questions from the forum.


Based on the above I wrote this script:



$command = 'shp2pgsql -s 2100 -d /home/enomix/www/EsoterikoFinal/Maps/shps/nodes.shp | psql -h localhost -p 5432 -d shapeDb -U postgres -W xxx'; $output = exec($command); print_r($output);



What I want is to load the shape file into a newly created table which is in a database called 'shapeDb'. Every time I load a shape file I want the previous table to be dropped and a new table to be created (that's why I use the -d option). I have defined a full path for my shape file (should I define a relative one like: "shps/nodes"?)


When I run the script I get nothing back as a response although I have a:



ini_set('display_errors', 1);


Its the first time I do something like this. Any idea what I am doing wrong? Thank you.