samedi 28 février 2015

Use raster memory layer from QGIS processing result


I want to apply subsequent QGIS raster processing algorithms in a python script. I want to use memory layers for intermediate calculation results since I am only interested in the end result.


As described in a previous post, for vector layers this works fine when run in the Python console:



processing.runandload("qgis:intersection", layer1, layer2, "memory:myLayerName")


I can access the "memory:myLayerName" for subsequent calculations.


I'd expect a similar syntax for rasters, but I can't get this (or other functions where a raster is created as an output) to work:



processing.runandload("gdalogr:cliprasterbymasklayer", path_to_raster,
path_to_shape, "", False, False, "", "memory:OutputRaster")


I get an "Oooops! The following output layers could not be open" - error. The processing.log file shows:



'INFO|Sun Mar 01 2015 02:20:52|GDAL execution console output|ERROR 1:
TIFFOpen:memory:temp_layer: Permission denied'


When I replace the "memory:OutputRaster" with r"C:/path/to/out/raster.tif" the code runs. What am I doing wrong?





Why is my map zoomed in so ragged compared to what I actually drawed in QGIS


So overall my map looks the same like what I draw in QGIS. The issue is that when I zoom in, in that case 54x then you can see ragged lines.


QGIS enter image description here


Browser enter image description here


That is not what I need. I need high details also by zooming in. So how can I improve that.


One thing I could do is simplyfying the topojson file. But that's not a solution because I need that high quality lines because my map is often used by zooming in.


Also I could smooth the lines a bit. But already tested and still looking bad.


So how can I also by zooming in show max details. How can I tell QGIS to give more details. Or is it something of the projection? I'm using this projection: +proj=eqc +a=190493.11 +lat_ts=0 +lon_0=0 +rf=800 +units=m +no_defs. But I don't think that I can change it without loosing all right?





Analyzing long lat location data to find locations in proximity


I am looking for a tool to analyze location data (long lat values from vehicle GPS available). The goal is to identify locations which are in close proximity (within a circle of 30-60ft) and then average values which are assigned to the different locations. Background is that it should be the same GPS values every time since the vehicle is visiting the same location but due to inaccuracies of the GPS the location slightly varies. I am trying to identify the location data which belongs to the same location. Any suggestions?


PS: First time user, let me know if you need more information.


Adding example data for clarification:



  1. long lat date reading

  2. 32...-81.. 1/19/2015 167

  3. 32...-81.. 1/20/2015 345

  4. 32...-81.. 1/22/2015 556

  5. 32...-81.. 1/25/2015 597

  6. 32...-81.. 1/28/2015 658

  7. 32...-81.. 1/30/2015 298


Is there software available which could group the locations in above example according to proximity (for example group all locations which are within 30-60ft) and then compute the average of the readings?





How to set NULL value by arcpy.da.InsertCursor on date column?


How to set NULL value by arcpy.da.InsertCursor on date column?


I try insert "NULL", None, '', 0



dictIN= [{'field1':"test1",'date1':'01-02-2015','date1':''},\
{'field1':"test2",'date1':'01-02-2015','date1':'01-02-2015'},\
{'field1':"test3",'date1':'','date1':''},\
{'field1':"test4",'date1':'01-02-2015','date1':''}]


def setNULLIf(field):
if field == '':
return None #try NULL,'',0
else: return field

