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.





jeudi 26 mars 2015

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 26th. User input for save file option not working. I am trying to design it so that the user will see a windows form and can specify the file path and file name. People will be using the button on a regular basis with the same map and saving to the same folder but with a different layout view. Hence the name needs to be specified at the time of creation. Creating the button this way (instead of using the already available export option) will eliminate 2 extra steps for the users.



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

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

Protected Overrides Sub OnClick()
'
' TODO: Sample code showing how to access button host
'
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
'Dim dr As System.Windows.Forms.DialogResult
saveFileDialog1.ShowDialog()

'If (dr = System.Windows.Forms.DialogResult.OK)
' { string pdfFlFullName = strOutPut.FileName
' pdfFlPath = System.IO.Path.GetDirectoryName(pdfFlFullName)
' }
'Else
' pdfFlPath = @"C:\temp"

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





Dynamic user input model builder


I'm making a costing model. I need to require the user to input unit costs and then the model will multiply the unit cost by number of units. How do I add an input box that has no connection to a layer or table?





Running Select results in error 000210


I'm trying to run SELECT in order to extract specific features under "CLASS_NAME", but continue getting "ERROR 000210: Cannot create output".


I've searched though other questions with the same error but to no avail. http://ift.tt/1NdL9to



from arcpy import env
env.workspace = "C:\input"
arcpy.Select_analysis("oldpoly.shp", "C:\output\newpoly.shp", '"CLASS_NAME" = item1,item2,item3')


Still getting to know Python and learning how to troubleshoot. I appreciate any advice.





Autopopulated combobox value passed to definition query - results won't display on map


I have a dojo combobox that is populated with unique values. The user chooses a value, and the value is passed to a definition query, and the results displayed on the map. I can't get the results to display once the value is chosen from the combobox.


I"m pretty sure I'm not passing the value from the combobox to the definition query correctly, but not exactly sure where it goes wrong.


Here is my code http://ift.tt/1E1bI3E





Best practices - how to create several maps showing different layers but the same area?


I know about the print composer's atlas generation tool, which allows users to create multiple maps that show the same layers/features but different geographical areas.


What I am looking for is a workflow that would optimize the creation and updating of a number of maps (probably around 10, potentially more) that would cover the same area but show different shapefiles/layers and therefore have different titles and slightly different legends.


Right now my proposed workflow is the following:



  1. Load all layers (in the same file)

  2. New print composer

  3. Select layers for Map 1

  4. Add legend, text boxes, title, etc.

  5. Save as template as Map1.qpt

  6. Export as PDF

  7. Repeat steps 3 to 6 for Map 2, 3, etc.


When I need to update the maps I would do the following:



  1. Re-export layers and layer styles as necessary (for layers other than the base map)

  2. Select layers for Map 1

  3. Load print composer

  4. Add Items from Template (Map1.qpt)

  5. Export as PDF

  6. Repeat steps 2 to 5 for Map 2, 3, etc.


What do you think? Would it more efficient to create one QGIS file for each map instead? Whenever I update the maps I have to re-export a number of shapefiles so using duplicate layers and layer groups would not be ideal either--not to mention that it can get pretty confusing.


Thanks for your help!





pgrouting pgr_ksp with large dataset


I have large osm dataset When I execute a pgr_ksp query, it takes +30 minutes


Example: SELECT seq , id1 , id2 , cost FROM pgr_ksp( 'SELECT id, source, target, cost FROM myways', 524356, 1210854, 2, false);


my virtual server has 4 processors and 3GB RAM.


my ways table has 2290470 rows,


The other functions works normally but pgr_ksp not


What is the problem ? or what should I do? Thanks!!!





openlayer extend to google bounds


Could you please help me to convert openlayer extend to google bounds. I want to geocode from address in my map area so i do this :



var epsg4326 = new OpenLayers.Projection("EPSG:4326");
var epsg3943 = new OpenLayers.Projection("EPSG:3943");

var geocoder = new google.maps.Geocoder();
var address = document.getElementById("geocodeAddress").value;
popupGeo.destroy();
//var convertedBounds = map.maxExtent.transform(epsg3943, epsg4326);
var northEast = new OpenLayers.LonLat(map.maxExtent.right,map.maxExtent.top);
var southWest = new OpenLayers.LonLat(map.maxExtent.left, map.maxExtent.bottom);