cursor = arcpy.da.InsertCursor(GDB,("field1", "date1", "date2"))
for x in dictIN:
cursor.insertRow((x[field1'], setNULLIf(x['date1']), setNULLIf(x['date2'])))


Is it possible by arcpy.da ? I use ArcGIS 10.2. I try insert data to GDB file.





how to divide a map in square grid using arc GIS


i want to divide a map in square grid using arc GIS. Is it possible. pls. give me reply





QGIS web client installation: this.projectSettings.capability is undefined


I am trying to debug my configuration of QGIS web client.


I have the same problem illustrated here (the GIS-Browser appears but it keeps loading map for the two sample projects ). Yet following the instructions in the same post doesn't solve the problem for me.


The apache log doesn't indicate any error, just warnings



Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.


Yet debugging the page where the maps don't load I get the JS error



TypeError: this.projectSettings.capability is undefined


I can't find any explanation of that.





table name not updating


I enter data view, update the table name in metadata, save it but the table name never changes. Have been having this problem for a couple of weeks now across several different tables.





gdalwarp `-te -5.8 41 10 51.5 -ts 1980 0` not working with mercator?


I was working with native lat/log projection on etopo1:



#donwload:
curl -L -C - 'http://ift.tt/1lObCkR' -o ./ETOPO1.zip
unzip -n ./ETOPO1.zip '*.tif'
#commands:
gdal_translate -projwin -5.8 51.5 10 41 ../data/noaa/ETOPO1_Ice_g_geotiff.tif cropXL.tmp.tif
gdalwarp -of GTiff -s_srs EPSG:4326 -t_srs EPSG:4326 cropXL.tmp.tif reproj.tmp.tif
gdalwarp -te -5.8 41 10 51.5 -ts 1980 0 reproj.tmp.tif resized.tmp.tif


all working fine.


I now wish to work in mercator. Also, I made a tiny change to reproject to mercator -t_srs EPSG:3857, but it doesn't work:



gdal_translate -projwin -5.8 51.5 10 41 ../data/noaa/ETOPO1_Ice_g_geotiff.tif cropXL.tmp.tif
gdalwarp -of GTiff -s_srs EPSG:4326 -t_srs EPSG:3857 cropXL.tmp.tif reproj.tmp.tif
gdalwarp -te -5.8 41 10 51.5 -ts 1980 0 reproj.tmp.tif resized.tmp.tif


The last command runs but resized.tmp.tif is now flat, all black. No error message.


What am I doing wrong ?





ArcGIS Server Only Accessible From Local Machine


I have an ArcGIS server set up. It works, but only when I access the server (or server manager) via a web browser from the server machine itself. I am unable to access the server (using the same url) from another machine (Chrome: "This webpage is not available").


I have a website set up on the same domain (mydomain.edu), which works just fine. I am only having problems with the ArcGIS server (mydomain.edu:port_number/arcgis). Am I attempting to access this website incorrectly? Is there a setting which needs to be changed in order to allow remote access?


The main problem is that I want to be able to publish map services to the server remotely, which I am unable to do at the moment. ArcMap is unable to connect to the server.


Any advice from the gurus?





Converting Elevation Raster to Contours


I am trying to convert multiple elevation raster files into contour lines, but the contour shapefiles all just end up on top of each other on my map. I can't get them to be where they're suppose to be. I would appreciate any help. I'm a gis newbie.





Inline variable substitution in Model Builder using python code


I have an inline variable substiution which I would like to import into my Python script. Is that possible? I am trying to make a parameter within my path.


My path currently is "c:\Users\Jelle\Dropbox". Within Model Builder I can substitute 'Jelle' by using an inline variable subsitution (name) and call it through %name%. I would like to replace "Jelle" with other names but then within a Python script.


I have tried using GetParameterAsText and making the inline variable as a Parameter within Model Builder but I get an empty output: Here is the script which I tried for it:



import arcpy
username = arcpy.GetParameterAsText(0) #this is the inline variable 'name' which I am trying to call
input_table = "C:\\Users\\"+str(username)+"\\Dropbox"


Input_table gives the following return:



"C:\Users\\Dropbox"


Hence the 'username' variable is not returned


I have the feeling I should be using something else other than GetParameterAsText. Could someone help me out here?





How do I use only part of an inline variable substitution string in model builder?


I am using an inline variable substiution to alter a field name. I do this within an iteration model in model builder. The inline variable is the name of the feature class which I use as my input for each iteration. When I am altering the field name I would like to only use the first part of the inline variable. To explain this a bit better, here is the name structure of my feature classes:



  • SA_05_Walk_CBR

  • SA_10_Walk_CBR

  • SA_05_Bike_CBR

  • SA_10_Bike_CBR

  • SA_05_Driv_CBR

  • SA_10_Driv_CBR

  • SA_05_Walk_PJC

  • SA_10_Walk_PJC

  • SA_05_Bike_PJC

  • SA_10_Bike_PJC

  • SA_05_Driv_PJC

  • SA_10_DRIV_PJC

  • etc.


(Note that all feature class names have the exact same amount of characters for each part of the names)


Within my iterator, these feature class names represent my inline variable substitution string (called "count_field" in my model, see picture).


When I use the iterator, I join all the SA_xx_xxxx with a point feature class where I use the last three letters of the feature class name as a wilcard (e.g. _CBR). For my next iteration I do the exact same thing but then using "_PJC" as my new wildcard. These iterations work fine without any problems and it is also the reason why my feature classes need to end with "*_xxx".


Next in my iteration, I alter a certain field name so that they can be differentiated within the table of the feature class. Currently I use this in-line variable subsitution to rename the field (e.g. "SJ_Count_%count_field%"). Also this process works fine. Here is a picture of the alter field window (Please ignore the explanation mark; this picture is pure for a demo):


alter field window


(Please ignore the explanation mark; this picture is pure for a demo)


The thing what I want to do, however,is that it only uses part of the inline variable to alter my field name. The last 4 letters of my inline variable (e.g. "_CBR") can be removed within my new field name. So a field name would be called, for example, "SJ_Count_SA_05_Bike"


I have tried in renaming my field name again but I haven't found a way to remove the last 4 characters through an iteration. Anyone any ideas how I could do this in an efficient way? Using python within the alter field tool does not seem to be an option (as seen from alter field tool window picture). Here is a picture of my model:


join and alter field model through an iteration in model builder





PyQGIS select layer by name, odd behavior in a plugin


I have a plugin with a function (triggered by a button) that selects a specific layer by name, then shows its attribute table. When I close the plugin and open it again, the attribute table pops up twice, and repeating this keeps adding another table popup. What's wrong?


Code:



def showTable(self):
for lyrs in QgsMapLayerRegistry.instance().mapLayers().values():
if lyrs.name() == "TestFeatures":
lyrTest = lyrs
self.iface.showAttributeTable(lyrTest)




QGIS expression: select from


I have a project file with many nested layers and would like to query certain layers without having to click on them first. The expression tool however requires me to select the layer I want to query. Is there a way to do an expression like SELECT FROM 'Layername'="Cities" WHERE "CITY"='New York' AND "Pollution" = 'low'?


I dug around a bit and only found the Expressions+ plugin but that didn't help either.





simple georef not working


I'm trying to georeference a table by administrative region, but none of my rows are referencing. I have the country name (listed as my 'jurisdiction' column) but no dice. I can't figure out what cartodb would be interpreting it as. Any ideas?


thanks,


L


enter image description here





On load event for Leaflet proj4leaflet projected geoJSON layer


Can't find proper event for vector layer like on "load", to be fired when this layer is fuly rendered. I add vector features to a layer in Leaflet using proj4leaflet from JSON object like this



var geojsonLayer = L.Proj.geoJson(features, {
'pointToLayer': function (feature, latlng) {
return L.marker(latlng);
}
}).addTo(map);


And this methid does not work



geojsonLayer.on("load", function () {
console.log(1);
});


I need a loadend or renderend event for this layer. Is there any?





Unable to style features in my layer


I have this vector layer



<!-- OVERLAY WFS LAYER WITH KOMVUS FROM GEOSERVER -->
wfs_layer_komvoi = new OpenLayers.Layer.Vector("Κόμβοι", {
styleMap: myStyles,
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
url: "http://localhost:8080/geoserver/wfs",
featurePrefix: "rural", //workspace from geoserver
featureType: "komvoi_real", //layer name from geoserver
featureNS : "http://ift.tt/1t6n1TB", //namespace from geoserver
//styles: "point"
})
})


And I am trying to add style on the point features but I am facing problems. This is the code I use for the features:



var myStyles = new OpenLayers.StyleMap({
"default": new OpenLayers.Style({

fillColor: "#ffcc66",
strokeColor: "#ff9933",
strokeWidth: 2,
graphicZIndex: 1
}),
"select": new OpenLayers.Style({
fillColor: "#66ccff",
strokeColor: "#3399ff",
graphicZIndex: 2
})
});


What am I missing here?





QGIS - delete column from Attribute table. I use SpatiaLite Layers


I want to delete a column from Attribute table but the function "Delete columns" isn't highlighted. (When I am adding new layers I use New SpatiaLite layer, not Shapefile layer). So I have installed the plugin Table Manager but when I delete a column using this Table Manager the function "Save" isn't highlighted. Only "Save as" is possible. Is there any advise how I could delete a column? Thanks.





QGIS - "select from selection" with python


The expression box has a handy "select from selection" box. Is there a way to emulate this with python? I have the basic expressions down, but can't find a way to do this.





Georeferenced street corners map


I'm sorry but I don't know where to ask this question.


I have to develop a navigation program in my artificial intelligence course. To do it, I need a city map. Probably Barcelona.


I don't which is the format of a map used in navigation systems like Tom Tom or Google maps, but if I want to use graphs, the format could be georeferenced street corners.


Ok. My questions are:



  1. Where could I find city streets data to calculate a route between two locations?

  2. How do you could such kind of maps?


Please, it this is not the right place, tell me where I can ask this question.





How to load "soil types" in QGis?


I want to show soil transmissivity per pixel. Thus, I determine water holding capacity of each pixel (ignored other effective parameters). Respectively, I wonder, What is the soil data format and How can I load soil data in QGis?





QGIS python plugin appends values every time it's started


I've written a small python plugin (using plugin builder as base) to simplify the expression process for a given layer (just a few comboboxes that are used to create a query). The combo box populating is done in the def run(self): part with a simple .addItem loop. However when I close the plugin and reopen it again, the values are added again. So if it's "a, b, c" and I close/open the plugin again, it's "a, b, c, a, b, c" in the box.. can I stop/avoid that? Or should I just wrap it in a case that sets a flag on the first run?





Hydropower Calculation


I have assigned the elevation and the volume flow to each point at a river (with v.to.db and v.what.rast). Now I want to calculate the Elevation difference between each pair of points and then calculate the Hydropower between them by using P=density * Q * delta_h * g. Here you can see an example of my Attribut Table (I know the differences are too small but it is only an example): enter image description here


I dont know how to do this. Is there a way in GRASS or how can I realize that? Thanks in advance.





Doing same calculation on different Raster file


I am doing the work of change all null pixels to a value of -1 in the raster file X with raster calculator by using following syntax: Con(IsNull("X"),-1,"X")


However, I need to do the same work on >200 raster files. Is there any other method so that I can do these works simply?





Problem between files with same coordinate reference system


I have 2 shape-files. The first created with Qgis and the other with R studio(driver=ESRI). When I import them in qgis i see they doesn't "fit". Both have EPSG:4326 - WGS 84. The only difference I have noticed is that the second file from R studio doesn't have .qpj file. I know that whenever QGIS finds a .qpj file it will be used instead of the .prj (http://ift.tt/1Bq42FU). Is there someone who can help me to find if this file is the problem? What I get with EPSG:4326 - WGS 84 for both files is this: enter image description here





ArcGIS JavaScript API JSONP request


I am trying to add featues to esri.layers.FeatureLayer from response of JSONP request with esri.request. Interestingly I have right response and all features are perfectly shown on the map,BUT I get this error dojo.io.script error RequestTimeoutError: Timeout exceeded { message="Timeout exceeded", stack=".cache["dojo/errors/http://crea...cgis.com/3.12/:214:284\n", response={...}, more...} This is my code for requesting features from WFS server and adding them to layer:



var layerDefinition = {
"extent": {
"xmin": 350000,
"ymin": 6370000,
"xmax": 750000,
"ymax": 6630000,
"spatialReference": {
"wkid": 3301
}
},
"fields": [
{
"name": "OBJECTID",
"type": "esriFieldTypeOID"
}
]
};
var featureCollection = {
layerDefinition: layerDefinition
};
var vectorLayer = new esri.layers.FeatureLayer(featureCollection);
map.addLayers([vectorLayer]);
var layerUrl = 'http://ift.tt/1uYMzh9;' +
'version=1.1.0&request=GetFeature&typeName=ermas:testdata_geopnt&' +
'outputFormat=text/javascript&format_options=callback:loadFeatures&maxFeatures=300&' +
'srsname=EPSG:3301&EPSG:3301';
var loadFeatures = function (response) {
for (var i = 0; i < response.features.length; i++) {
var geometry = new esri.geometry.Point(response.features[i].geometry.coordinates[0], response.features[i].geometry.coordinates[1], new esri.SpatialReference({ wkid: 3301 }));
var symbol = new esri.symbol.SimpleMarkerSymbol();
var graphic = new esri.Graphic(geometry, symbol);
vectorLayer.add(graphic)
}
};
window.loadFeatures = loadFeatures;
var layersRequest = esri.request({
url: layerUrl,
callbackParamName: "loadFeatures"
});


and if I try this>



layersRequest.then(
function(response) {
console.log("Success: ");
}, function(error) {
console.log("Error: ");
});


it also prints ERROR.


Ant help to find my mistake??





How to import Esri Raster to IDRISI with NoData value?


I made some point features in ArcDesktop to build training samples to import to IDRISI. I had 7 classes and convert the feature to raster to build the signature in IDRISI. When I import the data to IDRISI it appears with a new class of all pixels that aren't in the 7 classes. How can I import the raster to IDRISI with NoData value on the pixels outside teh 7 classes of my nomenclature?


Thanks,


Christoph





Google Earth and Remote Desktop on LAN graphic card incompatibility


I have a Windows 7 PC with Google Earth installed.


Sometimes I need to connect with Microsoft Remote Desktop from my MacBook Pro to the Windows 7 PC.


If I've Google Earth (Pro or not) already opened on the Windows 7 PC, I can see quite fine the satellite map.


If I start Google Earth (Pro or not) from remote, I get a message about graphic card not supported and after another that suggest me to try using directX. I can reply to use directX or not, but Googe Earth starts without showing me the satellite map in a sort of "compatibility mode", also very slow.


Is there a way to tell Google Earth to use the Windows 7 graphic card driver and not the virtual one?





Import GeoTIFF into MapInfo - why "control points", and how to batch-create TAB files?


OK, so I am largely hostile to commercial software with 'proprietary' formats, but a colleague only knows MapInfo.


I have a bunch of GeoTIFFs (produced by gdal-merge of JPG/JGW-filepair hi-res aerial photographs). By 'a bunch' I mean 20 in total for this job; several hundred, overall for current and pending projects.


These files open without incident in QGIS and ArcGIS: drag'n'drop the file into a workspace, and both suites even detect the idiosyncratic deprecated projection (EPSG 3785 - not my choice) and put the images in the right spot on a map.


So then I try to open the identical file in MapInfo Pro 12.5.


First, forget about drag'n'drop completely. A non-starter. Don't even try: it's like asking a dial-up modem to stream video.


I amend MAPINFOW.PRJ to take account of it ignoring the (deprecated) existence of EPSG 3785, but still the 'Open Table' command (since when is a TIFF a 'table'?) acts as if I'm opening a file with no geodata at all. It wants me to pick three points on each image, type in the co-ordinates manually for each point, and then it will consider my request to add the image.


Do people (those who are not paying with tax funds) actually pay for this software?


OK, so that's not my actual question... my question is more like -


"If MapInfo wants its 'TAB' file in order to perform the rudimentary function of adding a geoTIFF raster layer to a map, how do I go about generating such a file (preferably in a batch)?"


Yeah, the tone of this question is a tad tetchy: to give some context, ask yourself how you would feel wasting a (non-billable) day-and-a-bit trying to work out how to get this done, given that the MapInfo guys can't be bothered including such absolutely basic functionality into their $n-K (per seat per year) suite.





new layer from calculations with fields of other layers in QGIS


I've two layers, both with the same fields: A, V, where A is the shape's area and V a value given by me. I want a new layer with shape created by the intersection of the other layers' shapes and a value given by the calculation: (A1*V1+A2*V2)/(A1+A2). Is there a command to make it automatically? Obviously in reality I have many layers with many shapes, otherwise I made it manually.


enter image description here





Extend/change Leaflet Marker class to put DivIcon markers in another map pane


Leaflet uses different panes for different content. Markers are in the markerPane div and Popups are in the popupPane.


I find the DivIcon class a lot easier to use than the custom layer because of the range of options provided, but I'm missing one piece of functionality.


How can I extend the Marker class so that markers with regular Icons are placed in the markerPane, but markers with DivIcons are placed in the popupPane or in the leaflet-control-container? Or is there a better alternative solution? I realize this will be a lot more flexible in Leaflet 1.0, but I would love to make this work right now :)


basically, this is what I would like to add/change in the Marker class, but I don't know how to to the actual extension of the class.


if (addIcon) { if(this._icon.tagName == "DIV"){ panes.popupPane.appendChild(this._icon); } else{ panes.markerPane.appendChild(this._icon); } }


Any help would be much appreciated!





Where can I get the Cadinput plugin for QGIS


From Stackexchange, I got to know that Cadinput plugin could do this work. I need to create a line feature specifying the desired length and bearing in an open source GIS (Preferably QGIS) as in CAD drawing. This is for the creation of floor plan of a buiding.


Thanks in advance.





Render map tiles with a nominatim psql


I've imported a OSM database using Nominatim's setup.php. It's possibile to use some software to render the tiles using that database, or I have to re-import in a different DB for Mapnik et similia?


Thank you!





Problem with QGIS - Attribute names are shown as _1,_2,_3 ... and Strings are displayed as "NULL"


I have the followings problem: Whenever I look at the attribute table or at the attribute dialog for a shape, the attribute names are shown as _1,_2,_3, ... In the attributes, Strings are generally displayed as "NULL". Numbers are fine. This happens to all shapefiles and it has not been a Problem in the beginning but at some point it startet. I unintalled Qgis several times and reinstalled different versions (2.2,2.6,2.8) from different sources (Ubuntu repositories, QGIS repositories) ... the problem remained. I also uninstalled grass libraries ... the problem remained. I reinstalled QT ... the problem remained. Any suggestion? With that problem, QGIS is hardly usable :(


I'm using Ubuntu 64-bit. The problem startet under version 14.04, but survived an update to 14.10.


Thanks!


p.s.:


In the message window, I found one warning by python:


warning:/usr/lib/python2.7/dist-packages/PyQt4/uic/uiparser.py:890: PendingDeprecationWarning: This method will be removed in future versions. Use 'elem.iter()' or 'list(elem.iter())' instead.


for include in elem.getiterator("include"):


traceback: File "", line 1, in


File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 219, in startPlugin


plugins[packageName] = package.classFactory(iface)


File "/usr/share/qgis/python/plugins/MetaSearch/init.py", line 28, in classFactory


from MetaSearch.plugin import MetaSearchPlugin


File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 478, in _import


mod = _builtin_import(name, globals, locals, fromlist, level)


File "/usr/share/qgis/python/plugins/MetaSearch/plugin.py", line 31, in


from MetaSearch.dialogs.maindialog import MetaSearchDialog


File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 478, in _import


mod = _builtin_import(name, globals, locals, fromlist, level)


File "/usr/share/qgis/python/plugins/MetaSearch/dialogs/maindialog.py", line 49, in


from MetaSearch.dialogs.manageconnectionsdialog import ManageConnectionsDialog


File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 478, in _import


mod = _builtin_import(name, globals, locals, fromlist, level)


File "/usr/share/qgis/python/plugins/MetaSearch/dialogs/manageconnectionsdialog.py", line 39, in


BASE_CLASS = get_ui_class('manageconnectionsdialog.ui')


File "/usr/share/qgis/python/plugins/MetaSearch/util.py", line 59, in get_ui_class


return loadUiType(ui_file_full)[0]


File "/usr/lib/python2.7/dist-packages/PyQt4/uic/init.py", line 210, in loadUiType


winfo = compiler.UICompiler().compileUi(uifile, code_string, from_imports, resource_suffix)


File "/usr/lib/python2.7/dist-packages/PyQt4/uic/Compiler/compiler.py", line 139, in compileUi


w = self.parse(input_stream, resource_suffix)


File "/usr/lib/python2.7/dist-packages/PyQt4/uic/uiparser.py", line 992, in parse


actor(elem)


File "/usr/lib/python2.7/dist-packages/PyQt4/uic/uiparser.py", line 890, in readResources


for include in elem.getiterator("include"):


I don't think that this causes the problem, but I don't know.





vendredi 27 février 2015

How to do a buffer operation for a polygon drawn by the user using python in QGIS


I have a polygon drawn on the map canvas. Now, I want to do buffer for certain distance around that polygon.I can see the below operation in QGIS in which it uses a layer as input parameter instead i want the polygon as an input in the buffer.How should this be accomplished in QGIS using python.



processing.runalg("qgis:fixeddistancebuffer","layer-name-you-need",0.1,10,False,"Path-to-file-to-store")




GeoNetwork not displaying all harvested metadata with Dublin Core schema


I have a GeoServer 2.6 installed with the CSW plugin. I can make a call to GetRecords using the standard ISO19115/19139 schema and see all of the metadata. My main interest here are keywords that I am manually adding to a layer. When I change the output schema to Dublin Core (outputSchema=http://ift.tt/1ikcaic), everything looks good... the keyword values all show up as elements. All other metadata is properly populated... abstract, references, description, type, creator, etc etc.


Using GeoNetwork 2.10.4, I harvest my GeoServer CSW. When I call GetRecords using the ISO schema, everything looks just as it does on GeoServer. All of my metadata is present. However, when I change the output schema to Dublin Core, almost all of the metadata disappears. A single Record element only contains an identifier, date, BoundingBox, and URIs to my WFS and WMS. All of the other metadata has vanished. If I create a brand new metadata record from within GeoNetwork using the Dublin Core template, it shows every dublin core field, regardless if it's populated or not. My request looks like this:



geonetwork/srv/eng/csw?service=CSW&version=2.0.2&request=GetRecords&typeNames=csw:Record&resultType=results&elementSetName=full&outputSchema=http://ift.tt/1AOZ5ED


Does anybody have any idea why the GeoNetwork Dublin Core output schema isn't showing much of the data that does appear in the ISO output schema for my harvested data?





Transparent custom legend with mapbox/leaflet.js


I am building a map with mapbox.js. I have created a custom legend and want to make it partially transparent, but can't figure out the right CSS.


Here is my legend html snippet:



<div id='legend-content' style='display:none;'>
<div class='legend'>
<div class='legend-title'>My title</div>
<div class='legend-title'>My sub-title</div>
</div>
</div>


I can't figure out the right CSS to make it transparent.



.legend .legend-title {
text-align: Center;
margin-bottom: 8px;
font-weight: bold;
font-size: 120%;
color: #ffffff;
}

.legend{
background: rgba(80,80,80,0.3);
}


I have also tried to change the style of the map-legend directly. I don't think that this is a good way to go at it, but I found this obj in the browser dev tools.



.map-legend.wax-legend {
background: rgba(80,80,80,.1);
}


Can anyone help me get this working? My preference is to use the alpha in rgba on the background and leave the text fully opaque.


Thanks!





How to insert the following JSON Data into a table? (I'm using Geoserver)


I'm very frustrated trying to fix the following code. I'm new in this and I'd like a little help here:


First, I have the following code and It works perfectly: I received a JSON Data from Geoserver (sectoresURL) and then, I put it into a DIV. That's all.



<div id="info" style="width: 100%; height: 280px; overflow-y: scroll;"></div>

<script type="text/javascript">
function showResult(sectoresURL) {

$('#info').empty(); // Remove all child in stack.

$.getJSON(sectoresURL, function (json) {
if (sectores.getVisible() && typeof(json.features[0]) != 'undefined') {
$('#info').append('<iframe width="99%" seamless src="' + sectoresURL + '"></iframe>');
}
});
}
</script>


But now, I want to insert all this into a table but I can't do it. At present, I'm showing in the browser like JSON format, but definitely It isn't the idea.


By the way, the JSON Data is:



{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "SectoresComunaCurico.34",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
301138.4332258755,
6110719.0948824
],
[
307975.62819723826,
6117936.350421507
],
[
309421.54950536136,
6117454.401929129
],
[
314529.81321677275,
6117779.869510237
],
[
321315.062045189,
6115168.846100847
],
[
309617.2118206576,
6102890.015916108
],
[
306318.28485806234,
6104246.552389812
],
[
301138.4332258755,
6110719.0948824
]
]
]
},
"geometry_name": "FiguraGeometrica",
"properties": {
"Numero": 19,
"Sector": "Cordillera"
}
}
],
"crs": {
"type": "name",
"properties": {
"name": "urn:ogc:def:crs:EPSG::32319"
}
}
}


I've tried to insert all this in Bootstrap-Table but without success. Also, Is there some way to re-use geoserver template to do it? At the present, I have one but for {'INFO_FORMAT': 'text/html'});


Regards.





TIFF conversion to GRID - alignment issue


I can convert a TIFF (NASS Cropscape) by using Create Raster in my .gdb or Export to other Format. However, all efforts to align the extent to an existing DEM have escaped me!! I have tried Snap Raster, converting the Tiff to Grid and then copy and tried to Clip, as well as trying to manually set the extent in Environments only to have it revert back to its original settings. I am using ArcGis 10.2.2...can anyone give me a helpful hint on what I may doing wrong here? The GCS and PCS are all correct, but the extent is still incorrect!


Thanks in advance!!





Why processing.runalg("gdalogr:rasterize"....) is not creating out files when running in the QGIS 2.6.0 console?


I want to the QGIS python scripting functions to turn to rasterize a point vector using many different dimensions.


Right now my code looks like this:



import processing

RasterPixelSize = (10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0)

for rps in RasterPixelSize:
processing.runalg("gdalogr:rasterize","/home/cparr/Documents/Inuvik /West_Hourglass/spiral.shp","DEPTHCM_AL",None,0,[rps],[rps],0,"/home/cparr/Documents/Inuvik/SpiralToRaster/test.tif")