var convertedNorthEast = new northEast.transform(epsg3943, epsg4326 );
var convertedSouthWest = new southWest.transform(epsg3943, epsg4326 );
//var googleBounds = new google.maps.LatLngBounds(
// new google.maps.LatLng(convertedBounds.bottom, convertedBounds.left),
// new google.maps.LatLng(convertedBounds.top, convertedBounds.right));
var googleBounds = new google.maps.LatLngBounds(convertedSouthWest, convertedNorthEast);
geocoder.geocode({ 'address': address, 'bounds': googleBounds }, function (results, status) {


but i get an error Phi2z no convergence when i try to convert openlayer corners to google epsg4326





GeoServer - Single Image Request - Graphic Label Issues


I posted this on the OSGEO GeoServer Mailing List but received no love, so I'll try here.


I have GS 2.6.0. connected to a PostgreSQL 9.2 DB (PostGIS 2.1). I have an SLD where I am trying use graphic label options to label a bunch of weather conditions throughout 700 cities. I like how GS does not allow labels to conflict, but things are not working well. When I first open my OpenLayers 3 Map, the graphic label (icons) show nicely:


Label Images appear here


All the tiny black dots are cities I am try to overlay weather conditions. As I zoom in, I would expect different areas to be labeled, and when I zoom in ONE level, the graphics are still there.


But, when I zoom in one more level, and all subsequent levels, all the graphic labels disappear: Label Images disappear here


I am using OpenLayers 3.0 and am requesting a single image like this:



var openWeatherMap = new ol.layer.Image({
visible: false,
refresh: true,
extent: mapExtent,
source: new ol.source.ImageWMS({
'crossOrigin':'anonymous',
url: 'http://ift.tt/1E0dyBP',
params: {'LAYERS': 'feed_open_weather_map'},
serverType: 'geoserver'
})


});


I've tried a million combinations of OL3 and SLD options. Some work better than other, but I can't ever get the graphic labels to appear beyond the zoom I mentioned. My SLD looks like this: SLD Sorry for the pastebin. Does anyone know why GeoServer is not labeling with graphic properly?


Update: added getMap request samples. The getMap request that shows the graphic labels is:


http://ift.tt/1HM7ONp


When I put this in the browser, it shows the graphic labels.


The getMap request that does not show the graphic labels is:


http://ift.tt/1NjCi7H


When I put this in the browser, I only get the features (tiny dots) but no graphic labels:


NoLabels





How to add, edit and delete a vector (specifically a point) in Geoserver (using OpenLayer 3)?


I'm new using OpenLayer and Geoserver and I need a little help.


Do you have any example I can see or study? I'd like to add, delete and edit a point within of Geoserver using specifically OpenLayer 3.


Thank you!





Raster calculator - addition


Help!!! What am I doing wrong?


I have generated two rasters from vector layers. They cover the same extent and have the same projection (Irish Transverse Mercator) and cell size (5m x 5m). I have 'reclassified grid values' to ensure that both rasters now have values of only 0 or 10. I have been attempting to add the rasters together in the raster calculator ("NPWS@1"+"CH_Extract@1") and I am expecting to see values of 0, 10 or 20 (where there is overlap between the two original vector datasets). Instead I get an output layer with values of 0 or 9.989990. I have tried every permutation I can think of to fix this and am having no joy.


Thanks for your help in advance.





How can I extract lights data from admiralty S57 data?


I need to get a text string for each light and mark in Admiralty S57 data. Ideall I'd get a lat, long and the characteristics of the light/mark, similar to that shown on charts.


Anyone know how, which software etc?





Adding polygon attribute to a gdb raster


I am working with the gSSURGO soil database which has many tables with data and one raster file. I managed to join the tables to the raster, so now I click on my map and can see all raster attributes.


I also have a polygon layer with property code and would like to add this code as a column to my raster table. I tried to convert the polygon to a raster, but am not able to link both raster tables because I do not have a common field. Then I tried to extract the raster cells using the polygons as a mask, but am again unable to link the remaining records to the polygons.


How can the information on multiple gdb rasters be linked to the data of a polygon layer?





Arcpy reclassify label display issue


I have been looking for about 2 days and I can't seem to figure out or find a work around for the symbology labels after a reclassify when trying to automate maps. I run the following code and it is almost doing exactly what i want it to do. After I change a data source path I run the following 2 lines of code. The layer is set to have the colors i want and the numbers match what should be there. The only issue is the display of the labels for the classification.



arcpy.mapping.UpdateLayer(df, lyr, updateLayer, True)
lyr.symbology.reclassify()


The map is set to have 1 decimal place as is the layer file but after the reclass it is set to 4 significant digits.


enter image description here


Does anyone have any thoughts? This is the one thing i need to fully automate the maps i am working on. It seems crazy that after doing a change path and a reclass that i have to open the mxd reset the layer properties and then update notes that i have generated based on the new classes with the update ranges.


Thanks, Matt





Euclidean distance outside a Polygon (ArcMap)


I got some university coursework to analyse the best potential areas for a residential development project and I'm currently doing multi-criteria evaluation. One of the shapefiles in the dataset given is high voltage power lines, I created a buffer around them of 200m (a recommended safe distance) and want to do a Euclidean Distance around that buffer closer being better because of cheaper land value.


Is there a way I can do Euclidean Distance going away from that buffer and not within it?


Should I standardise it, change it into points delete points within buffer then change it back? Seems a bit complex. Please say there's an easier way.


Please forgive me if this is simple my degree isn't GIS!





Is it possible to disable Infowindow in cartodb editor, not in cartodb.js?


I am using cartodb Editor( to create maps, is it possible to disable the infowindow? I've found a few things for cartodb.js, but can't seem to figure out how to do this in the Editor on their website.


Or perhaps something like this? but within the editor itself?





leaflet change marker color on mouseover


I'm trying to add an effect to a marker icon so that it changes color when a user mouses over it. I'm having trouble and was wondering if anyone has added any mouseover effects to marker icon. Thanks, Tyler





Count roads crossing borders


I am looking for a way to count the number of roads crossing a national border in Europe. If possible, I would also like to decompose this result between regions (NUTS2 European regions). I am looking for a simple way to do it.


Thanking you in advance for your help,


Julien





Add point button missing from CartoDB?


I'm trying to add a point to a map that already has points (table imported from a public source). However I do not have the 'button' on the right hand side in my 'map view' to be able to add in my new point. Any reason why this button might be absent?


I'm using CartoDB.





Deegree installation / getting started


I've just tried to set up Deegree on the server with Tomcat7 servlet by copying the WAR file to the webapps folder as described in the documentation. So now I can use the interface on the port localhost:8080/deegree-webservices-3.3.14. It is also indicated on the interface that the working directory is /usr/share/tomcat7/.deegree. However, when I try to set the pw or load a workspace, I got the error notification that this folder doen't exist. Seemingly, no folder has been set anywhere on the server.


Should I do anything else to install Deegree properly?


Thank you for your answers in advance!





Tool, API of or code samples for calculating spatial similarity between Lines


I migrating a database with a road network to an other external data provider. We have joined our own data about roadworks, temporary speed-limits etc. using ID en Linear referencing on this data. So i needs to find the same segment in the newer dataset and its ID to migrate the data.


Their are small spatial differences no matching attributes between these to datasets. So can't use a regular spatial join. Parallel streets close to each other make using buffers a problem


I looking for a way to find the similarity between Lines, similar to fuzzy string searching with text. This i can find the most matching line, and add the new ID and recalculate the lengths in our tables.


Is their a tool, API or codesamples (I prefer python, JavaScript or PostGIS-SQL) that show how to do this?





How to populate a table with geom line?


I have the coordinates of a lot of points in a table. In pgadmin I want to make a line that passes on these points. I already have my Coordinate point im my table. I want to make line with those cooirdinate point that already have in my table. In the same table I want to INSERT geom line in the geom geometry column enter image description here


Description of the table: ID,X,Y, description column, length, description column. I want to make the line that passes on this point.


I have done this query:



SELECT AddGeometryColumn('MyTable', 'geom', 32634, 'LINESTRING', 2);
UPDATE "MyTable"
SET geom = ST_SetSRID(ST_MakeLINE((ST_MakePOINT1("X", "Y"), ST_MakePOINT2("X", "Y")), 32634));


but it doesn't work. Can anyone help me please?





Is there and xyz basemap catalog anywhere


I've been using cartodb odyssey.js for a couple of months and the http://ift.tt/1OAEJGs{x}&y={y}&z={z} XYZ basemap has sufficed so far. However, I'm working on a location that doesn't seem to be covered beyond zoom 13 and the resolution is not good at zoom 13.


Is there a list of possible alternatives out there. The current Google Earth data is super high resolution but I can't find it as a basemap. I've also tried the Nokia Day option but the area I'm looking at is cloud covered.


Any advice appreciated.





working with kmls


I have been working with kml files. I'm using ArcGIS 10.0 and use the option "Map to Layer" from "conversion Tools" in "Arc Toolbox". Problem: I have two layers, say Districts and Constituencies, which overlap at places. I have given different boundaries of different widths, but after export it shows only one boundary (at places where they overlap). I tried applying dashed boundary to one of the layers (upper) but it still did not work.


It works good in Arc but any suggestions how can I make both boundaries look prominent in kml. For Example:


enter image description here


OR


enter image description here





calculate miles from shapelength field in flexviewer pop-up


I am trying to calculate miles in a pop-up window from the shape_length field in ArcGIS Viewer for flex.





QGIS 2.6 filterByMap


I have this project file:



<!DOCTYPE qgis PUBLIC 'http://ift.tt/1sHLDMf' 'SYSTEM'>
<qgis projectname="" version="2.6.0-Brighton">
<title>""</title>
<properties>
<Legend>
<filterByMap type="bool">true</filterByMap>
</Legend>
</properties>
</qgis>


Can i set this property in a python plugin using



QgsProject.instance().writeEntry(""...)


If so, how are the arguments?





Get Raster Values from a Polygon Overlay in ArcGIS


I have the same problem as Curlew in Get Raster Values from a Polygon Overlay in Opensource GIS Solutions and thecrashlandingdodo in Step-by-step: How do I extract Raster values from Polygon overlay with Q-GIS or R?. Curlew says it's rather easily done in ArcGIS, but I just don't know how and R is on my to-learn list.


I have many polygons in a shapefile and a raster with different values. I would like to know for each polygon how many percent each raster value has in that polygon. Any of the zonal stats does not seem to do this (or did I miss something?).


Any help would be appreciated.





ArcGIS JS API: parse GP Service messages


I am working on a JS app where the user draws a polygon and then a python-based GP Service task queries the parcels and generates mailing labels. The GP task works great, but once the PDF is created I need to open the hyperlink in a new tab.


What I really need to get at is the return of my Python function:



# as a trivial example:
def myFunc(*args):
# do something
return output_url # this is what I want to access!


So in my gp task, the function is returning the hyperlink url needed to download the report. I do not think there is an out of the box way to get the gp result. So the other thing I am thinking is to parse the messages returned from the GP Service. I have looked through the help docs and do not see a sample how to get at the messages. I'm new the JS development, so it's probably there and I'm just missing it. Any help would be appreciated.


My call to the gp task:



var gp = new Geoprocessor("http://ift.tt/1FGDrXV");

function OpenInNewTab(url) {
var win = window.open(url, '_blank');
win.focus();
};

var gpParams = {
"Boundary": fs,
"Site": "Paynesville",
"Mailing_Type": "taxpayer"
};
gp.execute(gpParams);
var URL = ""; #need to get this from result OR parse messages

gp.on("execute-complete", OpenInNewTab(URL));


And here is an example of the JSON from the GP service messages:



{
"results": [

],
"messages": [
{
"type": "esriJobMessageTypeInformative",
"description": "Executing (MailingLabels): MailingLabels \"Feature Set\" Paynesville taxpayer"
},
{
"type": "esriJobMessageTypeInformative",
"description": "Start Time: Wed Mar 25 11:29:45 2015"
},
{
"type": "esriJobMessageTypeInformative",
"description": "Executing (MailingLabels): MailingLabels \"Feature Set\" Paynesville taxpayer"
},
{
"type": "esriJobMessageTypeInformative",
"description": "Start Time: Wed Mar 25 11:29:45 2015"
},
{
"type": "esriJobMessageTypeInformative",
"description": "Running script MailingLabels..."
},
{
"type": "esriJobMessageTypeInformative",
"description": "Creating labels in Avery 5160 format"
},
{
"type": "esriJobMessageTypeInformative",
"description": "\nCreated \\\\arcserver2\\wwwroot\\TempFiles\\MailingLabels_taxpayer20150325112946.pdf\n"
},
{
"type": "esriJobMessageTypeInformative",
"description": "http://ift.tt/1FGDrXX"
},
{
"type": "esriJobMessageTypeInformative",
"description": "Completed script MailingLabels..."
},
{
"type": "esriJobMessageTypeInformative",
"description": "Succeeded at Wed Mar 25 11:29:47 2015 (Elapsed Time: 1.85 seconds)"
},
{
"type": "esriJobMessageTypeInformative",
"description": "Succeeded at Wed Mar 25 11:29:47 2015 (Elapsed Time: 1.85 seconds)"
}
]
}


There is nothing in the "results", so since I am actually printing out the URL needed in the messages, I'm thinking I can parse these somehow. So my questions are:




  1. Is there a way I can get the return URL from my Python function back as a result from the GP Service?




  2. If the answer to number 1 is no, how do I get at the result messages and step through them? This is a Synchronous task so I am using the execute() method.







QGIS plugin saving layerstyle


I try to use


Error = ""


vLayer.saveStyleToDatabase ("styleName", "description", True, "", Error)


in a python-plugin for QGIS 2.6


to save the data but have no success.


No error is written. First of all , where the table should be? I think, in the datasource-db (sqlite) But i can't find anything.


Any Help?





How to create a relationship class between a feature layer and a standalone table


I need to create a join between a shapefile and a table that have been added to the map, the issue seems to be with the



memRelFact.Open("Table-Layer", (IObjectClass)fromTable, "TableFieldName"
+ featureClass, "FeatureClassFieldName", "FeatureClassName", "TableName"
+ esriRelCardinality.esriRelCardinalityOneToOne);


I can't figure out how to fix the issue, the error message is 'no overload method for 'Open' takes 6 arguments' here is the entire class code:



public void JoinTables()
{
//Define the feature class
IMxDocument mxDoc;
IMap map;
IFeatureLayer featureLayer;
IFeatureClass featureClass;
mxDoc = (IMxDocument)ArcMap.Application.Document;
map = mxDoc.FocusMap;
featureLayer = (IFeatureLayer)mxDoc.FocusMap.Layer[0];
featureClass = featureLayer.FeatureClass;

//Define the table to be joined
IStandaloneTableCollection tabCollection;
IStandaloneTable stTable;
ITable fromTable;
tabCollection = (IStandaloneTableCollection)map;
stTable = tabCollection.StandaloneTable[0];//census
fromTable = stTable.Table;

//Join the table to the feature class
IMemoryRelationshipClassFactory memRelFact;
IRelationshipClass relClass;
IDisplayRelationshipClass dispRC;
// Create a memory relationship class
// Cardinality is forward (origin to destination)
// Options are: OneToOne, OneToMany, ManyToMany
memRelFact = new MemoryRelationshipClassFactory();
relClass = memRelFact.Open("Table-Layer", (IObjectClass)fromTable, "TableFieldName"
+ featureClass, "FeatureClassFieldName", "FeatureClassName", "TableName"
+ esriRelCardinality.esriRelCardinalityOneToOne);
// Perform a join
dispRC = (IDisplayRelationshipClass)featureLayer;
dispRC.DisplayRelationshipClass(relClass, esriJoinType.esriLeftOuterJoin);
}




OL3: GeoJSON vector layer labels are not fixed in respect to WMS layers


I have three layers on my map. 2 are from WMS service (ortofoto and green linestrings) and one is Vector layer (points - yellow labels) with GeoJSON source:



OL3Source = new ol.source.GeoJSON({
//SRID: 102067
'url': mapp['maprouter']+'?act=get_layer_data&layer='+layer_id+url_params
});


The geoJson looks like this (there are 3 times 2 same points - its an issiue in our DB):



{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-642906.776502149,-1040547.16261086]},"properties":{"feature_data_getter_route":"get_cf_data_overview","feature_data_container":"popup","layer_id":"celni_fotky.overview","id":2}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-647061.5440096,-1036457.97874901]},"properties":{"feature_data_getter_route":"get_cf_data_overview","feature_data_container":"popup","layer_id":"celni_fotky.overview","id":1}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-642906.776502149,-1040547.16261086]},"properties":{"feature_data_getter_route":"get_cf_data_overview","feature_data_container":"popup","layer_id":"celni_fotky.overview","id":7}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-647061.5440096,-1036457.97874901]},"properties":{"feature_data_getter_route":"get_cf_data_overview","feature_data_container":"popup","layer_id":"celni_fotky.overview","id":6}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-642906.776502149,-1040547.16261086]},"properties":{"feature_data_getter_route":"get_cf_data_overview","feature_data_container":"popup","layer_id":"celni_fotky.overview","id":12}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-647061.5440096,-1036457.97874901]},"properties":{"feature_data_getter_route":"get_cf_data_overview","feature_data_container":"popup","layer_id":"celni_fotky.overview","id":11}}]}