print "Done"


And in the console I get this message:



execfile(u'/home/cparr/Documents/Inuvik/QgisScripts/rasterize.py'.encode('UTF-8'))
Error: Wrong parameter value: [10.0]
Error: Wrong parameter value: [20.0]
Error: Wrong parameter value: [30.0]
Error: Wrong parameter value: [40.0]
Error: Wrong parameter value: [50.0]
Error: Wrong parameter value: [60.0]
Error: Wrong parameter value: [70.0]
Error: Wrong parameter value: [80.0]
Error: Wrong parameter value: [90.0]
Error: Wrong parameter value: [100.0]
Done


The help for rasterize shows:



processing.alghelp("gdalogr:rasterize")
ALGORITHM: Rasterize (vector to raster)
INPUT <parameters>
FIELD <parameters from INPUT>
WRITEOVER <parameters>
DIMENSIONS <parameters>
WIDTH <parameters>
HEIGHT <parameters>
RTYPE <parameters>
OUTPUT <OutputRaster>


DIMENSIONS(Set output raster size (ignored if above option is checked))
0 - Output size in pixels
1 - Output resolution in map units per pixel
RTYPE(Raster type)
0 - Byte
1 - Int16
2 - UInt16
3 - UInt32
4 - Int32
5 - Float32
6 - Float64
7 - CInt16
8 - CInt32
9 - CFloat32
10 - CFloat64


And I believe my parameters are correct. Does anyone have experience scripting the QGIS processing tools from the python console? Or is there a better approach?


Thank you!



  • Charlie





More efficient way to get the start and the end points of a line (arcpy)?


I am collecting start and end points for a large polyline feature class in a file geodatabase. I am using arcpy, ArcGIS 10.3, Python 2.7.3 64-bit and a 10.3 compressed file geodatabase with just one feature class (and no other objects).


One accesses the geometry properties with the SHAPE@ token which gives access to the geometry of the line (namely firstPoint and lastPoint).



with arcpy.da.SearchCursor(fc, ["OID@", "SHAPE@"],query) as search_cur:
allLinesList = [[row[0],(row[1].firstPoint.X,row[1].firstPoint.Y),
(row[1].lastPoint.X,row[1].lastPoint.Y)]
for row in search_cur]


Reading 1 million line features (note that my lines consist of only two vertices, start and end) takes ca 5 minutes. I have tried using for loop iterating a cursor instead of comprehension and iterating features in chunks of several hundred thousands with no significant difference in time.


Do you know any other faster way to read XY of the start and end points of the lines?





Programmatically get list of adjacent blocks from US Census


I am currently doing a research project right now where I am looking at US Census Data. I am looking at data at the Census Block level and would like to pull a list of adjacent blocks. And by "adjacent blocks", I mean a pair of blocks that touch or share an edge.


Is there any way that I could do this programmatically? Before I was just looking at the maps and writing down all the different pairs that look like they touch.


And if it matters, I have access to ArcGIS 10.2, Google Earth Pro, and any free software.





PyQGIS load dxf file as a vector layer


Can somebody help me with loading a dxf file as a vector layer with PyQGIS?


Is QgsDataSourceURI an option? I've tried it with this code, but it didn't work.



fitxer="/tmp/prova.dxf"
uri = QgsDataSourceURI()
uri.setDatabase(fitxer)
uri.setDataSource('', 'entities', 'OGR_GEOMETRY', "OGR_GEOMETRY='POINT'", 'fid')

layer = QgsVectorLayer(uri.uri(), 'prova', 'ogr')

print 'isValid:', layer.isValid()




Is there anything like OGC Property IN list Filter?


I am converting some CQL filters to OGC, and I'm wondering whether there is something like a propery in list filter in OGC, or the only solution is to combine the PropertyIsEqualTo with an OR filter. I suspect there isn't, but if you have a nicer solution please share.





ESRI internal process fails using data created by ESRI -- suggestions?


We have a complex process where we compute the distance a boat will travel. We then take our waterway rasters, apply any blockages and delays to them, and create the FullCostArray to get the time it takes for a boat to travel with all the delays in place.


Once the raster is set like this we get a CostDistance raster then remap the raster based on distance. The end result is a point on the water with circles around it representing 15, 30, 45, 60, and 90 minutes of travel for that boat.


The last step is to send this segmented raster into a routing that extracts each polygon for each time zone. The problem is that inside ESRI code we get this error for each point: 1:2/27/2015 5:05 PM: Getting the geodataset using raster descriptor 1:2/27/2015 5:05 PM: ConverRasterToPolygon failed with an exception. 1:2/27/2015 5:05 PM: ERROR 010328: Syntax error at or near symbol ,. ERROR 010267: Syntax error in parsing grid expression. 1:2/27/2015 5:05 PM: at ESRI.ArcGIS.GeoAnalyst.RasterConversionOpClass.RasterDataToPolygonFeatureData(IGeoDataset dataset, IWorkspace pWorkspace, String name, Boolean weeding)


The routine is listed below. Has anyone seen this happen and how to I fix this?



private static IPolygon[] GetZonePolygons(IGeoDataset p_pRasterGeoDS, IGPMessages messages, int p_iZoneID)
{
try
{
ServerLogging.WriteToLog( "GPUtilities.GetZonePolygons() was called." );
IPolygon[] pPolygons;
IExtractionOp pExtractionOp = new RasterExtractionOpClass();
IConversionOp pConversionOp = new RasterConversionOpClass();
IRasterDescriptor pRasterDesc = new RasterDescriptorClass();
IQueryFilter pQFilter = new QueryFilterClass();
IRaster pRaster = (IRaster)p_pRasterGeoDS;
IWorkspace workspace = GetInMemoryWorkspace();
pQFilter.WhereClause = "Value = " + p_iZoneID;
pRasterDesc.Create(pRaster, pQFilter, "Value");
IGeoDataset pGeoDS = pExtractionOp.Attribute(pRasterDesc);
IGeoDataset pPolygonGeoDS = pConversionOp.RasterDataToPolygonFeatureData(pGeoDS, workspace, p_iZoneID.ToString(), true);
IFeatureClass pFClass = (IFeatureClass)pPolygonGeoDS;
int featureCount = pFClass.FeatureCount(null);
if (featureCount > 0)
{
pPolygons = new IPolygon[featureCount];
IFeatureCursor pFCursor = pFClass.Search( null, false );
IFeature pFeature = pFCursor.NextFeature( );
int i = 0;
while (pFeature != null)
{
pPolygons[i] = (IPolygon)pFeature.Shape;
pFeature = pFCursor.NextFeature( );
i++;
}
System.Runtime.InteropServices.Marshal.ReleaseComObject( pFCursor );
}
else
{
ServerLogging.WriteToLog( string.Format( "The FeatureCount for zone ID {0} was 0. Returning an empty geometry.", p_iZoneID ) );
pPolygons = new IPolygon[0];
}
return pPolygons;

}
catch (Exception ex)
{
messages.AddError(8662, "An error was encountered druing the process and the process was terminated.");
ServerLogging.WriteToLog( "GetZOnePolygons failed with an exception." );
ServerLogging.WriteToLog(ex.Message);
ServerLogging.WriteToLog(ex.StackTrace);
return new IPolygon[0];
}
}