The label is set as follows:



OL3Layer = new ol.layer.Vector({
source: OL3Source,
visible: true,
style: styles.get(layer_id)
});


where



new ol.style.Style({
image: new ol.style.Icon(({
anchor: [0.5, 1.5],
anchorXUnits: 'fraction',
anchorYUnits: 'fraction',
src: 'images/map/photo-marker.png'
}))
});


an the view is set like this:



view: new ol.View({
center: ol.extent.getCenter(mapp['CR_feataure'].getGeometry().getExtent()),
zoom: 8,
projection: ol.proj.get('EPSG:102067')
})


the projection is enabled like this:



proj4.defs("EPSG:102067", "+proj=krovak +lat_0=49.5 +lon_0=24.83333333333333 +alpha=0 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=570.8,85.7,462.8,4.998,1.587,5.261,3.56 +units=m +no_defs");


The projections are all EPSG: 102067. WMS is provided by Mapserver. Coordinates for the vector layer are converted on geometry from lat/lon using the following query:



UPDATE cf_metadata SET geom = ST_Transform(ST_SetSRID(ST_MakePoint(degrees(lon),degrees(lat)), 4326),102067);


The problem is that wnen I zoom in or out the map. The WMS layers stas fixed in relation to echa other but the vector labels are not fixed at the point and are gently sliding away from their position.


Zoomed out:


http://ift.tt/1N549uf


Zoomed in:


http://ift.tt/1HA5KI5


Do you have any idea how to fix this?





View feature space for multi-band files


I am trying to plot a feature space (scatter plot) for some SPOT images in QGIS 2.8.1. I know a histogram is available in the file properties, but I want to plot eg. Band 1 vs Band 2 to see the feature space.


The SCP plug-in has a function which only shows the scatter plot for the created ROI. What I am looking for is to show a scatter plot (feature space) of two full bands. And if possible, also show my ROI or signatures in the full scatter plot.


I am evaluating QGIS for GIS and RS introduction for our students. We consider the feature space as an important tool for the students to understand which landscape elements the different bands are good at identifying.


In ERDAS it would look something like this: enter image description here





Export map and mailing data via a console application in VB.NET?


Problem: A client saw a JavasScript demo and would like some of its functionality replicated in VB.NET. I don't understand how the JavaScript demo works nor how to convert it to VB.NET. I have also never used ArcGIS before so this is all new territory and is overwhelming. Any guidance and/or code examples would be greatly appreciated.


Outline: Provided a parcel#/address and a given distance range (e.g. 500ft) can an export be generated that has a map and mailing addresses in VB.NET.


Additional Details:



  • Input1: Parcel# or Address

  • Input2: Impact area eg. 500ft)

  • Output1: PDF Map with Parcel#/Address selected (darker boarder?) and the impact range visable (outlined?)

  • Output2: Mailing list including Parcel#/Addresses within the impact area in Word document

  • JavaScript Demo: http://ift.tt/1EXFK5X


Attempting to accomplish in a VB.NET console application so it can run in the background or on a server so as not to be visible to the user when the outputs are created.





Alter Fields in multiple feature classes in multiple workspaces


Noob python guy here.


So I have 22 geodatabases all in one folder. Each gdb has two feature classes. For each feature class, I need to rename a few of the fields. I've had success with this code, but it only works for each GDB at a time:



import arcpy
from arcpy import env
env.workspace = r'C:\...\filename.GDB'

for fc in arcpy.ListFeatureClasses('*'):
try:
arcpy.AlterField_management(fc, 'ADDR_SN', 'STREET_NAME', 'STREET_NAME')
except:
pass


As I said, that code is just for one GDB at a time, so I'd have to change the name in env.workspace each time. That's not a big deal, I just want to see if it's possible to iterate through every GDB in the folder. So I tried adding into the code:



for workspace in arcpy.ListWorkspaces('*', 'All'):


When I add the above code, I also change the env.workspace to the folder name that contains all the geodatabases, but nothing happens. No error is returned, nothing happens. Thanks for your help!





how can add some points in openlayers using text file?


I used a text file including some points in below code, but it just could read the first point!!



<html><body>
<div id="mapdiv"></div>
<script src="http://ift.tt/SKQfnh"></script>
<script>
map = new OpenLayers.Map("mapdiv");
map.addLayer(new OpenLayers.Layer.OSM());

var pois = new OpenLayers.Layer.Text( "My Points",
{ location:"./textfile.txt",
projection: map.displayProjection
});
map.addLayer(pois);

var layer_switcher= new OpenLayers.Control.LayerSwitcher({});
map.addControl(layer_switcher);
var lat = 29.35387;
var lon = 52.43609;
var zoom = 5;

var fromProjection = new OpenLayers.Projection("EPSG:4326"); // Transform from WGS 1984
var toProjection = new OpenLayers.Projection("EPSG:900913"); // to Spherical Mercator Projection
var position = new OpenLayers.LonLat(lon, lat).transform( fromProjection, toProjection);

map.setCenter(position, zoom);
</script>
</body></html>


How can it read all the points in textfile? textfile :



lat lon title description icon iconSize iconOffset
48.9459301 9.6075669 Title One Description one. ./Ol_icon_blue_example.png 24,24 0,-24
53.9899851 35.5382032 Title Two Description two. ./Ol_icon_red_example.png 16,16 -8,-8




CartoDB/Leaflet bring layer to front


I've got 2 layers being rendered separately with this:



var layerSource = {
user_name: 'jonmrich',
type: 'cartodb',
sublayers: [{
sql: "SELECT * FROM " + carto_table + " WHERE type = 'red_blank'",
cartocss: '#location_fusion_table {marker-file: url(http://ift.tt/1ycmMDC);marker-width:25;marker-allow-overlap: true;}'
}, {
sql: "SELECT * FROM " + carto_table + " WHERE type = 'small_blue'",
cartocss: '#location_fusion_table {marker-fill:#1d5492;marker-width:5;marker-line-width: 0.5;marker-line-color:#fff;marker-allow-overlap: true;}'
}]
};


and later:



cartodb.createLayer(map_object, layerSource, options)
.addTo(map_object)


Here's what ends up happening:


enter image description here