Can't compile plugin builder plugin in QGIS 2.4 (Windows)


I'm trying to build a basic plugin using plugin builder but I can't even compile it. I tried following a few tutorials and just trying to compile whatever but that always results in the same problem.


Error messages for rcc4.exe and uic4.bin:



"C:\Program Files\QGIS Chugiak\bin\pyrcc4" -o my_plugin.py my_plugin_dialog_base.ui
No resources in resource description.

"C:\Program Files\QGIS Chugiak\bin\pyuic4" -o my_plugin.py my_plugin_dialog_base.ui
ImportError: No module named site


relevant files in the plugin folder:



my_plugin.py
my_plugin_dialog.py
my_plugin_dialog_base.ui
resources.qrc


What's in the /bin folder:



pyrcc4.exe
pyuic4.bat
pyuic4.bat.tmpl


Any idea what's wrong? I'm limited to using whatever's installed with QGIS to compile this, by the way.





vizjson not loading into Odyssey.js


We are anxious to get started with odyssey.js but our vizjson will not load. We have entered the vizjson link from the cartodb.js share option into the markdown but nothing shows up. We have tried multiple visualizations.


From what I can tell the format matches the tutorials exactly so I suspect there may be something wrong with the visualizations we are trying to use.


Any thoughts as to what could be causing the vizjson not to load into Odyssey?



-baseurl: "http://ift.tt/1GyR5cZ}"
-title: "First Map"
-author: "ROCK"
- vizjson: "http://ift.tt/1FZr9d4"




Rotation matrix in the EPSG


I use Proj4j for a WebGIS and I have to create a new ESPG. I try on Qgis to convert coordinates from local system (in Greece) to a world coordinates system. First, I have to do a 2D transformation : 2 translations (Tx ans Ty) and a rotation (Rz) of about 0.58931 radians around the "z axis" (in the plane of the local system) between the local coordinates and the greek coordinates (EGSA87). So I think that the rotation matrix is : [cos(Rz),-sin(Rz);sin(Rz),cos(Rz)] and without the cos and sin I have [0.8313242,-0.5557878;0.5557878,0.8313242] Then, I can reuse the parameters of the EPSG:2100 definition : +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=-199.87,74.79,246.62,0,0,0,0 +units=m +no_defs I think that I can insert the translations (Tx and Ty) in the x_0 and y_0, but I don’t know how to insert the rotation matrix. How can I insert a transformation with a matrix in a new EPSG ? I found on the internet that the “+xform=” command seems good, but I don’t know how to use it. I try : +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=-869388.894 +y_0=-4260031.458 +xform=[0.8313242,-0.5557878,0.5557878,0.8313242] +ellps=GRS80 +towgs84=-199.87,74.79,246.62,0,0,0,0 +units=m +no_defs But apparently it isn’t a good solution … So, do you know how I can use this command in my new EPSG or where I can find the proj4 documentation ?


Thank you.





How to install proj4rb on Ubuntu 14.04?


I am trying to install proj4rb on Ubuntu 14.04. Three methods are provided in the README file, but they all fail.


1. Using gem



$ gem install proj4rb
Building native extensions. This could take a while...
ERROR: Error installing proj4rb:
ERROR: Failed to build gem native extension.

/home/desousa/.rvm/gems/ruby-1.9.2-p290 extconf.rb
checking for proj_api.h... yes
checking for projects.h... yes
checking for pj_init() in -lproj... yes
creating Makefile