What I'd like to have is where the red pins ALWAYS show on top of the blue circles. If I turn overlap to false, I lose a lot of detail, but the blue circles aren't on top of my red pins. Is there some sort of "z-index" or "bring to front" that I can employ here?





Deleting rows on dbf table with python for ModelBuilder?


Being not very familiar with python, and after carrying out unfruitful long researches on internet, I submit to you my problem, hoping favorable reply.


I have a DBF table with geochemical data and I would like writing a script to be integrated in a wider model built with ModelBuilder, and that automatically delete some specific rows, precisely (please see attached example) the rows 1, 2, 4, 5 and 6, while the row 3 (Analyte symbol) is maintained. This is first.


Secondly, I would like to automatically fill in some empty cells in some coloumns (e.g., A, B, C) with the caracter 0 (zero). Could you please show me the way?


Example





Analysing and Working with a Bilateral Matrix Table in a GIS


I have a bilateral matrix table of global remittances for year 2012 from World bank where the columns contain remittance-sending country and row is the Remittance-receiving country. I want to map sending and receiving countries and the volume of money and this means cleaning up the data to geocode each location to plot origin and destination of over 420 countries. I plan to make flow maps and what I have been doing is to manually assign all receiving countries per sending country and then geocode each of this for each row. Am finding this very manual and time consuming, and am wondering if there is a more clever way of doing it. The data can be found on this world bank site below.


http://ift.tt/MOjl0q





ArcMap 10.1 - Can't add grid references on the map


I am trying to add grid references from an excel spread sheet into ArcMap and my problem is that it doesn't display the data (grid reference points). This only happens with some of my excel tables but not with others. I have already displayed data in the same map and in the same format but I don't know why is not adding this particular one. Does anyone know why this happen? Many thanks in advance.





ArcGIS Server WMS URL Syntax Incorrect


Having a strange issue consuming WMS services hosted on ArcGIS Server 10.3.


When the service is cached in ESRI's compact format, the request fails with HTTP 400. In exploded format, it works perfectly. I've tracked down the issue to the CRS parameter. For example:


`http://ift.tt/1902XsR...'


will fail based on the CRS=CRS:84 parameter. If I change that to CRS=3857, it succeeds. Again, this only happens with compact format. I thought it might have something to do with the BBOX units, but the parameters for exploded are identical and it works.


The service was published as EPSG:3857. For what it's worth, the server was installed as 10.2.2 and upgraded to 10.3. I haven't tested through a fresh install of 10.3 or through an older version, but suspect it wouldn't matter. Have an open ticket with ESRI but have yet to hear back.


I've also tried editing the service's cfg with listCustomCRS and listSupportedCRS to no avail.





Leaflet Geojson Styling


How can external Geojson feeds be styled in leaflet? To add my external feed I'm using the snip below:



var mygeojson = new L.geoJson();
mygeojson.addTo(map);

$.ajax({
dataType: "json",
url: "https://linktomyexternalgeojsonurl",
success: function(data) {
$(data.features).each(function(key, data) {
mygeojson.addData(data);
});
}
}).error(function() {});


The Leaflet website offers examples here http://ift.tt/1cHvWyf but when following the map breaks and does not display any marker. I am clearly doing something wrong and it is likely very simple and obvious to anyone but me.


Leaflet example:



var myStyle = {
"color": "#ff7800",
"weight": 5,
"opacity": 0.65
};

L.geoJson(myLines, {
style: myStyle
}).addTo(map);


My implementation of the Leaflet example:



var myStyle = {
"color": "#ff7800",
"weight": 5,
"opacity": 0.65
};

var mygeojson = new L.geoJson({
style: myStyle})
mygeojson.addTo(map);

$.ajax({
dataType: "json",
url: "https://linktomyexternalgeojsonurl",
success: function(data) {
$(data.features).each(function(key, data) {
mygeojson.addData(data);
});
}
}).error(function() {});




Is it possible to host qgis web application in Oracle weblogic server


I am new to qgis and I want to know whether it possible to host qgis through oracle web logic server instead of apache web server.


Thanks in advance...





change the color of a multispectral Raster Image using Postgre/PostGIS query


Would like to change the color of a multispectral Raster Image. looking for changing band rendering values for Red, green and Blue bands uisng postgre/postGIS query. Please help me.


I have loaded the raster Image into a Table. But wanted to change the colour of bands uisng SQl queries without using QGIS





pgRouting. pgr_ksp() returns -1 as id3


The documentation (http://ift.tt/1Ncc2hi) says that the result should be 0 for the last row. Is the same 0 than -1?


I'm new on this. Thaks for the help.





Is it possible to edit qgis features in the web client by using Qgis server?


I am new to qgis and I am trying to build a application which runs on web by using qgis server Is it possible to edit features or adding feature on web by using Qgis server.


Thanks in advance...





Managing noise in a mosaic raster


I have created a raster with the Mosaic to New Raster tool from 3 separate rasters. However in my mosaic I have some consecutive pixels which seem to be the noise of the previous procedure. Is there any tool or something as to isolate them transfmorming them to No Data?





geoext legendpanel not displaying symbols


I am using geoext 1.1 with openlayers 2.11. I have a few point layers (WFS) with associated styles where I pass an image adress to 'externalGraphic' parameter like this 'http://ift.tt/1EXkAEV'. Works well. My problem is, when I make this parameter dynamic to use features attribute value like that "http://test.pt/images/" + '${cod}" + ".png" the layers symbols display the graphic cool but we cannot see them on legend. You can see an example on attached image. Somenone knows hot to fix that? example


My legendPanel code:



var legendPanel = new GeoExt.LegendPanel({
renderTo: "legenda",
layerStore: mapPanel.layers,
border: false,
filter: function(record) {
return !record.get("layer").isBaseLayer && record.get("layer").hideInLegend != true;
},
defaults: {
style: 'padding:5px',
baseParams: {
FORMAT: 'image/png',
LEGEND_OPTIONS: 'forceLabels:on;fontName=Verdana;fontSize:11'
}
}
});




How do I export a linework layer with an 'altitude' attribute in QGIS to a DXF with lines raised in the z according to their altitude attribute?


I have contours which I have brought into QGIS from a GEOjson - the lines have an attribute of 'altitude'. I want to export these contour lines as a DXF with the lines raised in the zplane according to their 'altitude'. I'm new to Qgis - have heard I can use the 'command line' (Is this the 'commander' under the processing tab?) which suggested org2org?? but I couldn't understand how to use this at all. Any help would be appreciated.





calculating distance between successive csv gps points using java


here is part of code that i tried to execute but it dosent work ... the problem is in latitude2 and longitude i didnt figure out calculate distance between row and row+1 nay help please !!!!



BufferedReader reader = new BufferedReader(new FileReader(file));
try {
/* First line of the data file is the header */
String line = reader.readLine();
System.out.println("Header: " + line);

boolean foundAnyRowHigherThan5 = false;
boolean checker = true;
double currentLongitude = 0;
double currentLatitude = 0;


for (line = reader.readLine(); line != null; line = reader.readLine()) {
if (line.trim().length() > 0) { // skip blank lines
{
if(checker){
String currentTokens[] = line.split("\\,");
String currentName1 = currentTokens[0].trim();
String currentName2 = currentTokens[1].trim();
currentLatitude = Double.parseDouble(currentTokens[2]);
currentLongitude = Double.parseDouble(currentTokens[3]);
checker = false;
continue;
}




String tokens[] = line.split("\\,");
String name1 = tokens[0].trim();
String name2 = tokens[1].trim();
double latitude = Double.parseDouble(tokens[2]);
double longitude = Double.parseDouble(tokens[3]);

double latitude2 = latitude - currentLatitude;
double longitude2 = longitude - currentLongitude;

String speedString = tokens[5].trim();
double dist = Double.parseDouble(tokens[4]);
float speedFloat = Float.parseFloat(speedString);



if(foundAnyRowHigherThan5 || speedFloat > 5.0) {
// a partir de ce point on ajoutera touts les points ,
if(!foundAnyRowHigherThan5) {
foundAnyRowHigherThan5 = true;
}

/* Longitude (= x coord) first ! */
Point point = geometryFactory.createPoint(new Coordinate(longitude, latitude));

featureBuilder.add(point);

double earthRadius = 6371; //kilometers

double dLat = Math.toRadians(latitude-latitude2);
double dLng = Math.toRadians(longitude-longitude2);
double a = Math.sin(dLat/2) * Math.sin(dLat/2) +
Math.cos(Math.toRadians(latitude)) * Math.cos(Math.toRadians(latitude2)) *
Math.sin(dLng/2) * Math.sin(dLng/2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
dist = (double) (earthRadius * c);


featureBuilder.add(name1);
featureBuilder.add(name2);

featureBuilder.add(speedString);
featureBuilder.add(dist);
SimpleFeature feature = featureBuilder.buildFeature(null);

features.add(feature);

currentLatitude = latitude;
currentLongitude = longitude;


}
}
}

}
}
finally {
reader.close();
}




Display number as currency


Is there any way to display a number as currency in the hover window? I'd like the value to read “$5.6 million” rather than “5555555,” for example.





Guessing unknown projection of Webapp


I have a series of points around the greater london area (may be also around 100-200kms away from it) like those here in the format Lon, Lat:



43032.1,32681
95816.5,34473.8
15439.3,-13987


The Application to which those points are transferred uses leaflet but does not use any of EPSG3857, EPSG4326, EPSG3395 from http://ift.tt/RFBUUp unfortunately. At least that's what I found out when using the proj cmdline tool like this:



echo -48884.4 64535.7 | cs2cs -f "%.10f" +init=epsg:3395 +to +init=epsg:4326


I really tried a lot of possible projections and flipped the order but I cannot find a way to get a plausible result which should be something like 51.xxxx -0.1xxxxx


Does someone have any idea on what projection may be used here?





mercredi 25 mars 2015

ArcGIS JS API: parse GP Service messages


I am working on a JS app where the user draws a polygon and then a python-based GP Service task queries the parcels and generates mailing labels. The GP task works great, but once the PDF is created I need to open the hyperlink in a new tab.


What I really need to get at is the return of my Python function:



# as a trivial example:
def myFunc(*args):
# do something
return output_url # this is what I want to access!


So in my gp task, the function is returning the hyperlink url needed to download the report. I do not think there is an out of the box way to get the gp result. So the other thing I am thinking is to parse the messages returned from the GP Service. I have looked through the help docs and do not see a sample how to get at the messages. I'm new the JS development, so it's probably there and I'm just missing it. Any help would be appreciated.


My call to the gp task:



var gp = new Geoprocessor("http://ift.tt/1FGDrXV");

function OpenInNewTab(url) {
var win = window.open(url, '_blank');
win.focus();
};

var gpParams = {
"Boundary": fs,
"Site": "Paynesville",
"Mailing_Type": "taxpayer"
};
gp.execute(gpParams);
var URL = ""; #need to get this from result OR parse messages

gp.on("execute-complete", OpenInNewTab(URL));


And here is an example of the JSON from the GP service messages:



{
"results": [

],
"messages": [
{
"type": "esriJobMessageTypeInformative",
"description": "Executing (MailingLabels): MailingLabels \"Feature Set\" Paynesville taxpayer"
},
{
"type": "esriJobMessageTypeInformative",
"description": "Start Time: Wed Mar 25 11:29:45 2015"
},
{
"type": "esriJobMessageTypeInformative",
"description": "Executing (MailingLabels): MailingLabels \"Feature Set\" Paynesville taxpayer"
},
{
"type": "esriJobMessageTypeInformative",
"description": "Start Time: Wed Mar 25 11:29:45 2015"
},
{
"type": "esriJobMessageTypeInformative",
"description": "Running script MailingLabels..."
},
{
"type": "esriJobMessageTypeInformative",
"description": "Creating labels in Avery 5160 format"
},
{
"type": "esriJobMessageTypeInformative",
"description": "\nCreated \\\\arcserver2\\wwwroot\\TempFiles\\MailingLabels_taxpayer20150325112946.pdf\n"
},
{
"type": "esriJobMessageTypeInformative",
"description": "http://ift.tt/1FGDrXX"
},
{
"type": "esriJobMessageTypeInformative",
"description": "Completed script MailingLabels..."
},
{
"type": "esriJobMessageTypeInformative",
"description": "Succeeded at Wed Mar 25 11:29:47 2015 (Elapsed Time: 1.85 seconds)"
},
{
"type": "esriJobMessageTypeInformative",
"description": "Succeeded at Wed Mar 25 11:29:47 2015 (Elapsed Time: 1.85 seconds)"
}
]
}


There is nothing in the "results", so since I am actually printing out the URL needed in the messages, I'm thinking I can parse these somehow. So my questions are:




  1. Is there a way I can get the return URL from my Python function back as a result from the GP Service?




  2. If the answer to number 1 is no, how do I get at the result messages and step through them? This is a Synchronous task so I am using the execute() method.







LeafletJS Measurement of distance in deepzoom tilelayer


UPDATED INFORMATION:


I have been trying to understand how LeafletJS determines distances between two points in a layer. I am trying to implement the custom scale plugin, (and have done so successfully) on a static tiled image using the leaflet deepzoom tilelayer plugin.


My tiles are 256 x 256 pixels, with the exception being tiles on the outer edges that are sometimes odd measurements (i.e. 86px x 125px or something like that).


Using CRS.Simple, the image zoom is adjusted by powers of 2 by the looks of it:


CRS.Simple seems to operate in powers of 2 'o.CRS.Simple=o.extend({},o.CRS,{projection:o.Projection.LonLat,transformation:new o.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}})


How do I calculate what each pixel / meter is at each zoom level, and how do I input it into Leaflet so that it uses the calculations to show a correct scale bar?





College student struggling with GIS and Raster Files for senior project


I am working for a client and we chose to use OpenGeoSuite as our system. Our client will be flying a plane over farm land capturing images that we need to put in our system. From my understanding those images will be raster files. (.jpeg- just from a camera)


He will also be having GPS locations with each of the images, but in a separate file.


I cant figure out how to convert those raster files so that I can upload them into the system and be able to view them on an interactive map, in the correct spot.


Thank You.





Map Positioning and Routing on Android


I have been instructed to create an small offline application in Android that have to:


a) Use our own map in JPEG format as the basemap (Google Map / OpenStreet Map is not applicable)


b) Show the GPS coordinates from external Bluetooth GPS (Google map services not applicable too!!)


c) Use Spatialite to build network for shortest path calculation


d) Display the route information on top of the JPEG


I am new to the Android application. I am confused wtih:




  1. After converting GPS data from WGS84 to Local coordinate system to Image coordinate system (x,y pixels), any javascript can help to show it on top of the JPEG file by a marker?




  2. Are there any map viewer available for displaying the georeferenced image file?




  3. How to display the route data (Lines) from Spatialite on top of the map?




I found most of the related Android apps make use of Google Map or OpenStreetMap, but none of them make use of the image file for positioning and navigation. I am not clearly understood how can i combine all those of things (JPEG only, Spatialite, GPS data) together, or are there any simple ways to do it?


Many thanks in advance.





Display number as currency


Is there any way to display a number as currency in the hover window? I'd like the value to read “$5.6 million” rather than “5555555,” for example.





ArcGISDynamicMapServiceLayer not refreshing security token


I have a secure service that's secured by arcgis tokens (ArcGIS for Server 10.2.2). When I start my Android application and load the layer, everything's fine:



ArcGISDynamicMapServiceLayer mapServiceLayer = new ArcGISDynamicMapServiceLayer(
mapServiceUrl, null, cred);
getMap().addLayer(mapServiceLayer);


The credentials are entered by the user in a login activity and then kept in memory (I need to be able to generate tokens myself to access a server object extension). Problem is when the token expires, the map just vanishes. I guess it's something to do with the layer not being able to authenticate itself again, but I have no idea why.


I tried playing around with the UserCredentials, only setting username & password, only setting usertoken & tokenserviceurl or setting everything. Nothing helps. Listening to OnStatusChanged of the layer doesn't tell me anything either, it doesn't fire.


I'd be grateful if anybody could tell me what I'm missing.





Running customized script qgis


I want to run a customized script in Qgis (namely that: Ortho Projection produces artifacts).


With export PYTHONPATH=$PYTHONPATH:/PATH_TO_FOLDER I set the pythonpath in the folder where the script is. When I open the python console now in QGis and type import createGlobe I get that message:



Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Applications/http://ift.tt/1yvVSf3", line 478, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named createGlobe


Well, I checked the folder, there is something in there. Even more interestingly, there go a folder and a .pyc document created. enter image description here


When I start the console in my computer and run python in there (not in qgis then) and type in import createGlobe I get a different errromessage:



Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "createGlobe.py", line 8, in <module>
from qgis.core import *
ImportError: No module named qgis.core


Sooo, somehow the python in my console accepts the changed python path while the python in QGis does not. Well, I though I tell python then where to look for qgis.core. I followed these steps here http://ift.tt/1qh1yVv.


After typing export PYTHONPATH=/qgispath/share/qgis/python, starting python again, I do not get this error message ImportError: libqgis_core.so.1.5.0: cannot open shared object file: No such file or directory but the one that There is no module named qgis.core.


Well, I followed the steps further and typed in export LD_LIBRARY_PATH=/qgispath/lib which did not solve the problem. Still no module named qgis.core


Any ideas?!





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.





GPSbabel: how do I define the layout of my input data


I have collected GPS data on a journey by extracting it every second from the $GPRMC NMEA sentence, with each reading saved in the form:



time,latitude,longitude,speed,direction


a typical couple of lines are.



163044,5050.8427,-00049.8211,047.4,107.6
163045,5050.8387,-00049.8012,047.2,106.5


Note: I am using Linux, and a Processing sketch to extract the data and save it in a file made unique by including the date and time of its creation in its name, e.g. posns20150321131751.txt


I intend to plot this as a trace on an OpenStreetMap which requires data in osm format.


This is my Linux command line and error message:



[Harry@localhost]~/Gpsbabel% gpsbabel -i xcsv,style=/home/Harry/Gpsbabel/myidata.style -f /GPStalk/posns20150321131751.txt -o osm ~/GPStalk/posn01.osm
CSV_UTIL : xcsv style "%H%M%S" is missing default.


My style file myidata.style is:



FIELD_DELIMITER COMMA
IFIELD GMT_TIME,"","%H%M%S"
IFIELD LAT_NMEA
IFIELD LON_NMEA
IFIELD IGNORE
IFIELD IGNORE


I find the documentation in the GPSBabel documentation difficult to follow, so my question is, please, where have I gone wrong? In particular, what is wrong with my style file myidata.style?





CartoDB: How to I cluster by features? Is it even possible?


I have a set of points for a number of buildings in NYC. I would like to group those points into clusters per their respective neighborhood (ex: Chelsea, Upper East Side etc.). Each of my points have a designated neighborhood.


Is there a way to tweak the CSS to make it happen? I don't quite understand how the Wizard is currently clustering my points:



/** cluster visualization */

#data{
marker-width: 12;
marker-fill: #FD8D3C;
marker-line-width: 1.5;
marker-fill-opacity: 1;
marker-line-opacity: 1;
marker-line-color: #fff;
marker-allow-overlap: true;

[src = 'bucketE'] {
marker-line-width: 5;
marker-width: 24;
}

[src = 'bucketD'] {
marker-line-width: 5;
marker-width: 34;
}

[src = 'bucketC'] {
marker-line-width: 5;
marker-width: 44;
}

[src = 'bucketB'] {
marker-line-width: 5;
marker-width: 54;
}

[src = 'bucketA'] {
marker-line-width: 5;
marker-width: 64;
}
}

#data::labels {
text-size: 0;
text-fill: #fff;
text-opacity: 0.8;
text-name: [points_count];
text-face-name: 'DejaVu Sans Book';
text-halo-fill: #FFF;
text-halo-radius: 0;

[src = 'bucketE'] {
text-size: 12;
text-halo-radius: 0.5;
}

[src = 'bucketD'] {
text-size: 17;
text-halo-radius: 0.5;
}

[src = 'bucketC'] {
text-size: 22;
text-halo-radius: 0.5;
}

[src = 'bucketB'] {
text-size: 27;
text-halo-radius: 0.5;
}

[src = 'bucketA'] {
text-size: 32;
text-halo-radius: 0.5;
}

text-allow-overlap: true;

[zoom>4]{ text-size: 16; }
[points_count = 1]{ text-size: 0; }
}


Thank you for your help.





Can I plot this "diagram" in matplotlib


I am not sure weather that is the right stackexchange here. I want to grade a diagram like this: http://ift.tt/1Iv8yno


Unfortunately, I have no idea how these diagrams are called and there do not know where to search for an explanation of how they are created.


Does anyone know how they are called? Can they be created in matplotlib?


Thanks!





Export GIS data to interactive report


Hopefully this is a GIS question although it crosses boundaries:


I'm looking into the possibility of creating an all-in-one portable report derived from data compiled in GIS. This would contain a campus map with point data which, when clicked, would take the user to the relevant entry in a table and ideally have an option to open an image.


A software package might be an option. I'm aware of TerraGo (far too expensive) and InstantAtlas (a bit too expensive probably and uses ArcMap) - both of these offer more than I need. I use QGIS on Linux, but can use Windows 7. Some of the related answers on StackExchange are ArcMap-based & my future is not with this.


I wondered about HTML/web tech. Not sure if this can be done as a single file or some other unbreakable setup. Webmapping etc is not an option and I can't see sending the data with a free GIS viewer working, as it needs to be reasonably end user proof.


Can anyone advise any packages to look at, or how (conceptually- I can learn the nuts & bolts) I might achieve this with any of the options above, or anything else? Thank you





ArcGIS JavaScript API - measurement widget doesn't work with other widgets


I am having an issue with the Measurement-Widget in combination to other widgets with the newest ArcGIS API for JavaScript (3.13). With the sandbox, i was able to create a Map which includes HomeButton, LocateButton, Scalebar, OverviewMap and BasemapGallery. All this together works. When i start to add the code of the Measurement-Widget, the other widgets disappear. So i removed some code from the -container and sfs, pacelsLayer, snapManager and layerInfos. With or without it, it doesn't matter. When i comment out this part:



//esriConfig.defaults.io.proxyUrl = "/proxy/";
//esriConfig.defaults.io.alwaysUseProxy = false;
//esriConfig.defaults.geometryService = new GeometryService ("http://ift.tt/1dTevhg");


the other widgets work again, but in the Measurement-Widget the tools are missing.


I tryed also to build the homebutton inside of the following link, it doesn't work. http://ift.tt/1y6Myct


The Search/Geocoder-Widget doesn't work too...but there seems that it have a problem with the BasemapGallery.


I'm out of ideas what i'm doing wrong, so if you have an idea, what i miss or where the code is incorrectly, please let me know it. thanks in advance!



<!DOCTYPE html>
<html>
<head>

<title>Part VII: Measurement-Widget</title>

<link rel="stylesheet" href="http://ift.tt/1FlUKM4">
<link rel="stylesheet" href="http://ift.tt/1AsrwWL">

<style>
html, body, #mapDIV {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}

#HomeButtonDIV {
position: absolute;
top: 95px;
left: 20px;
z-index: 50;
}

#LocateButtonDIV {
position: absolute;
top: 135px;
left: 20px;
z-index: 50;
}

</style>

<script src="http://ift.tt/1FlUKM6"></script>

<script>
var map, home, locate, overviewMapDijit, scalebar, basemapGallery, sfs, parcelsLayer, snapManager, layerInfos, measurement;

require([ "esri/map",
"esri/dijit/HomeButton",
"esri/dijit/LocateButton",
"esri/dijit/OverviewMap",
"esri/dijit/Scalebar",
"esri/dijit/BasemapGallery",
"esri/arcgis/utils",
"dojo/parser",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dijit/TitlePane",

"dojo/dom",
"esri/Color",
"dojo/keys",
"esri/config",
"esri/sniff",
"esri/SnappingManager",
"esri/dijit/Measurement",
"esri/layers/FeatureLayer",
"esri/renderers/SimpleRenderer",
"esri/tasks/GeometryService",
"esri/symbols/SimpleLineSymbol",
"esri/symbols/SimpleFillSymbol",
"dijit/form/CheckBox",

"dojo/domReady!"],
function(Map, HomeButton, LocateButton, OverviewMap, Scalebar, BasemapGallery, arcgisUtils, parser,
dom, Color, keys, esriConfig, has, SnappingManager, Measurement, FeatureLayer, SimpleRenderer,
GeometryService, SimpleLineSymbol, SimpleFillSymbol
) {

map = new Map("mapDIV", { //unsere DIV-ID
basemap: "osm",
center: [13.734875, 51.034163], //laenge, breite
zoom: 18 //zoomstufe
});

parser.parse();

//esriConfig.defaults.io.proxyUrl = "/proxy/";
//esriConfig.defaults.io.alwaysUseProxy = false;
//esriConfig.defaults.geometryService = new GeometryService("http://ift.tt/1dTevhg");


home = new HomeButton({
map: map
}, "HomeButtonDIV");
home.startup();

geoLocate = new LocateButton({
map: map
}, "LocateButtonDIV");
geoLocate.startup();

overviewMapDijit = new OverviewMap({
map: map,
visible: true
});
overviewMapDijit.startup();

scalebar = new Scalebar({
map: map,
scalebarUnit: "dual",
attachTo: "bottom-left"
});

basemapGallery = new BasemapGallery({
showArcGISBasemaps: true,
map: map
}, "basemapGalleryDIV");
basemapGallery.startup();

basemapGallery.on("error", function(msg) {
console.log("basemap gallery error: ", msg);
});

<!-- //sind die konturen der flaechen beim sandboxtest
sfs = new SimpleFillSymbol(
"solid",
new SimpleLineSymbol("solid", new Color([195, 176, 23]), 2),
null
);
//duerfte der Layer fuer die parzellen sein, die mir angezeigt werden bei der sandbox
parcelsLayer = new FeatureLayer("http://ift.tt/1y6MvNO", {
mode: FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]
});
parcelsLayer.setRenderer(new SimpleRenderer(sfs));
map.addLayers([parcelsLayer]);

snapManager = map.enableSnapping({
snapKey: has("mac") ? keys.META : keys.CTRL
});
//keine ahnung wofür das ist
layerInfos = [{
layer: parcelsLayer
}];
snapManager.setLayerInfos(layerInfos); -->


measurement = new Measurement({
map: map
}, dom.byId("measurementDIV"));
measurement.startup();



});
</script>
</head>

<body class="claro">
<div id="mapDIV"></div>
<div id="HomeButtonDIV"></div>
<div id="LocateButtonDIV"></div>

<div style="position:absolute; right:0px; top:252px; z-Index:999;">
<div data-dojo-type="dijit/TitlePane"
data-dojo-props="title:'Switch Basemap', closable:false, open:true">
<div data-dojo-type="dijit/layout/ContentPane" style="width:391px; height:221px; overflow:auto;">
<div id="basemapGalleryDIV"></div>
</div>
</div>
</div>

<div style="position:absolute; right:0px; top:544px; z-Index:999;">
<div id="titlePane" data-dojo-type="dijit/TitlePane" data-dojo-props="title:'Measurement', closable:false, open:true">
<div data-dojo-type="dijit/layout/ContentPane" style="width:391px; height:221px; overflow:auto;">
<div id="measurementDIV"></div>
<span style="font-size:smaller;padding:5px 5px;">Press <b>CTRL</b> to enable snapping.</span>
</div>
</div>
</div>


</body>
</html>