make "DESTDIR="
linking shared-object proj4_ruby.so
projrb.o: In function `proj_get_def':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:146: undefined reference to `rb_check_type'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:147: undefined reference to `pj_get_def'
projrb.o: In function `proj_is_geocent':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:135: undefined reference to `rb_check_type'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:136: undefined reference to `pj_is_geocent'
projrb.o: In function `proj_is_latlong':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:124: undefined reference to `rb_check_type'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:125: undefined reference to `pj_is_latlong'
projrb.o: In function `proj_initialize':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:79: undefined reference to `rb_funcall'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:86: undefined reference to `rb_ary_entry'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:87: undefined reference to `rb_string_value_ptr'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:90: undefined reference to `rb_check_type'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:91: undefined reference to `pj_init'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:94: undefined reference to `pj_get_errno_ref'
projrb.o: In function `raise_error':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:35: undefined reference to `rb_funcall'
projrb.o: In function `rb_int2num_inline':
c:\mingw64\mingw64\local\src\proj4rb\ext/c:/mingw64/mingw64/local/ruby/include/ruby-2.1.0/ruby/ruby.h:1286: undefined reference to `rb_int2big'
projrb.o: In function `proj_initialize':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:96: undefined reference to `rb_raise'
projrb.o: In function `proj_free':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:41: undefined reference to `pj_free'
projrb.o: In function `proj_error_message':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:62: undefined reference to `pj_strerrno'
projrb.o: In function `rb_num2long_inline':
c:\mingw64\mingw64\local\src\proj4rb\ext/c:/mingw64/mingw64/local/ruby/include/ruby-2.1.0/ruby/ruby.h:598: undefined reference to `rb_num2long'
projrb.o: In function `proj_error_message':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:62: undefined reference to `pj_strerrno'
projrb.o: In function `proj_forward':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:161: undefined reference to `rb_check_type'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:163: undefined reference to `rb_funcall'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:163: undefined reference to `rb_num2dbl'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:164: undefined reference to `rb_funcall'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:164: undefined reference to `rb_num2dbl'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:165: undefined reference to `pj_fwd'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:167: undefined reference to `pj_get_errno_ref'
projrb.o: In function `raise_error':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:35: undefined reference to `rb_funcall'
projrb.o: In function `proj_forward':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:169: undefined reference to `rb_float_new'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:169: undefined reference to `rb_funcall'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:170: undefined reference to `rb_float_new'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:170: undefined reference to `rb_funcall'
projrb.o: In function `raise_error':
c:\mingw64\mingw64\local\src\proj4rb\ext/c:/mingw64/mingw64/local/ruby/include/ruby-2.1.0/ruby/ruby.h:1286: undefined reference to `rb_int2big'
projrb.o: In function `proj_forward':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:173: undefined reference to `rb_raise'
projrb.o: In function `proj_inverse':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:192: undefined reference to `rb_check_type'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:194: undefined reference to `rb_funcall'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:194: undefined reference to `rb_num2dbl'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:195: undefined reference to `rb_funcall'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:195: undefined reference to `rb_num2dbl'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:196: undefined reference to `pj_inv'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:198: undefined reference to `pj_get_errno_ref'
projrb.o: In function `raise_error':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:35: undefined reference to `rb_funcall'
projrb.o: In function `proj_inverse':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:200: undefined reference to `rb_float_new'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:200: undefined reference to `rb_funcall'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:201: undefined reference to `rb_float_new'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:201: undefined reference to `rb_funcall'
projrb.o: In function `raise_error':
c:\mingw64\mingw64\local\src\proj4rb\ext/c:/mingw64/mingw64/local/ruby/include/ruby-2.1.0/ruby/ruby.h:1286: undefined reference to `rb_int2big'
projrb.o: In function `proj_inverse':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:204: undefined reference to `rb_raise'
projrb.o: In function `proj_transform':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:229: undefined reference to `rb_check_type'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:230: undefined reference to `rb_check_type'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:232: undefined reference to `rb_funcall'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:232: undefined reference to `rb_num2dbl'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:233: undefined reference to `rb_funcall'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:233: undefined reference to `rb_num2dbl'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:236: undefined reference to `rb_respond_to'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:242: undefined reference to `pj_transform'
projrb.o: In function `raise_error':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:35: undefined reference to `rb_funcall'
projrb.o: In function `proj_transform':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:237: undefined reference to `rb_funcall'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:237: undefined reference to `rb_num2dbl'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:244: undefined reference to `rb_float_new'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:244: undefined reference to `rb_funcall'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:245: undefined reference to `rb_float_new'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:245: undefined reference to `rb_funcall'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:247: undefined reference to `rb_respond_to'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:248: undefined reference to `rb_float_new'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:248: undefined reference to `rb_funcall'
projrb.o: In function `raise_error':
c:\mingw64\mingw64\local\src\proj4rb\ext/c:/mingw64/mingw64/local/ruby/include/ruby-2.1.0/ruby/ruby.h:1286: undefined reference to `rb_int2big'
projrb.o: In function `proj_transform':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:252: undefined reference to `rb_raise'
projrb.o: In function `Init_proj4_ruby':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:494: undefined reference to `rb_intern2'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:496: undefined reference to `rb_define_module'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:501: undefined reference to `rb_float_new'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:501: undefined reference to `rb_define_const'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:505: undefined reference to `rb_float_new'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:505: undefined reference to `rb_define_const'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:509: undefined reference to `rb_float_new'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:509: undefined reference to `rb_define_const'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:511: undefined reference to `rb_path2class'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:511: undefined reference to `rb_define_class_under'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:512: undefined reference to `rb_define_singleton_method'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:514: undefined reference to `rb_define_class_under'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:515: undefined reference to `rb_define_alloc_func'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:516: undefined reference to `rb_define_method'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:520: undefined reference to `rb_define_method'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:521: undefined reference to `rb_define_method'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:522: undefined reference to `rb_define_alias'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:523: undefined reference to `rb_define_method'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:524: undefined reference to `rb_define_method'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:525: undefined reference to `rb_define_method'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:493: undefined reference to `rb_intern2'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:492: undefined reference to `rb_intern2'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:491: undefined reference to `rb_intern2'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:490: undefined reference to `rb_intern2'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:489: undefined reference to `rb_intern2'
projrb.o:c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:488: more undefined references to `rb_intern2' follow
projrb.o: In function `proj_get_def':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:147: undefined reference to `rb_str_new_cstr'
projrb.o: In function `proj_alloc':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:50: undefined reference to `rb_data_object_alloc'
projrb.o: In function `proj_error_message':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:64: undefined reference to `rb_str_new_cstr'
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:66: undefined reference to `rb_str_new'
projrb.o: In function `Init_proj4_ruby':
c:\mingw64\mingw64\local\src\proj4rb\ext/projrb.c:526: undefined reference to `rb_define_method'
projrb.o:projrb.c:(.rdata$.refptr.rb_cObject[.refptr.rb_cObject]+0x0): undefined reference to `rb_cObject'
projrb.o:projrb.c:(.rdata$.refptr.rb_eSystemCallError[.refptr.rb_eSystemCallError]+0x0): undefined reference to `rb_eSystemCallError'
collect2: error: ld returned 1 exit status
make: *** [proj4_ruby.so] Error 1

Gem files will remain installed in /home/desousa/.rvm/gems/ruby-1.9.2-p290/gems/proj4rb-1.0.0 for inspection.
Results logged to /home/desousa/.rvm/gems/ruby-1.9.2-p290/extensions/x86_64-linux/1.9.1/proj4rb-1.0.0/gem_make.out


There is an open issue at GitHub with this problem.


2. Using rake



$ cd ~/temp/ruby/proj4rb-1.0.0
$ ls -la
total 56
drwx------ 7 desousa desousa 4096 Feb 24 09:59 .
drwxrwxr-x 3 desousa desousa 4096 Feb 24 10:00 ..
-rw-rw-r-- 1 desousa desousa 1050 Dec 15 04:13 ChangeLog
drwx------ 2 desousa desousa 4096 Feb 24 09:59 data
drwx------ 2 desousa desousa 4096 Feb 24 09:59 example
drwx------ 3 desousa desousa 4096 Feb 24 09:59 ext
-rw-rw-r-- 1 desousa desousa 86 Dec 15 04:13 .gitignore
drwx------ 2 desousa desousa 4096 Feb 24 09:59 lib
-rw-rw-r-- 1 desousa desousa 1130 Dec 15 04:13 MIT-LICENSE
-rw-rw-r-- 1 desousa desousa 1068 Dec 15 04:13 proj4rb.gemspec
-rw-rw-r-- 1 desousa desousa 1020 Dec 15 04:13 Rakefile
-rw-rw-r-- 1 desousa desousa 6211 Dec 15 04:13 README.rdoc
drwx------ 2 desousa desousa 4096 Feb 24 09:59 test

$ rake build --trace
rake aborted!
Don't know how to build task 'build'
/home/desousa/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.3.2/lib/rake/task_manager.rb:62:in `[]'
/home/desousa/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.3.2/lib/rake/application.rb:149:in `invoke_task'
/home/desousa/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/desousa/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
/home/desousa/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
/home/desousa/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
/home/desousa/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
/home/desousa/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
/home/desousa/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/desousa/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/home/desousa/.rvm/gems/ruby-1.9.2-p290/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/home/desousa/.rvm/gems/ruby-1.9.2-p290/bin/rake:23:in `load'
/home/desousa/.rvm/gems/ruby-1.9.2-p290/bin/rake:23:in `<main>'


3. Using make



$ cd ext
$ ruby extconf.rb
checking for proj_api.h... yes
checking for projects.h... yes
checking for pj_init() in -lproj... yes
creating Makefile
$ make
gcc -I. -I/home/desousa/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-linux -I/home/desousa/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/home/desousa/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -DHAVE_PROJ_API_H -DHAVE_PROJECTS_H -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -fPIC -o projrb.o -c projrb.c
In file included from /usr/local/include/projects.h:244:0,
from projrb.c:3:
/usr/include/proj_api.h:61:5: error: unknown type name ‘projCtx_t’
typedef projCtx_t *projCtx;
^
make: *** [projrb.o] Error 1


Update I: I have tried to install proj4rb19, a version specifically targeted for Ruby 1.9. While it compiles correctly, it fails to install.


Update II: I am using RVM, with the following setup:



$ rvm -v
rvm 1.26.10 (manual) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
$ ruby -v
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
$ gem -v
2.4.3




How to get rid of lines within merged poligons?


Sometimes, when I merge polygons there are still some lines showing within them (see screenshot). enter image description here How can I get rid of them? Thanks!


Dani





How to organize database with objects having GPS coordinates (in radians)


I have a huge database of different objects organized in tables. For instance photos in one table and metadata of each photo in other. Most of them have their GPS coordinates in radians stored as a metadata.. this is a requirement. My question is whether it is better to add postgis extension to database and duplicate the coordinates to geotables, or leave it as it is now, without postgis, write some GPS->GoeJSON convertor in PHP and serve GeoJSON objects to OL3. What is the best practice? At this stage I will need to be able to display data over some basemap and display information about them on click, highlight some LineStrings (roads) etc.


Technologies I use: OL3, PHP, PostgreSQL, Mapserver Im newbie to postgis, mapservers and OL3.


THanks for any help!





Identify tool and highlighting behaviour in QGIS 2.6


I have a problem with the identify tool in QGIS 2.6.


Somehow the object highlighting doesn't go off when i click on another object with the identify tool in QGIS.

In earlier versions, when you clicked on object after object, only the last object clicked was highlighted, highlighting on the previous one was turned off. Note- it only happens when i let QGIS auto-open feature attributes form and highlight of an object stays on until i close the form.

Is there a hidden feature somewhere, that i can use to change this behaviour?





display thematic map using openlayers


iam displaying map from mapfile(mapserver) in c# using openlayers mapfile is connected to postgres it is working well but now i want to diaplay thematic map using the postgrs database using openlayers in c# plz tell me the code this is my mapfile


MAP EXTENT 8240841.450745 2400319.900386 9218007.463612 3107183.406947


TRANSPARENT on IMAGETYPE png size 150 500



web
metadata
wms_srs "EPSG:4326 EPSG:900913"
end
end


LAYER CONNECTIONTYPE postgis

CONNECTION "user=postgres password=****** dbname=mpdb port=5432 host=localhost" DATA "geom FROM district using unique gid"



STATUS Default
TYPE polygon


PROJECTION
"init=epsg:900913"
END



labelitem 'district'

class
style

#color 55 230 51
outlinecolor 90 90 90
width 2
end
LABEL
#color 255 255 255
size 2
BACKGROUNDCOLOR 255 201 14
position auto
END
end


END

END





Narrow viewport => not showing map in browser?


I have a webapplication using the arcgis javascript API and it works great. Unfortunately I ran into a small peculiarity:


If the viewport for the map is smaller than 930 pixels it refuses to load my map. I get the zoom in/zoom out button and the scalebar, but the map area stays empty. If I resize my browser slightly and reload the page the map shows.


The annoying in all this is that, as soon as the initial load is complete, I can perfectly resize the map area to 100 pixels or less and it still works. It's just the loading step where it breaks.


I've tested this in the latest firefox, but chrome exhibits the same behavior.


Any ideas/pointers where to look?





Using Python Script to change Pie Chart Symbology


I am trying to change the symbology for Pie chart in ArcGIS.


I have a feature class which is joined to a table and I will like to symbolized as a pie chart. I will be symbolizing it a lot thus I am looking for an automation ways to do this task. Map Layer does not work in this case.


I am very new to Python Scripting and I am wondering if there is there a way to add symbology using Python Script?





extract lake outline in google maps


I have some bathymetric data for a lake, shown here in google maps:



http://ift.tt/1vF79sB



The problem is that the bathymetric data that I have does not include the outline of the lake i.e. the boundaries where the depth = 0. Therefore, when I plot the bathymetric data, the lake appears much smaller than it actually is. Is there anyway that one can obtain information on the lake outline in google maps. For example, it would be great if I could have the latitude and longitude of the entire lake outline. Is this at all possible. I could go around the lake with a cursor in google maps and manually extract the locations, but there must be an easier way?





How to set NULL value by arcpy.da.InsertCursor on date column?


How to set NULL value by arcpy.da.InsertCursor?


I try insert "NULL", None, '', 0


Is it possible by arcpy.da ?





How to sign in agaain at google drive


I already noticed that my (new) Google maps files are not listed anymore on Google Drive. Now I got the message: assign in to Google Drive to continue using it. But how do you do that? (And how do I prevent it stopping again?)





ArcGIS. Coordinates conversion from WGS84 to Stereo70 is not precise


So I want to convert coordinates from WGS84 to Stereo 70 and it is not working precise. For example, I have the coordinates (20.2600, 43.6200) and in Stereo 70 should look like (448469.26,325966.67) but when I convert it, it gives me an error.


My line of code looks like:



Log.e("stereo70", " " + GeometryEngine.project(24.3512, 44.4316, SpatialReference.create(31700)));


Output: 448464.6330154536, 325965.9619150401 Which is about 10m away from the original point.


I have also tried a code provided in the answer:



Point p = new Point(24.3512, 44.4316);
Geometry projectedGeom = GeometryEngine.project(p, SpatialReference.create(SpatialReference.WKID_WGS84), SpatialReference.create(31700), GeographicTransformation.create(15995));
Point projectedP = (Point) projectedGeom;
Log.e("test", "X:" + projectedP.getX() + " Y:" + projectedP.getY());


Output: 448222.593914864 Y:325897.33784212614 Which is an error of about 100m.


How can I fix that?





Extract from a linestring layer, groups of linestrings to a multilinestring objects layer


I've got a linestring layer with thousands of linestrings. I want to extract groups of linestrings to individual multilinestring objects.


In the following picture you can see part of the layer with a lot of linestrings. Each object inside the red circles are composed a many linestrings (different records in the layer) and i want to obtain a layer with one unique multilinestring record for each object in the red circle.


enter image description here


Ok, I assume that i will have to control+select the linestrings that compose one object and do something to convert it to a multinestring record and add it to the new multilinestring layer but i can't see how to do this in QGIS.


I a openned to use a different software if there is not a solution to this in QGIS. I also use AutoCAD Map.


Regards,





PRACH all counters plot not well visualized


Here's the output that Im getting:


Im not sure why it is doing this..


enter image description here


I want it to be more like this


enter image description here


When i try plotting only two counters (two radii): It is giving me this:


enter image description here


I hope it is clearer for you... The code that im using is the same that i posted here: PRACH data mapped right but arcs not on top properly


Also, if i want to sort the percentages by descending order... How can i do that?





Different results in OD Cost Matrix analysis and Route analysis


I am using OD Cost Matrix layer in order to find distances between many origins and destinations points. It works fine, but I want to make sure the results make sense, and since OD Cost Matrix can only produce straight lines (and not true route shapes), I tried to calculate some specific origin-destination pairs using a Network Analyst regular Route layer and compare them to the OD Cost Matrix results.


However, in some of the cases the distances seem to be different between the two methods, even when I use the exact same analysis settings and network restrictions. Sometimes it's only a small gap, but in other cases it's probably a whole different route.


Shouldn't the two tools produce the exact same routes?





jeudi 26 février 2015

measuring bankfull width by distance between points


I have a large set of polygons that represent sections of streams, each of which has a Unique ID. Each of these polygons is made up of a series of left bank points (LB1,LB2,etc.) and right bank points (RB1,RB2,etc.). I need to calculate the average bankfull width (width of polygon) for these streams.


I think something like point distance in arcmap would work, but instead of finding the distance based on nearest point I want to match up LB1 and measure the distance to RB1 and sequentially do this for each set up bank points.


Any ideas?





WFS to Vector Tiles


Is there, by some miracle, an existing piece of software which is able to convert a (3rd party, GeoServer) WFS feed into vector tiles? In a utopian world, this would happen on the fly, but a download/carve/serve model would be ok.


If not, is there some set of libraries or tools which might be cobbled together to achieve this?





QGIS and arcmap compatibility in image georeferencing


I have georeferenced an image in QGIS but when I imported it to arcmap 10.0 it saying "In consistent extent". Any one know how to solve it?





How to draw contour line between certain elevation range?


I have a raster and I want to draw contour lines just between certain elevation range. For example I want to draw contour lines between elevation 700 (m) and 1000 (m) with the interval of 10. So there must be 30 contour lines. I use ArcGIS. Do you have any idea what tool I should use to make it work? Thank you very much.





How to choose a derived attribute as a parameter in FME?


Is it possible to have an FME parameter read attributes from a feature class that has been defined in a previous attribute?


So, in other words, I when selecting the Prompt and Run option, the user chooses a feature class. In the below example, it's a feature class from a geodatabase, but could just as easily be any format. Once they choose the feature class, I want a dropdown to appear showing the list of attributes that are in that feature class.


enter image description here


This would be similar to the functionality in an ArcGIS tool that has a derived parameter.


I was wondering if a python parameter could read the attributes and then return a list for the user to choose.


Is this even possible in FME?





Extent changing in ArcGIS Pro when shapefile added to map which only had basemap?


Using ArcGIS 10.3 for Desktop:


In ArcMap:



  • Open a Blank Map

  • Add Basemap of Imagery (but any basemap will do)

  • Zoom to Australia (but any area will do)

  • Add the countries shapefile from Natural Earth (but any shapefile that covers an area much larger than where the basemap has been zoomed to will do)

  • Notice how the extent does not change which to me is the expected behaviour


In ArcGIS Pro:



  • Create a project using Map.aptx

  • Change the Basemap to Imagery (but any basemap will do)

  • Zoom to Australia (but any area will do)

  • Add the countries shapefile from Natural Earth (but any shapefile that covers an area much larger than where the basemap has been zoomed to will do)

  • Notice how the extent changes to become the extent of the shapefile that was just added


I think the software behaviour observed in the last dot point is a bug, and am wondering if anybody has already reported this and has a bug (NIM) number that can be used to track its resolution?





Current field of view specific legends in QGIS


Is it possible to make QGIS generate a legend that is based only on the field visible in composer? There was a ticket marked as resolved 5months ago with this question but it doesnt divulge the solution! http://ift.tt/1Ew9oAp





Warning message needed when there is no specific layer instead of python error


In my plugin, when I click a button it will call the findTheCityNames function which is attached below and get features if there is a particular layer. What I want is if there is no specific layer in which it is getting features, it should give a warning message "No Valid layer found" instead python error "List object has no attribute getFeatures".



def findTheCityNames(self):
self.dlg.Citycombo.clear()
ct = self.dlg.Statecombo.currentText()
st = "state='"+ct+"'"
exp = QgsExpression(st)
fidAndVal = {}
#QMessageBox.information(self.dlg, "info", st)

layer = self.iface.activeLayer()

iterFeat = layer.getFeatures()

for f in iterFeat:
val = exp.evaluate(f)
if bool(val):
attrs = f.attributes()
idx = layer.fieldNameIndex('name')
cityName = f.attributes()[idx]
fidInt = f.id()
fidAndVal[fidInt] = cityName

for x in fidAndVal.keys():
self.dlg.Citycombo.addItem(fidAndVal[x])




Where can I find the SQL queries for use with OpenStreetMap-Carto?


I found the OpenStreetMap-carto stylesheets (.mssfiles) here. I also found an issue discussing a problem with a SQL query here. Does anyone know where I can find the SQL scripts to build the layers in TileMill? Maybe a TileMill project?





Worldfile incorrect? Puzzler: all resources supplied!


Trying to manually create a worldfile for gif images of surface currents supplied by the navy here. I have QGIS and am decent at using it but the world file tool is failing without error on me (even after recompiling GDAL).


So I have both been manually calculating world files and using this website. Repeatedly, I am coming up with the same numbers, but they can not be correct, at least not in the vertical. The resulting world file places the four corners in the correct spot, but pixels are incorrectly distorted in the vertical, and I believe it is only wrong in the vertical-see image of georeferenced TIF vs world file oriented GIF with Gulf lease areas for reference (those boundaries should not be on the coast). I have gone back to square one and georeferenced the source image several times, checked my calculations, and attempted to track down any copy of Arc I could borrow or a QGIS expert to help get the tool working. I now turn to you all. Can anyone help me generate the correct numbers for this world file? What gets me is that I've been able to correctly do this for other images from the NRL site.... this one is just always slightly off.


enter image description here


Current (almost correct but at least line 4 is wrong) world file:

1) 0.02271210592255126

2) 0.00000

3) 0.00000

4) -0.02039280161507402

5) -98.38164194703873

6) 33.08804759959623


GCP file from QGIS if anyone wants a look: http://ift.tt/1vE9Ev2





Finding polygon within polygon using ArcGIS for Desktop?


How do I find two parks (shapefile) that are within a census tract ?


If I'm not mistaken you have to use selection by location.. but beyond that quite sure what to do after.





Measuring Sinuosity of Walking Paths


I'm currently working on a project that examines the movement of consumers through different kinds of retail spaces in Central Asia – namely, bazaars versus supermarkets. I've equipped dozens of shoppers with GPS trackers that record their movements throughout these different retail spaces, and I'm now working on analyzing the resulting data.


I'm primarily interested in comparing overall walking distances and walking speeds – easy enough. But I've also noticed bazaar paths are highly irregular, with shoppers weaving this way and that through the crowded stalls, whereas the supermarket tracks are highly straight, efficient, and consistent between shoppers. So, I'd like to quantify the sinuosity or efficiency of these walking paths – i.e., how frequently the shoppers turn and/or backtrack.


I'm not sure how to approach this analysis – much less accomplish it in QGIS. Should I define this "spatial efficiency" index as the ratio of overall distance traveled to overall degrees of rotation, or something? Or should I use the simple river sinuosity calculation (direct distance vs. curvilinear length) – and if so, how should I determine the critical waypoints? Any advice is appreciated.





CartoDB: Dynamic text with different links in infowindows


I have a set of text with links for a set of countries that I'd like to display on click in CartoDB. I've created a column "text" and it displays fine on click. The problem is that I can't show the links at all.


Is there a way to keep them active? The a href tag isn't working since the links are always at a different position within the text.


Thanks, Bonurbe





How do I Simulate a Broadband Sensor (EG. Landsat 7 MSS) Using Hyperspectral Field Data?


I have a hyperspectral dataset that I collected using a field spectrometer at 1nm spectral resolution, between 400nm and 1000nm.


I'd like to use this data to simulate a broadband sensor, for example, Landsat 7's MSS. I know that I cannot simply average the values that fall within each band, but I cannot find any good information on exactly how it should be done.


I found a page with Spectral Response Functions for numerous different satellites, for use within Matlab at this page: http://ift.tt/1DXBtjv. Has anyone ever used these FSF filters in Matlab before? How exactly would I apply them to my dataset to simulate the values from Landsat 7 bands?


Any information on how I can accomplish this task would be greatly appreciated.





Feature Layers fail every second time the page loads, with "Error: Unable to complete operation"


If I create a very simple map based on the Feature Layer On Demand sample, and change the URL to my own feature layer, the map consistently fails every second time:



Error: Unable to complete operation. {code: 400, message: "Unable to complete operation." message: "Unable to draw graphic (null): Unable to complete operation."



If I refresh the page, the layer loads correctly, with no error messages. Refresh it again and the error shows. This applies to multiple layers on the server, not just one, so I don't believe it's related to corrupt geometry or whatever.


I vaguely remember seeing this problem a few years ago, but I can't remember the resolution. The layer is in ArcGIS Server 10.11 and I'm running the simple map via IIS on Windows 7, and accessing it via http://localhost


The only change I've made to the sample is the layer's URL, the map's starting extent, and the infoWindow contents.


enter image description here





QGIS Merged Layers/ Cannot Find Windows "minidump" to Restore Past version off Dropbox


Novice here. I copied a layer style and was playing around with the display of a point layer when QGIS Valmiera 2.2 crashed. A recently-created polygon layer's attributes now appear in the place of another poly layer with 100x more features, although the displayed feature count is still 506 instead of the 4 in the table. As the program crashed, it flashed a message as to where the minidump was located- not sure how to find it.


I attempted to restore previous versions of the layer and all associated files from Dropbox, but received an error of "permission denied". I verified that I have full access to AppData\Temp, which makes me believe that Temp is not the folder I should be searching in. Please help me find this folder or reload the 506 features and hours of work!





Georeferencing a CAD file and converting to SHP in ArcGIS without distance distortion


i have a land parcels dwg file in an unknown co-ordinate system and i want to georeference the file in ArcMAp and convert it to shapefile but the problem is that whenever i georef the cad drawings directly or or through spatial adjustment by converting it into shapefiles, the distances get distorted. for instance, if the length of line is 31 metres it changes to 0.000334 metres after projecting and georeferencing drawing. can anyone tell me the detailed method to finish this task? The precise steps that i performed are:



  • importing dwg file in arcmap and assigning projected co-ordinate system to file.

  • georeferencing the dwg file through two control points by using an already georefenced tif file for destination points.


my cad drawing overlays on the tif file but main problem are the distances an area. they are inaccurate.





ITV zone shape file


Where can we get ITV zone shape files for the UK? I need to create filled maps using this data. thanks for your time.





"No-break space" for labels


My map has labels, which usually should break after the 14th character using "wordwrap":


wordwrap(name,14)


But sometimes I need to suppress the wraping. So I need to use a "No-break space" - is there one?





What exact format do I need to have for the inputs to make Path Distance work?


I am trying to run the Path Distance tool in ArcGis 10.1. Ideally I would like to utilize Tobler's hiking formula anisotropic approach to slope and a land cover cost surface to calculate the least cost path. When I run just the slope, it works just fine. However, when I add the land cover raster it outputs at raster that has values from a high of 3.40282e+038 to a low of -3.40282e+038. These will not display so I have tried to figure out what I need to do to get them to display.


In searching for an answer I tried the solutions listed here:Why is Raster Layer not visible? None of these solutions worked. The statistics cannot be calculated for the raster, nor the histograms computed due to too many unique values. When it is exported it still does not display.


My question is what can I do to get this raster to display, or is this an indicator that the Path Distance did not create a raster with real data? If so what format do I need to have the input data (in this case the Land Cover) raster such that it will successfully output a visible raster?


Other details: The Input raster or Feature source for the path distance is a point shape file which I select prior to running the Path Distance tool


The Land cover is a 30 m raster downloaded from the national map website and clipped to my area of interest and then reclassified to give costs to the different land cover types and combine types into one of four cost values. That raster is unsigned 8 bit FGDBR Integer.


The output from path distance is 32 bit FGDBR Floating point.


Thank you for your help!





How to extract wall information by using the LIDAR?


I'm trying to extract wall using the LIDAR. I have tried Fusion, Whitebox, Lastools in Arcgis, Saga and Envi. Those are tools that I can use. The walls I am interested are mainly 1 meter high. Some of them locate in woodland and farmland. The most problem blocked me was shrub. For example, I used 'Bare ground' tool of the softwares I mentioned above. All the wall and shrub were removed. If I worked by other workflow, the shrub will remain and complicate walls. Attached is one of my result:


enter image description here


How to remove shrub and remain wall?


How to convert information of wall into vector data such as polyline?





Analyzing long lat location data to find locations in proximity


I am looking for a tool to analyze location data (long lat values from vehicle GPS available). The goal is to identify locations which are in close proximity (within a circle of 30-60ft) and then average values which are assigned to the different locations. Background is that it should be the same GPS values every time since the vehicle is visiting the same location but due to inaccuracies of the GPS the location slightly varies. I am trying to identify the location data which belongs to the same location. Any suggestions?


PS: First time user, let me know if you need more information.





Creating Panning Buttons in C#


I am new to this and still trying to learn. I have a bunch of VBA code that I am trying to convert to C# and even the most basic things are hanging me up.


Currently I am trying to build a button that pans the display Left when pressed.


The original VBA code that I have looks as follows:



Sub pan_left()
On Error GoTo Errhandler


Dim pMxDocument As IMxDocument
Dim pactiveview As IActiveView
Dim penv As IEnvelope
Dim pxmax, pxmin, pymax, pymin As Double
Dim nxmax, nxmin, nymax, nymin As Double
Dim width, height As Double

Set pMxDocument = ThisDocument
Set pactiveview = pMxDocument.FocusMap
Set penv = pactiveview.Extent

pxmax = penv.XMax
pxmin = penv.XMin
pymax = penv.YMax
pymin = penv.YMin

width = pxmax - pxmin
height = pymax - pymin
nxmax = pxmax + (width / 1.08)
nxmin = pxmin + (width / 1.08)
nymax = pymax
nymin = pymin

penv.XMax = nxmax
penv.XMin = nxmin
penv.YMax = nymax
penv.YMin = nymin

pactiveview.Extent = penv
pactiveview.Refresh

ThisDocument.fTimer
Exit Sub
Errhandler:
On Error Resume Next


End Sub


I have been trying to write it using the Desk top Addins. I have found some code on ESRI's website found here: Pan Left (Not sure if I am even on the right track.)


Currently my code looks as follows:



using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.ADF.CATIDs;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.ArcMapUI;
using ESRI.ArcGIS.Framework;



namespace NAIP_QQv1

{



[ClassInterface(ClassInterfaceType.None)]

[Guid("593EDF4F-D1FE-4a8d-8076-C3B583C37F6B")]



public class PanDown : ICommand

{
#region COM Registration Function(s)
[ComRegisterFunction()]
[ComVisible(false)]
static void RegisterFunction(Type registerType)
{
// Required for ArcGIS Component Category Registrar support
ArcGISCategoryRegistration(registerType);

//
// TODO: Add any COM registration code here
//
}

[ComUnregisterFunction()]
[ComVisible(false)]
static void UnregisterFunction(Type registerType)
{
// Required for ArcGIS Component Category Registrar support
ArcGISCategoryUnregistration(registerType);

//
// TODO: Add any COM unregistration code here
//
}

#region ArcGIS Component Category Registrar generated code
/// <summary>
/// Required method for ArcGIS Component Category registration -
/// Do not modify the contents of this method with the code editor.
/// </summary>
private static void ArcGISCategoryRegistration(Type registerType)
{
string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
ControlsCommands.Register(regKey);

}
/// <summary>
/// Required method for ArcGIS Component Category unregistration -
/// Do not modify the contents of this method with the code editor.
/// </summary>
private static void ArcGISCategoryUnregistration(Type registerType)
{
string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
ControlsCommands.Unregister(regKey);

}

#endregion
#endregion


[DllImport("user32.dll")]
static extern IntPtr SetFocus(IntPtr hWnd);


private System.Drawing.Bitmap m_bitmap;
private IntPtr m_hBitmap;
private IHookHelper m_pHookHelper;


public class Pan_Left : ESRI.ArcGIS.Desktop.AddIns.Button
{

public Pan_Left()
{
//m_pHookHelper = new HookHelperClass ();

}

protected override void OnClick()
{//Get the active view
IActiveView pActiveView = m_pHookHelper.ActiveView;

//Get the extent
IEnvelope pEnvelope = (IEnvelope)pActiveView.Extent;


}

protected override void OnUpdate()
{
}
}
}
}