title: Clip depth contour with spatial polygon

text: I need to somehow combine my Spatialpolygons with my depth contour, but not sure how do to so. Maybe create a SpatialPolygonsDataframe? This is what I've done so far:               > class(subarea0) #This is my area of interest (Eastern Canadian Arctic Sea)     [1] "SpatialPolygons"     attr(,"package")     [1] "sp"          > extent(subarea0)     class       : Extent      xmin        : -82.21997      xmax        : -57.21667      ymin        : 60.2      ymax        : 78.16666          library(marelac)     data("Bathymetry")#World bathymetric data in library (marelac)     names(Bathymetry);class(Bathymetry);str(Bathymetry)     [1] "x" "y" "z"     [1] "list"     List of 3      $ x: num [1:359] -180 -179 -178 -177 -176 ...      $ y: num [1:180] -89.5 -88.5 -87.5 -86.5 -85.5 ...      $ z: num [1:359, 1:180] 2853 2873 2873 2873 2873 ...            raster_bath<-raster(Bathymetry)#Transformed into a raster layer (not sure if this is the best way to achieve what I want)         extent(raster_bath) <- extent(subarea0)#Transform the extend of my raster to the extend of my SpatialPolygons     v <- extract(raster_bath, subarea0)#Extract data from my Raster Layer for the locations of my SpatialPolygons      v is a list with depth and I am not quiet sure how/under what form to rebind this info with my spatial polygon... Ideas? Other suggestions? **EDITS** I apologize in advance, looks like I've been having a hard time to explain clearly what I was hoping to get. I don't want to summarize my depth info for each of my polygon but rather provide a detailed bathymetry within my area of interest. I am definitely not sure if what I did up to now is the way to go, but ultimately what I would like to achieve is to end-up with a plot of my polygon with my depth information. Something like this ![enter image description here](http://i.stack.imgur.com/Xu1iI.jpg) (thanks to Simbamangu), but without the depth info outside of my polygon. Basically, I just want the bathymetry info comprise in my overall area at the finest scale possible. Should I first transform my SpatialPolygons into one and then into some grid format to then be able to clip with my raster layer? Thank you!


title: How do I select all outermost features

text: Is there anyway in QGIS that I can select all the outermost features on a map? On an island that would be all that have a coastline. edit: This is what I'm trying to select: ![enter image description here](http://i.stack.imgur.com/Hknii.png)


title: how to do simple self join and touches function in postgis?

text: I am having trouble with this query and neighbor calculation in PostGis. I want to find out which are the neighbors of Sweden in the table COUNTRIES which has column 'the_geom' for geometry and 'cntry_name' for countries. This is what I tried to do but with little success. Can someone help me out and explain me what am I missing? Thanks a lot everyone!!!               SELECT s1.cntry_name     FROM countries AS s1, countries AS s2      WHERE s1.cntry_name = ‘Sweden’ AND     touches(s1.the_geom, s2.the_geom);      After editing the query this got me two results, Finland and Norway!               SELECT s1.cntry_name as sweden_neighbors     FROM countries AS s1, countries AS s2      WHERE touches(s1.the_geom, s2.the_geom) = 'True'      AND s2.cntry_name = 'Sweden';      thanks everyone!!


title: Uncaught TypeError during proj4 transformation

text: I get: Uncaught TypeError: Cannot read property 'x' of undefined at proj4js- combined.js:2720 While executing this code (transforming polygon from one system to another):               Proj4js.defs['EPSG:3765'] = '+proj=tmerc +lat_0=0 +lon_0=16.5 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs';          var source = new Proj4js.Proj('EPSG:3765');     var wgs84 = new Proj4js.Proj('EPSG:4326');          var polygon = Proj4js.transform(source, wgs84, features[0].geometry.Polygon);                 gmlLayer.addFeatures(polygon);     map.addLayer(gmlLayer);


title: How can I find the difference between two times (hh:mm) in QGIS?

text: I have a shapefile of crime reports that includes the time a call was received and the time officers arrived on scene. I want to create response times from the difference in these two values. I know QGIS has support for the difference between dates, but I need the difference between two times in hh:mm format. Is there a way to do this in QGIS specifically? I am running QGIS 2.0 standalone version.


title: Trying to label graphic using feature attribute (ArcGIS Javascript 3.7 API)

text: I have a Dialog DIV containing an HTML list of buttons with a value for each school district. I want the user to be able to click on a button and have a polygon graphic of the district placed on the map, zoom to its location, and label the graphic with the district name. Using A HREF (javascript:findSchoolDist('district_name')) I call the function and zoom to the extent of the returned graphic. To my understanding, when using FindTask, all attributes are returned along with the graphic. The FindTask successfully finds the feature, returns the graphic, and zooms to its extent. The problem is I cannot get the label to appear. While I am using the Javascript 3.7 API, I am not using the AMD format so the code I am using is borrowed from a 3.5 API sample as they are coded using the legacy format. For finding the center of the polygon so the app knows where to place the label, the require "esri.tasks.geometry" is included and I have included the Geometry Service URL under the layers as "var geometryService = new esri.tasks.GeometryService("http://gis.abag.ca.gov/arcgis/rest/services/Geometry/GeometryServer");" The two functions that make up the tool are as follows:               function findSchoolDist(searchText) {        map.infoWindow.hide();        map.graphics.clear();             //Create find task        var schoolFindTask = new esri.tasks.FindTask("http://gis.abag.ca.gov/arcgis/rest/services/admin/abag_District_School/MapServer");             //Build school district filter        var schParams = new esri.tasks.FindParameters();            schParams.returnGeometry = true;            schParams.outSpatialReference = map.spatialReference;            schParams.layerIds = [0];            schParams.searchFields = ["name"];             //Set search text and find school district        schParams.searchText = searchText;        schoolFindTask.execute(schParams, schShowResults);     }          function schShowResults(results) {        var schoolSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_DIAGONAL_CROSS, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,255,0]), 4), new dojo.Color([0,0,255,0.25]));             map.graphics.clear();             dojo.forEach(results, function (result) {           var schGraphic = result.feature;           var schAttrib = schGraphic.attributes.name;           schGraphic.setSymbol(schoolSymbol);           map.graphics.add(schGraphic);        });             var poly = dojo.filter(results, function(r) {           return r.feature.geometry.type === "polygon";        });        if ( poly.length > 0 ) {           map.setExtent(poly[0].feature.geometry.getExtent().expand(1.5));        } else {           alert("No polygon results...");        }   //WORKS UP TO THIS POINT, FAILS AFTER             //Add district name to map        var schFont = new esri.symbol.Font("14pt", esri.symbol.Font.STYLE_NORMAL, esri.symbol.Font.VARIANT_NORMAL, esri.symbol.Font.WEIGHT_BOLD, "Arial");             var schTextSymbol = new esri.symbol.TextSymbol(schAttrib);           schTextSymbol.setColor(new dojo.Color([255,0,0]));           schTextSymbol.setAlign(esri.symbol.TextSymbol.ALIGN_MIDDLE);           schTextSymbol.setFont(schFont);             var pt;           pt = schGraphic.getExtent().getCenter();        var gra = new esri.Graphic(pt, schTextSymbol);             map.graphics.add(gra);     }      I am hoping that someone is still using the legacy format who has experience labeling graphics.


title: Calculate Slope Between Pixels Through Time: A Time Series Trend Analysis

text: I have a 9 year weekly time series (~500 raster grids of equal cell size and extent). I'm interested in obtaining the regression line slope between pixels (Imagine stacking all 500 grids on top of one another and running a linear regression between each individual pixel). Essentially, this would measure the net change between pixels through my time series. My main question is about the coefficients defined in the first answer here. Is the coefficient defined as 12 due to the temporal scale of the original question being at the monthly level? And if so, should my code's coefficient be set to 7 due to the weekly temporal scale between grids? I have been referencing these posts that are similar: Representing trends over time and make linear regression across multiple layers. I wrote this python code after reading the links referenced above:               from __future__ import division     import arcpy     import os     from arcpy import env     from arcpy.sa import*               # define workspace     arcpy.env.workspace=r"C:\Users\mbs7038\Documents\Remove_Gauge_Outliers\test\forSlope.gdb"          # enable overwriting     arcpy.env.overwriteOutput=True          # check spatial analyst extension     arcpy.CheckOutExtension('Spatial')          # define output paths     slopePath=r"C:\Users\mbs7038\Documents\Remove_Gauge_Outliers\SpatialTrends\SlopeTEST.gdb"          # list all rasters in the workspace     rasters=arcpy.ListRasters('*')     # sort rasters numerically     rasters.sort()          # get the number of rasters     n=len(rasters)     print n          # setup index     i=1          # define division     seed=(n*n*n)-n     print 'the global seed is {0}'.format(seed)          for raster in rasters:         print i         coef=(12*(i)-((6*n)+(6*1)))/seed              print 'Raster {0} is {1}:'.format(i,raster)         print 'the coef for raster {0} is {1}'.format(i,coef)              # Multiple raster by coefficient         if i==1:             outSlope=(Raster(raster)*coef)             i+=1  # same as saying i=i+1         else:             print 'adding {0} to outSlope'.format(raster)             outSlope=outSlope+(Raster(raster)*coef)             i+=1         if i==6:             break          # Save final slope grid     print 'saving final slope grid'     outSlope.save(slopePath + "/" + "floodChange_py")          print 'script is complete'      I created this code as a test which appeared to work on a 5 week subset of my data. If what I have referenced above is correct then this code will work on a time series (of equal cell size and extent) of any length. Although there were no bugs in the code, I have a feeling I may have made a mistake someplace and would appreciate extra eyes on my code. Any advice or recommendations? On a side note I'm using PyScripter, hence the "from **future** import division" in the first line. This disables the automatic floor function which rounds floating point numbers to the nearest integer away from zero.


title: ArcGIS 10.1 Geocoding problems - Creature Feature Class/Error processing the table

text: I am trying to geocode a list of addresses to location in a particular shapefile which has roads. I'm using ArcGIS 10.1, and trying to geocode using the address locator 10.0 north america geocode service (in table of contents, right click on the file -> geocode address). The spreadsheet that I am trying to geocode is in .xls format. The geocoding MATCHED ~640 cases, before it gave this error: > Creature Feature Class/Error processing the table There are no unusual characters in the field names - all of them either have a letter or a number, and nothing else. Scanning over the spreadsheet, there do not appear to be any null values, and the addresses do not seem to contain any periods, or characters that would otherwise be unacceptable to an address locator (my thoughts on the matter obviously). I've looked over other problems of a similar nature that have been posted in various forums, and most of the answers seem to be that the problem lies in the data, or in the format of the data. So my questions are:   1. Is there a specific problem with the data that I should look for?   2. Why would the address location terminate after ~640 successful matches?   3. Is there a better way to place point representation on a map, rather than geocoding a list of addresses via address location to a shapefile?   4. Could the problem be with the shapefile, and some of the shapefiles attributes?


title: How do I set nodata with custom color for gdal_translate and gdal2tilespy?

text: I start with a bunch of 1-bit geotiff files that I had to convert to 8-bit RGB tiff files to use with GDAL. Then I tried to set borders to red (content is in black and white so I can't use those) and do               gdal_translate -a_nodata '200 0 0' -of vrt red.tiff nodata.vrt          gdalbuildvrt -srcnodata '200 0 0' -vrtnodata '200 0 0' -hidenodata -addalpha nodata.vrt trans.vrt          gdal2tiles.py -a "200,0,0" trans.vrt ...      But I am only able to hide nodata if it is in grayscale(ex. rgb(200,200,200)) I think the color information is just lost in the gdal_translate process. Is there any way to verify what happened and make gdal work with nodata that has custom colors?


title: How to horizontally align irregularly shaped point symbol to vector layer in QGIS?

text: Fairly new to QGIS and searching a method to graphically align my point symbols in the direction of the vector. The symbol represents a water valve in an irregular shape in close proximity to a vector water network--is there a way to align each symbol adjacent/ horizontal to a water network vector layer?


title: QGIS 2.2 - Oracle Spatial Layer - Offline editing - Not synchronizing

text: I am sarting with QGIS 2.2.0 (windows, 64b). For my project I imported some layers Oracle Spatial layers (Layer>add Oracle Spatial Layer). Then I convert the project offline as I can't always be connected and edit the layers (mostly splitting features and adding others). My problem is that after synchronizing, the layers are back to their initial states and the changes are apparently not uploaded in my online Oracle database. Is there anything that can be done? Thank you for your help!


title: How do I set options for individual layers within an ESRI Mapservice?

text: I've been working on an internet mapping site to include ESRI basemap layers, and in-house mapservices broken out by layer.. I have gotten that far.. I am also still fairly new to javascript..so, this might be a javascript question.. Here is the code for the mapservice and the layers I am accessing..               var patLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://gis.co.frederick.va.us/ArcGIS/rest/services/Planning/Planning_PAT/MapServer",{id:'PAT',opacity:.6});         patLayer.setVisibleLayers([7,6,1,2,3,4]);         legendLayers.push({layer:patLayer,title:'Planning Layers'});      What I am not sure of is how to set the options only for specific layers and not just the entire mapservice.. such as opacity.. Any help is greatly appreciated..


title: How can I import layer symbology from another layer programmaticaly with ArcObjects & VBA?

text: I would like to be able to develop a procedure that runs through all layers in the TOC and if the layer (name) exists in a specific folder where I am storing layer files with complex symbology I would like to import the procedure to import the symbology from the layer files. I have a similar procedure for importing stored Label schema so combining the two into a more dynamic solution would save me a lot of time. Thanks


title: why is my findTask Not working correctly? can someone please look at my code and see if I have missed something?

text: My findTask is from the SAMPLE on ERSI's website http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/find_map_datagrid.html I have incorporated into the project I am working on. I've looked over the code again and again and can't seem to figure out why this is not working. ADDED - here is a link to the map.. http://www.co.frederick.va.us/planning/newmap1copy2.html UPDATED - Link..


title: Creating a list in Python and emailing the list

text: I am literally BRAND NEW to python and in my current role it is not a hardcore requirement, but knowing my way around a script will make life much easier. I am working in an ArcGIS Server environment, for context. I am gutting old scripts and piecing them together to do what I want. Right now, my script writes a text file compiling a list of services and their average draw times, and sends me an email every single time it detects an average draw time of more than 0 seconds for a service. (Ultimately this will be moved to 2 seconds but I'm using 0 to ensure it is workign correctly first). What I really want it to do is send one email with the listing of the draw times instead of x amount of individual emails. I will attach below the part that I think is relevant.... Thank you in advance for any help!!! Regards, S # Open text file and write header line summaryFile = open(filePath, "w") header = "Now,Service,Number of hits,Average seconds per draw\n" summaryFile.write(header)               # Read through dictionary and write totals into file     for key in hitDict:              #print hitDict              # Calculate average elapsed time         totalDraws = hitDict[key][0]         totalElapsed = hitDict[key][1]         avgElapsed = 0              if totalDraws > 0:             avgElapsed = (1.0 * (totalElapsed / totalDraws)) #Elapsed time divided by hits                    #Send email when invalid password is found in logs.                                            #NEW         if avgElapsed > 0:                     #Define Email Parameters                     #counter = 1 + counter                     #if counter > 5:                         EmailBody = "High avg draw time noted, check services."                         EmailSubject = "High avg draw times observed in " + item["source"]                              for address in Receivers:                             EmailAttachments(address, From, EmailSubject, EmailBody)                              print "High Average Draw Time Observed"#.format(timeStamp, machine)                   # Construct and write the comma-separated line         line = timeStamp +"," + key + "," + str(totalDraws) + "," + str(avgElapsed) + "\n"              fields = ["TIME", "SERVICE", "HITS", "AVGSECPERDRAW"]         insCur.insertRow(( timeStamp, key, str(totalDraws), str(avgElapsed)))              #serverName = item["machine"]         #print serverName              summaryFile.write(line)          summaryFile.close()     return


title: PostGIS retrieve polygons within a rectangle

text: I am building a system to bring in shapefile data from a PostGIS database and render it on top of OpenStreetMap tiles using the Leaflet.js library. My table (sierra_county_parcels) has a polygon geometry field (geom) in SRID 4326, and a field called "upc" that contains the parcel ID. There are about 16,000 rows in sierra_county_parcels. What I need to do is retrieve all of the upc values for rows where the geom polygon is within the currently visible part of the Leaflet map control. I have already written the code to send the northwest and southeast lat/lon pairs and generate an SQL query, which looks like this:               SELECT upc AS pt_parcel_key     FROM  sierra_county_parcels     WHERE  ST_Within(geom, ST_Envelope(ST_GeomFromText('MULTIPOINT(33.167444534375925 -107.14931488037108, 33.08909661229697 -107.35513687133788)')))      The MULTIPOINT WKT is what I'm currently using to specify the corners (nw_latitude, nw_longitude, se_latitude, se_longitude). The problem is that the query always returns 0 results. For this query, the map was zoomed out to show most of the region where the geometries should be. Any ideas? Thanks in advance, John W.


title: QgsFeatureList features as QStrings

text: I am catching the selectionChanged signal and passing the selected layer to the registered method. Once here, I want to know the features that were selected. I do this with a call to layer.selectedFeatures(). The return type from this call is a QgsFeatureList. As a test, I'm trying to print the values of the features in the QgsFeatureList that was selected, or just display them in a simple way. I find that neither QgsFeatureList nor QgsFeature has any functions returning a QString. How can I print the values of the features that were selected?


title: How to set the path to shapely?

text: I am using QGIS 1.8.0 on Mac OS 10.8.3 with python 2.7. Thanks to other threads in the forum, I have successfully installed shapely here: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/Shapely-1.2.16-py2.7.egg However, when I try to use the polygonizer-Plugin in QGIS it tells me that it cannot find shapely.ops. This clearly seems to be a path-problem, but I have no other versions of python installed. I have tried to append the above path to .bash-profile, but to no avail. Any help is appreciated. Nils


title: ArcGIS mobile to use external GPS device

text: Im currently tasked to create an app that would sketch a GPS Device's movement and plot it on the ArcGIS map. By default, the ArcGIS locationDisplay class calls the IOS class CLLocation to retrieve the GPS data in which it only uses the internal GPS of the iPhone. My question is: Is there any way to force the iPhone to use the GPS of an external device? Or can we configure the ArcGIS to use the data from the external device?


title: Using R to subtract the polygon area of one shp file from another

text: I'm looking to produce a map from two separate maps in R. My Maps files are as follows: ftp://ftp.cpc.ncep.noaa.gov/GIS/us_tempprcpfcst/610prcp_20140822.zip #Map1 ftp://ftp.cpc.ncep.noaa.gov/GIS/us_tempprcpfcst/610prcp_20140812.zip #Map2 These are 6-10 day weather Precip maps from NOAA. I would like to create a map with the area showing, being only the difference of the two maps. So `Map1 - Map2 = Map3`. Also, I would like it to show the relative strength of the change for the above or below normal moisture. Which can be seen in the "Prob,N,13,11" & "Cat,C,254" files of the dbf file. Without success I have tried: converting to PolySet and then using `joinPolys` with the Operation="DIFF". Also: using `readOGR`, checking for gIsValid, and then trying to use `gDifference`. When I run the second one I get this error: > Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_not_poly, > "rgeos_difference"): TopologyException: no outgoing dirEdge found at > -168.86604844949545 63.300706978948405 I am sorry if it seems like such a simple question of taking the difference between two maps but I have been stuck on this question for a number of days now. I would even appreciate being sent down the correct path because I feel like I'm going down the very wrong paths.


title: (.NET) Get DTED Data (Elevation) Between Two Points

text: I want to get DTED data (elevation) between two points (on a line). Is there any built-in function for this purpose or I should implement it on my own? What I want is similar to Linear Line of Sight (LLOS), but it should be on a direct line. I want to check if there is collision between two points or not. Thank you Sincerely


title: I want to make a table that displays shapefile information

text: I have a parcel I'm working with that has multiple layers laid over it. I'd like to make a table that displays various attributes of those different layers. For example, within that shapefile, I'd like to have a table display the watershed, school district, utilities, etc. and if that parcel changes, I'd like the table information to change too. I've experimented with data driven pages, but I'm not sure that's quite what I'm looking for. Any suggestions?


title: get map tiles for a polygon

text: Based on this tutorial, I can easily find out a tile for a point. But is there an algorithm to find all tiles that are covered by a rectangle or lineString or by any other feature? I would greatly appreciate any help!


title: Looking for "big names" that use open source WMS (like geoserver / ms4w / qgis server) for presentation

text: I'm looking for famous companies / "big names" (like army , goverments , city halls) that chose to use open source map servers and not paid solution like ESRI and such for presentation I'm doing (go Open Source :) ) Thx.


title: Can i change the color/font of map tool tip through arc objects for desktop application?

text: I want to have custom format of tooltip of features on axmapcontrol.


title: Add an individual layer from ArcGISDynamicMapServiceLayer to the map

text: I have a ArcGISDynamicMapServiceLayer containing many layers. I'd need to add only individual layers to the map, like layers 2,5 and 10. The following code would add all the layers to the map:               url = "http://...MapServer";     mapServiceLayer = new ArcGISDynamicMapServiceLayer(url, {          className: layer,          opacity: opacity     });     map.addLayer(mapServiceLayer);      How can I add only i.e. layer 5 to the map? (.../MapServer/5) There is a similar question here but answers seem not to be helpful for the front end solution.


title: Consuming gml generated by sql server As.GML()

text: Sql server has a method As.GML to produce GML file from geography/geometric type. Is there a good example to utilize this GML on other mapping platform such as QGIS? I have ask a related question here, but QGIS reports its format is not valid. Thanks.


title: How to create a feature class from a DEFeatureClass output parameter

text: I'm writing a geoprocessing tool with ArcObjects for Java. My tool takes in parameters one feature class (from a layer, a shapefile or a GDB) and others parameters. The parameter in output is a DEFeatureClass. I want to create from the DEFeatureClass a feature class of the same structure of my input feature class. I can get the full path of my output:               IGPParameter parameter3 = (IGPParameter)paramValues.getElement(2);     IGPValue gpValue3 = gpUtilities.unpackGPValue(parameter3);     String outputFeatureClassStr = gpValue3.getAsText();      And my input feature class like this:                   IGPParameter parameter1 = (IGPParameter)paramValues.getElement(0);         IGPValue gpValue1 = gpUtilities.unpackGPValue(parameter1);         IFeatureClass inputFeatureClass = gpUtilities.openFeatureClassFromString(gpValue1.getAsText());      But I can't found a method to create a new feature class from my outputFeatureClassStr string and my inputFeatureClass. Do you know how to do it? I tried to write a function getting the path and creating the feature class depending of the type of location (dataset or workspace):               private IFeatureClass getOutputFeatureClassFromGPValue(IGPValue gpValue, IFields fields, int featureType) throws AutomationException, IOException {         IDataElement dataElement = (IDataElement)gpValue;         String featureClassCatalogPath = dataElement.getCatalogPath();              IName fcName = gpUtilities.createFeatureClassName(featureClassCatalogPath);         String fcNameString = fcName.getNameString();         IFeatureClassName featureClassName = (IFeatureClassName)fcName;              IFeatureClassDescription featureClassDescription = new FeatureClassDescription();         IObjectClassDescription ocd = (IObjectClassDescription)featureClassDescription;              IFeatureClass featureClass = null;         if(featureClassName.getFeatureDatasetName() != null) {             IName datasetName = (IName)featureClassName.getFeatureDatasetName();             IFeatureDataset featureDataset = (IFeatureDataset)datasetName.open();             featureClass = featureDataset.createFeatureClass(featureClassCatalogPath, fields, ocd.getInstanceCLSID(), ocd.getClassExtensionCLSID(), featureType, featureClassDescription.getShapeFieldName(), null);         } else {             IDatasetName datasetName = (IDatasetName)featureClassName;             IWorkspaceName workspaceName = datasetName.getWorkspaceName();             IName name = (IName)workspaceName;             String nameString = name.getNameString();             //IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)name.open();                  ShapefileWorkspaceFactory shapefileWorkspaceFactory = new ShapefileWorkspaceFactory();             Workspace workspace = (Workspace)shapefileWorkspaceFactory.openFromFile(nameString, 0);             featureClass = workspace.createFeatureClass(featureClassCatalogPath, fields, ocd.getInstanceCLSID(), ocd.getClassExtensionCLSID(), featureType, featureClassDescription.getShapeFieldName(), null);         }              return featureClass;     }         The way I call my function:               IFeatureClass outputFeatureClass = getOutputFeatureClassFromGPValue(gpValue3, inputFeatureClass.getFields(), inputFeatureClass.getFeatureType());      But it doesn't work. If the output is in a GDB, I get the fcNameString = "", and if the output is a shapefile, I get a ClassNotFoundException for the class com.esri.arcgis.datasourcesfile.ShapefileWorkspace. Does anyone see what's wrong in this or know another method ? Thanks a lot.


title: ArcGIS Labeling Expression when truncation needed to fit in some polygons?

text: What would be the expression coding for if the address is 14802. But if the whole address cannot fit inside the building dimessions, then it should be truncated to the last two digits - 02. I am trying to do this ... ![enter image description here](http://i.stack.imgur.com/vHIDM.jpg) As seen in my map, I am trying to take down the congestion of the map with the numbers and trying to still be able to label each building for a firedepartment map. Any ideas?


title: Is it a bad idea to convert a File Geodatabase table to a dictionary?

text: ## First, what am I trying to do? I am building a Python script that should be called from an ArcMap 10.0 toolbox. This scripts uses (among other inputs) data contained in huge gdb tables. It processes the data in many different ways (hence, there are many inevitable iterations on the table). ## Why would I want to convert the data? The reason why I am converting the tables to ditionaries is that it is extremely slow to iterate through the table using SearchCursor. I have many operations that I want to do on my data and it is much simpler and faster to use existing data structures. ## How am I doing it? The usual way to use gdb tables in Python (and the one to which I have compared my method) is something along the lines of:               # Create a search cursor     rows = arcpy.SearchCursor(table)     for row in rows:         (...)      What I'm doing instead, is that I am converting the table to dbf using TableToTable_conversion (throwing away some useless columns/rows on the way). Then I convert this DBF table to a dictionary (I was inspired by some code written by Tyrtamos, if you google "Lecture d'un fichier dbase III" you should find it). In the end, I have a dictionary containing lists of data indexed with the column names. And I'm very happy because I can do many things with it relatively quickly. ## Finally,... This method seems to be much faster. However, I am new to that game and I'm afraid to be missing something because I don't understand everything that's going on. Is it a bad idea to do that? Are there reasons not to do it other than potential memory overflow? Please tell me if something is unclear. Thanks! **EDIT** After seeing your answers, I realize that there was one _very_ important information missing: I'm using Arcmap 10.0. I have run performance tests using nmpeterson's solution, modifying a few lines to make the code compatible with ArcGIS 10.0               cursor = arcpy.SearchCursor(fc, cursor_fields)     for row in cursor:         rowList = []         for field in cursor_fields:             rowList.append(row.getValue(field))         attr_dict[rowList[0]] = dict(zip(cursor_fields, rowList))      On a small table containing ~15000 rows, I measured an average elapsed time and got               make_attribute_dict -- 10.7378981873     gdb_to_dbf_to_dict-- 2.56576526461


title: R - Crop a pixel image produced by spatstat with a boundary shape

text: i am using the very good spatial statistic package **spatstat** to produce probability maps of spatial point patterns. Here is a simple working result from the examples to try out.                 require(spatstat)       data(lansing)       z <- relrisk(lansing)       plot(z, main="Lansing Woods")      My question is rather simple (or maybe not). I produced a similar map as shown above and i want to crop it in **R** with a boundary shapefile. The spatstat package uses its own system (of windows and pixel images) so i am rather clueless. I know that i can format my shapefile to a so called mask with this command `as.mask(as.owin(shapefile))`, but i didn't get beyond this point.   Anyone knows how i can crop the produced image with this mask? * * * EDIT: Ahh, sry. I already found a solution around it, which works for me. I simply have to make a subset out of the spatial points before converting it to a ppp object.               library(rgdal)     st <- readOGR("GIS-Data","boundary_shape")      wp <- spp[-which(is.na(over(spp,st)[,1])),] # spp is my spatial point shape     rm(st)     #Then use this command from the maptools package     library(maptools)     plp <- as.ppp.SpatialPointsDataFrame(wp)      Nevertheless it would still be nice to know if it is possible to crop a spatstat pixel image.


title: How do "join field" and "target field" work?

text: New user. This should be simple, but I can't figure out how to perform this basic join in QGIS. (It works in Cartographica.) My shapefile (IL_BNDY_County_Py) has two fields/columns in its attribute table: COUNTY_NAM and CO_FIPS. My source DBF file (IL_BNDY_County_Py-species-dbf4.dbf) has three fields/columns: COUNTY_NAM, CO_FIPS and SPECIES. (The file is a literal clone of the shapefile table, with the addition of "SPECIES".) Both are available as layers in my project. I want to add the SPECIES field to the shapefile. Either COUNTY_NAM or CO_FIPS could serve as "key" field (to use terminology I'm familiar with from other software). When I try to create a join, the **Add vector join** dialog shows the following options: **Join layer** : IL_BNDY_County_Py-species-dbf4.dbf **Join field** : (three menu options): COUNTY_NAM, CO_FIPS or SPECIES **Target field** (two menu options): COUNTY_NAM or CO_FIPS Is this what I should be seeing? I can't figure out how to use this dialog to get the SPECIES field added to the shapefile. Part of the problem is that QGIS doesn't use the the term "key," so it's impossible for me to know which field QGIS wants to use to ensure the relationship. Given the options displayed, neither the "target" nor "join" field seems appropriate to serve as "key." How do I denote the "key" field? If I choose SPECIES as the Join field, and CO_FIPS as the Target field, the results are duplicate columns for COUNTY_NAM and CO_FIPS with random mix of integer values and NULL values. SPECIES values are ignored and not copied over. I even tried creating a placeholder "species" column in the shapefile attribute table but still couldn't figure out how to get SPECIES copied over to species. What is the proper procedure for doing this? Is there another problem that I should be considering?


title: Setting coordinate systems in gvSIG: Is the workflow similar to QGIS?

text: I am still learning how to use coordinate systems and projections, but I hope this basic question will be easy to answer. My goal is to be able to use either QGIS or gvSIG to create a simple county map of Illinois using the base data shapefiles available from the Illinois Natural Resources Geospatial Data Clearinghouse. I believe I need to use a state plane coordinate system such as NAD83/Illinois (East) or NAD83/Illinois (West) so that the state will look like this: ![Illinois](http://i.stack.imgur.com/npHUC.jpg) ... but not this: ![Illinois wide](http://i.stack.imgur.com/KgsT4.jpg) In QGIS, I assume that best way to get the desired look is by _first_ setting the application's CRS Preferences and the Project Properties CRS to NAD83/Illinois (West) [EPSG code 26972], with "On the Fly" selected, then adding the shapefile. Leaving the "On the fly" option unselected causes problems. Changing the Preferences or Project CRS _after_ adding the shape layer also causes problems. Are my basic steps and assumptions correct? If those basic steps are correct, why do the same steps _not_ work in gvSIG? (The Illinois shape is displayed as the undesired "wide" version no matter what I do.) _Added later to illustrate comment on gvSIG:_ Here are the dialogs I see after adding the layer: ![enter image description here](http://i.stack.imgur.com/BUGEA.png) In case this is relevant, here's the empty Transformations list in gvSIG: ![Transformation dialog](http://i.stack.imgur.com/uF8vu.png)


title: tile cache error : Lower left corner is outside layer bounds

text: i have made a wms layers in openlayers consuming cached tiles generatred by tile cache , in the generation step i have used this configuration : [vmap0] type=WMS url=http://localhost/cgi-bin/mapserv?map=maps/poimanager/nav 2tiles.map layers=nav_map bbox=-855822.40976158,3975513.7271299,-847686.6435646,3976531.2950689 levels=20 concerning the map in openlayers i have defined the resolutions in map instance options:                     var options = {         maxExtent: new OpenLayers.Bounds(-2015494, 2445884, 48919, 4383204),         projection: "EPSG:900913",         displayProjection: new OpenLayers.Projection("EPSG:4326"),         units: 'm',         numZoomLevels: 20,     resolutions :[3.9725420883691527, 1.9862710441845763, 0.99313552209228817, 0.49656776104614408, 0.24828388052307204, 0.12414194026153602, 0.062070970130768011, 0.031035485065384005, 0.015517742532692003, 0.0077588712663460013, 0.0038794356331730007, 0.0019397178165865003, 0.00096985890829325017, 0.00048492945414662508, 0.00024246472707331254, 0.00012123236353665627, 6.0616181768328135e-05, 3.0308090884164068e-05, 1.5154045442082034e-05, 7.5770227210410169e-06]                 };                      var map = new OpenLayers.Map('map', options);      but i still get nothing just when i try to view the images using firebug it gimme this error : "An error occurred: Lower left corner (-851825.191138, 3976933.501194) is outside layer bounds [-855822.40976158006, 3975513.7271298999, -847686.64356460003, 3976531.2950689001]. To remove this condition, set extent_type=loose in your configuration." can you help me resolve this error :) thanks in advance :)


title: Join Text File with lat/long in a shape file without a field in commom with QGIS 1.8

text: I'm using QGIS 1.8. I have 3 files: a shape file from a state, a csv file with a commom field with this shape file and a third file (csv, with long/lat colums). In this third file. I have a column 'id_customer'. The shape file is a map of a state. And the file with a commom column with the shape file, has the income for vrious neighborhoods. I want to link the customer file with the shape, and after link the customer to the income field. Can anyone help me?


title: Reprojecting Natural Earth "Admin 0 – Countries" shapefile to Web Mercator

text: I haven't received a reply posting this same question on the Natural Earth forums, so I figured I'd give it a try here. I’m trying to reproject the 1:10m "Admin 0 – Countries" shapefile into a Web Mercator projection (EPSG:3857) using QGIS. However, the reprojection fails with the following message:               Export to vector file failed. Error: Failed to transform a point while     drawing a feature of type ‘ne_10m_admin_0_countries’. Writing stopped.     (Exception: forward transform of (3.141593, -1.570796) PROJ.4:     +proj=longlat +datum=WGS84 +no_defs +to +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs      Error: tolerance condition error)      I receive this error for both "ne_10m_admin_0_countries" and "ne_10m_admin_0_countries_lakes". A post here on gis.stackexchange.com indicates that it might be a problem with points in Antarctica going to infinity during reprojection, but I’m not sure how to fix it if that is indeed the problem. The 1:50m "Admin 0 – Countries" shapefiles are able to be reprojected successfully using QGIS, which leads me to believe that the root of the problem may lie in the 1:10m shapefiles. I'm hoping that someone can expand on the answer offered in the linked post and provide answers for the following questions:   * Is there an error in the 1:10m shapefile? (Since the 1:50m shapefile reprojects without issue) Or is this sort of reprojection error just to be expected under certain circumstances?    * **Exactly what steps may I take to fix the shapefile so that it can be successfully reprojected?** The linked post says to "delete the objects around the south pole" but I'd prefer not to delete Antarctica. I tried editing the Antarctica feature to chop off the southernmost portion, but it didn't seem resolve the reprojection error. Please assume I'm a GIS newbie. Thanks!    **RESOLUTION & NEW SHAPEFILES** Second try was the charm for me, and I was able to trim off the bottom of Antarctica using the "Reshape Feature" tool in QGIS. There's a decent description of how to use it here: http://gis.stackexchange.com/a/21651/1770. After removing the southernmost portion of Antarctica, I was able to successfully reproject the map. To save everyone some time, I've posted the files. These are the "_lakes" files that do NOT include boundary lakes:   * Original file in WGS 84 (EPSG:4326), but with the bottom 0.4 degrees of Antarctica trimmed off. You should be able to reproject this file without issue: https://github.com/dmillz/misc/raw/master/shapefiles/ne_10m_admin_0_countries_lakes-trimmed_antarctica.zip   * Same file, but reprojected into Web Mercator (EPSG:3857): https://github.com/dmillz/misc/raw/master/shapefiles/ne_10m_admin_0_countries_lakes-EPSG_3857.zip


title: How can I enable PostGIS Shapefile and DBF Loader 2.0 plugin in PgAdmin III?

text: I am on Windows and I want to download/enable the plugin "PostGIS Shapefile and DBF Loader 2.0". I installed PostGIS 2.0 using StackBuilder of PostgreSQL installer.


title: XYTools truncating decimals on export to excel

text: Is there some sort of setting to prevent XYTools from truncate decimals when exporting a shapefile to excel? I live in Sweden hand we normally use comma as decimal point. Even if I change the setting both on system level as in Excel - XYTools still truncate decimals. Thx /Jan


title: ArcObjects VB.Net - Looping through Layers from TOC and ListBox

text: Greetings, I'm creating a tool in ArcMap 10 using a windows form... its been a struggle (maybe some of you recognize the same themes in my questions) because this is the first time I've really messed with ArcObjects and VB.Net... either way I'm almost there!! (Largely thanks to a very helpful GIS community.) The main chunk of the code works (grabs an attribute from one layer and assigns it to the "target" layers), and now I'm in the process of linking up the user parameters. ![enter image description here](http://i.stack.imgur.com/5hszo.jpg) As it stands, the "NHD Reach Layer" combo box (cmbNHD) requires the source layer be in the table of contents (TOC). The target layers, on the other hand, can either be in the TOC (through the "Target Layers" combo box (cmbTarget), or accessible through the GxDialog. Either way, the selections are placed in the list box (boxTarget).                   ...              Dim pLayer As IFeatureLayer         Dim pGxDataset As IGxDataset = pGxObjects.Next         Do Until pGxDataset Is Nothing             pLayer = New FeatureLayer             pLayer.FeatureClass = pGxDataset.Dataset             pLayer.Name = pLayer.FeatureClass.AliasName             If Not boxTarget.Items.Contains(pLayer.Name) Then boxTarget.Items.Add(pLayer.Name)             pGxDataset = pGxObjects.Next         Loop     End Sub      OK, so what I can't figure out, is how to form some "loopable" list from the items in the list box. The original code worked only with the items in the table of contents, and so it could loop through them all using this type of loop...                   For i = 0 To pMap.LayerCount - 1             Dim pLayer = pMap.Layer(i)      ...and just skipping the index number of the source layer ("NHD Reach Layer"). AND SO, I'm pretty sure I just need to create an enumeration of the layers in the list box, but I've only been able to dig up the IEnumLayers interface, and it seems as if that only works with the layers in the current map. Any thoughts/ideas? Also, I'm not sure if this is the place (though, I can't think of a better one), but when this is all finished, I was wondering if I could post the final code (the reason I ask is because it wouldn't really be a question). I've spent a good amount of energy trolling through forums and developer help files to find relatively simple answers in the form of examples, but usually they are snippets, which, when viewed out of context, can be confusing. It's my belief that this code would be really helpful to anybody just getting started, because it offers few frills, and combines a lot of basic methods with some intermediates thrown in here and there. Just trying to help. Thanks so much!! DR


title: Relabel Vector Points in OpenLayers

text:
I have created two labeled vector points on an open layers map. I'm trying to change the label text dynamically. I tried changing the values where the stylemap gets the values from and calling layer.refresh() but it does not do anything. Any ideas? Here is my code in its entirety. All you have to do is change the open layers JS reference to your local file and it will work in your browser.                                 <title>OpenLayers Labeled Features Example</title>          <link rel="stylesheet" href="../js/OpenLayers/theme/default/style.css" type="text/css" />          <link rel="stylesheet" href="style.css" type="text/css" />
OpenLayers Refresh Labeled features example

              <input type="button" value="Switch Labels" onclick="Javascript: switchLabels();" />


title: RuntimeError while executing python

text: After downloading Matplotlib to use the Statist Pugin An error has occured while executing Python code: RuntimeError: module compiled against API version 9 but this version of numpy is 6 Python version: 2.7.5 (default, Mar 9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] QGIS version: 2.2.0-Valmiera Valmiera, Later on the message is that statist is also not able to run. How to solve this problem?


title: Convert feature class to raster based on attribute field values

text: As part of a tool, I’m trying to convert a feature class to a raster based on attribute field values. I have accomplished this conversion using IRasterConvertHelper, but this is done without specifying an attribute field. So I then was able to do the conversion using the IGeoProcessor to execute ConversionTools.FeatureToRaster , but was only able to use numeric fields (i.e., tool didn’t work when a text field was selected). Going another route, I tried dissolving the feature class based on a selected attribute field using IBasicGeoprocessor and Dissolve, but this fails with: {System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component. (thanks ESRI, lots of help!) Does anyone have any idea on how to accomplish the same thing as the ArcToolbox Conversion Tools Feature to Raster tool and convert a feature class into a raster based on an attribute field?


title: Getting started with ArcGIS

text: I am 100% new to ArcGIS and I am feeling more than lost. I have found quite some tutorials on the web but they do not really help me - they explain nicely how to analyse perfectly prepared data and maps. But the dirty work to me seems completely uncovered. What I would like to do is the following   * For my country I have a Stata dataset on individuals and postcodes   * My second Stata dataset contains measurements and their coordinates   * For each individual I would like to know inverse weighted average distances to the x closest measurements I guess ArcGIS is well suited for this. I managed to load a proper basemap and a layer containing postcodes. Now I face the following questions and I do not really know where to begin. How do I have to format my Stata-files? In which format (dbase, personal geodatabase...) do those data have to be? I´m very willing to work my way through, but I just have no idea where to start. Do you have some reference to a tutorial or so where such topics are covered - and not just how to change a color? Thanks a lot!


title: Cost Path tool in script randomly throws error

text: I have a script tool that is creating a least cost path for sets of points using a Cursor. When applied, the script runs great, except every so often the tool is stopped because there is an error in the Cost Path tool. If I close out of the tool and run the last few steps manually on the points everything works fine and I can start the tool on the next row.   Here is the cursor in the script:               rows = arcpy.SearchCursor(setExtract)     for row in rows:         if row.setX == row.upX and row.setY == row.upY:             arcpy.AddMessage("Points for trawl " + str(uniqueID) + " have identical coordinates, the trawl cannot be drawn.")         else:             avgDepth = row.avg_depth             uniqueID = row.uniqueID             arcpy.MakeFeatureLayer_management(setExtract, "setpoint", "uniqueID = " + str(uniqueID))             arcpy.MakeFeatureLayer_management(upExtract, "uppoint", "uniqueID = " + str(uniqueID))             outRas = Abs(Raster(clipBathy) - avgDepth)             outRas.save(tempRasters + "\\cost" + str(uniqueID) + ".img")             costRas = tempRasters + "\\cost" + str(uniqueID) + ".img"             outCostDistance = CostDistance("uppoint", outRas, 500, tempRasters + "\\backlink" + str(uniqueID) + ".img")             outCostDistance.save(tempRasters + "\\dist" + str(uniqueID) + ".img")             distRas = tempRasters + "\\dist" + str(uniqueID) + ".img"             backlinkRas = tempRasters + "\\backlink" + str(uniqueID) + ".img"             outCostPath = CostPath("setpoint", distRas, backlinkRas)             outCostPath.save(tempRasters + "\\path" + str(uniqueID) + ".img")             pathRas = tempRasters + "\\path" + str(uniqueID) + ".img"      And here is the error:               Traceback (most recent call last):       File "S:\Scripts\June6.py", line 138, in <module>         outCostPath = CostPath("setpoint", distRas, backlinkRas)       File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Functions.py", line 688, in CostPath         destination_field)       File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Utils.py", line 47, in swapper         result = wrapper(*args, **kwargs)       File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Functions.py", line 681, in wrapper         destination_field)       File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 484, in <lambda>         return lambda *args: val(*gp_fixargs(args, True))     ExecuteError: ERROR 999999: Error executing function.     The table was not found. [CostPat_shp1]     The table was not found. [fras_bnd_CostPat_shp1]     The operation was attempted on an empty geometry.     ERROR 010029: Unable to create the raster C:\Users\amts\Documents\ArcGIS\Default.gdb\CostPat_shp1.     ERROR 010067: Error in executing grid expression.     Failed to execute (CostPath).      Both the backlink and cost distance rasters are saved and can be drawn in the map, so there doesn't appear to be anything wrong with them. Is this just 'one of those things' that happens in ArcGIS?


title: How to use bold text in QGIS font marker symbol?

text: Is it possible to use bold text with the Font marker symbol in a QGIS (point) layer?


title: How do you convert raster to polygon while avoiding small polygons

text: I intend to convert a raster to several polygons, but I want to ignore too small polygons, and just keep larger polygon. How can I do that? Thanks in advance!


title: How to label points with two lines in tilemill

text: I am designing a map in Tilemill. I want to label my POIs with tow lines. If I am using               text-wrap-width:1;      then its breaking the labels with each word as a new line. Such as if the label is "One Two Three Four" then its showing like One Two Three Four But I want to visualize like the following One Two Three Four Sometimes its very hectic for viewers. Is there any way to label those with two lines always? Thanks


title: How to learn ArcGIS Server?

text: I have SQL Server, ArcGIS Server Standard Enterprise 10.0 - and I am new to both. How can I learn to use it. I want to learn ArcSDE but i am unable to understand it. Is ArcSDE available with ArcGIS Server Standard Enterprise? I am unaware of license issues. Uma Joshi


title: Setting up QGIS Server at low cost for small user community?

text: I want to setup QGIS Server at a low cost for a small user community (mainly me). Parameters:   1. Some data is private so something like qgis cloud not an option (not enough money for paid option).    2. Primarily only me using this for experimentation. Sometimes I would like to share with a few other interested parties who may be scattered around the world.   3. Maybe one day I come up with something really interesting/useful and would like the option to scale up server capacity quite quickly in case it generates a lot of traffic.   4. Not too worried about 100% uptime - but equally don't want something that is falling over all the time. Essentially I can cope with the odd outage if it means its cheap.   5. Needs to be cheap.... ideally free.   6. Needs to be relatively simple to implement OR with a good tutorial. I have dabbled with this sort of thing before but still get a bit confused with too much server jargon & command line stuff - keen to learn at least! QGIS server looks ideal because most of my work is in QGIS desktop and I want something that is relatively quick and easy to publish to. Things I am considering:   1. Trying to setup QGIS Server on existing shared hostgator server... (but looking unlikely i can get sudo access).   2. Converting an old laptop into a home server.   3. Using Amazon EC2.   4. Try to setup QGIS Server on a bitnami stack and then use their cloud (maybe free option will work here?)   5. Finding a new low cost host option (could stretch to £10-20 a month at a push as a last resort) Has anybody else faced a similar scenario? Can you suggest solutions that might work for me? Many thanks in advance if so....


title: How to connect QGIS to an online database on Mac OS X?

text: I'm a real beginner/dummy when it comes to QGIS and online databases. I have tried a variety of things trying to connect to Spatialite, PostGIS and MySQL but all attempts have failed due to my lack of knowledge on the subject. So I was wandering:   * What is the easiest way to connect QGIS to an online database?   * Is there such a thing as a step by step manual to do this that is easy to understand by non programmers and dummies like myself? Many thanks for your help Ed specs: MAC OS X Mountain Lion (but I also have Ubuntu) QGIS 1.8 Lisboa


title: Vector Tile Rendering on iOS

text: I'm developing an iOS app for displaying my own custom map data (on GeoServer). The SDK I'm using to display my map is route-me (Alpstein fork) as the map viewer for now. route-me supports raster tiles (slippy tiles) and I'm OK with that for the most part, mostly for online mode. But I want to support both online maps and offline routing, plus, caching z17+ is a very bad practice because of the growth in number of tiles and the fact that very little part of these tiles will be viewed by users, and z17+ doesn't necessarily mean new data! we can use the same data and over zoom it. As part of my research, I have found that OSM protobuf format is a very efficient format for offline usage and routing but I cannot find any good renderer for the format! My scenario is: for z0-z17 I will load tiles from server with no problem ->from z17-z20 I will try and load a larger set (bbox from z15 of the tile, meaning 16 tiles around) and try to render the tile's bbox from osm.pbf and pass it to route-me as the tile and cache it like a normal tile. The question now is: How can I render osm files in iOS?


title: Creating an outline around groups of polygons

text: I am trying to find a tool or workflow for creating a type of minimum bounding polygon or envelope for complex land areas. (Not just a rectangle, but a simplified perimeter) Can anyone recommend a way to create the simplified black boundary lines around the irregular colored checkerboard areas in the attached image without having to manually digitize. I’m using ESRI ArcMap Advanced, but open to other tools. ![enter image description here](http://i.stack.imgur.com/6Waj4.jpg)


title: g.list problem in GRASS command line

text: I am using GRASS 6.4.3 (installed with osGeo4w), and I have this question： As I type `g.list`, a function window will pop out, and all functions and results are fine. But when I type `g.list rast`, I got this message： > '%GRASS_PAGER%' is not recognized as an internal or external command, > operable program or batch file. The photo below, left one is the correct output in popout window as I type in command `g.list`, and the right one is the message I got in command line as I type in `g.list rast`： ![enter image description here](http://i.stack.imgur.com/yCyC0.png) But I have already add the following paths in my path environment variables：               1. C:\OSGeo4W64\apps\grass\grass-6.4.3\bin     2. C:\OSGeo4W64\bin      How can I solve this problem? I am using GRASS 6.4.3 under windows 8.1 64-bits, please give me any suggestion!


title: Map scaling in ArcObjects?

text: I am using below code to set mapscale of mapFrame. This frame I am using in PageLayout               IMapFrame pMapFrame2 = new MapFrameClass();     pMapFrame2.Map = new MapClass();     pMapFrame2.Map.SpatialReference = CommonMapOperation.GetGlobalSettingSpatialReference();     pMapFrame2.ExtentType = esriExtentTypeEnum.esriAutoExtentScale;     double tl = totallengthinInch;     double tlm = totalLengthInMeter;     pMapFrame2.MapScale = (totalLengthInMeter * 28 )/ (totallengthinInch);      I have value in meter and inch unit by which I want to set scale.


title: Intersecting great circle arcs and polygons

text: I am trying to find the point of intersection between a great cirle arc and a polygon. I am working in long/lat, where I am given the endpoints of the great circle arc, A and B, and the vertices, C, D, E and F of the polygon in long/lat. The point A is inside the polygon and point B is outside of the polygon. It is obvious by construction that the great circle arc intersects the polygon on the CD side of the polygon. When I compute the intersection of the great circle arc AB, represented by a LINESTRING, with the POLYGON CDEF, I get a LINESTRING from a point on CD to A; when I compute the intersection of the great circle arc AB with the LINESTRING CD, I get a different point on CD. Here are the details:               A:  -122.3 47.4      B:  -84.4 33.6          C: -107 49     D: -107 31     E: -130 31     F: -130 49      (1) intersect LINESTRING and POLYNOMIAL               select st_astext(st_intersection(st_geographyfromtext('linestring(-84.4 33.6, -122.3 47.4)'), st_geographyfromtext('polygon((-107 49, -107 31, -130 31, 130 49, -107 49))')));          ====>     LINESTRING(-107 42.1770201452269, -122.3 47.3999999999286      (2) intersect LINESTRING and LINESTRING               select st_astext(st_intersection(st_geographyfromtext('linestring(-84.4 33.6, -122.3 47.4)'), st_geographyfromtext('LINESTRING(-107 49, -107 31)')));          ====>     POINT(-107.040211660479 43.9998296744469)      As you can see, this point is not the same as the endpoing in the output of (1). What is going on? I am running PostgreSQL9.3.4 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.2-16ubuntu6) 4.8.2, 64-bit POSTGIS="2.1.2 r12389" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1" LIBJSON="UNKNOWN" RASTER Finally, a colleague of mine computed the intersection of the two great cirlce arcs directly calling the Java version of GDAL/OGR and got -107 41.8290237496. Thank you for your help.


title: Suitable algorithms for simplifying isochrone polygons

text: I'm looking for an algorithm for simplifying isochrones which were generated using OSM data. These are generally characterised as having lots of small "holes" mostly due to missing OSM data but also frequently having small "islands" due to the use of transport like subways. I have tried a number of tools for this but all are too aggressive at shrinking space - most critically, deleting the islands. Reachability to these public transport islands is very important. So rather than focusing on tools, I wanted to step back a bit and ask if any particular algorithms are well or not well suited to such a task? i.e. being aggressive at removing holes but conservative about not removing islands. The isochrones start life in GeoJSON format. They eventually will be imported to PostGIS.


title: Point to Line Calculations

text: We are looking to take a point and compare it against the nearest point to an adjacent line. All values are in lat/long. We tried using some of the concept found on the board but found it did not work if the points share a same lat or long as it ends up multiplying by zero when subtracting the differences Does anyone have working Java or PHP scripts they can share? Here is the code version 1 we have been working with               <?php          function IntersectionDAN ($startLat, $startLon, $endLat, $endLon, $pointlato, $pointlono)     {         //Find if points are in the same plane         if ($pointlato == $endLat) {             return Intersectingdistance ($pointlato,$pointlono,$endlat,$endLon );         }else         if ($pointlono == $endlat) {             return Intersectingdistance ($pointlato,$pointlono,$endlat,$endLon );         }else         if ($pointlato == $startLat) {             return Intersectingdistance ($pointlato,$pointlono,$startLat,$startLon);         }else         if ($pointlono == $startLon) {             return Intersectingdistance ($pointlato,$pointlono,$startLat,$startLon);         }              $startLat = ($startLat);         $startLon = ($startLon);         $endLat = ($endLat);         $endLon = ($endLon);         $pointlat = ($pointlato);         $pointlon = ($pointlono);         $Xline1 = $endLon - $startLon;         $Yline2 = $endLat - $startLat;         $ShortestLength =(($Xline1 *($pointlon - $startLon)) + ($Yline2 * ($pointlat - $startLat))) / (($Xline1 * $Xline1) + ($Yline2 *$Yline2));         $Xcrosssection1lon = ($startLon + $Xline1) * $ShortestLength;         $Ycrosssection1lat = ($endLat + $Yline2 )* $ShortestLength;         if (($Ycrosssection1lat < $endLat && $Ycrosssection1lat > $endLon) && ($Xcrosssection1lon < $endLon && $Xcrosssection1lon > $startLon)) {             return array(                 "lat" => $Ycrosssection1lat,                 "lon" => $Xcrosssection1lon             );         }else {             echo "nothing";         }              var_dump($ShortestLength);         var_dump($Ycrosssection1lat);         var_dump($Xcrosssection1lon);              return Intersectingdistance($pointlato, $pointlono, $Ycrosssection1lat, $Xcrosssection1lon);     }     function Intersectingdistance($pointlat,$pointlon,$Ycrosssection1lat,$Xcrosssection1lon)     {     $R = 6378.137; // Radius of earth in KM         $pi = pi(); // It's delicious and cut precisely         $pointlat = ($pointlat);         $pointlon = ($pointlon);         $Ycrosssection1lat = ($Ycrosssection1lat);         $Xcrosssection1lon = ($Xcrosssection1lon);         $dLat = ($pointlat - $Ycrosssection1lat);         $dLon = ($pointlon - $Xcrosssection1lon);         $a = sin(deg2rad($pointlat)) * sin(deg2rad($Ycrosssection1lat)) + cos(deg2rad($pointlat)) * cos(deg2rad($Ycrosssection1lat)) *sin(deg2rad($dLon));         //$c = 2 * atan2(sqrt($a), sqrt(1 - $a));         //$d = $R * $c;         $a = rad2deg($a);         $d = acos($a);         $miles = $d * 60 * 1.1515;                   $Distance = ($miles); // feet         var_dump($Distance);          }     $IntersectionDAN = IntersectionDAN(40.124423,-74.326886, 40.124561,-74.327066,40.124561,-74.326886);      In addion we have been working on a much more complex version and are completely stuck and getting the incorrect results back.               public function intersection($line1Lat, $line1Lon, $line1bear, $line2Lat, $line2Lon, $line2bear, &$line3Lat, &$line3Lon)     {      $pi = pi();         $line1Lat = $line1Lat * $pi / 180;         $line1Lon = $line1Lon * $pi / 180;         $line1bear = $line1bear * $pi / 180;         $line2Lat = $line2Lat * $pi / 180;         $line2Lon = $line2Lon * $pi / 180;         $line2bear = $line2bear * $pi / 180;         $dst12=2*asin(sqrt((sin(($line1Lat-$line2Lat)/2))*(sin(($line1Lat-$line2Lat)/2)) +cos($line1Lat)*cos($line2Lat)*(sin(($line1Lon-$line2Lon)/2))*(sin(($line1Lon-$line2Lon)/2))));         if (sin($line2Lon-$line1Lon)<0)         {            $crs12=acos((sin($line2Lat)-sin($line1Lat)*cos($dst12))/(sin($dst12)*cos($line1Lat)));            $crs21=2.*$pi-acos((sin($line1Lat)-sin($line2Lat)*cos($dst12))/(sin($dst12)*cos($line2Lat)));         }         else         {            $crs12=2.*$pi-acos((sin($line2Lat)-sin($line1Lat)*cos($dst12))/(sin($dst12)*cos($line1Lat)));            $crs21=acos((sin($line1Lat)-sin($line2Lat)*cos($dst12))/(sin($dst12)*cos($line2Lat)));         }              $ang1=(crs13-$crs12+$pi)%(2.*$pi)-$pi;         $ang2=($crs21-crs23+$pi)%(2.*$pi)-$pi;              if (sin($ang1)==0 && sin($ang2)==0)         {             echo "infinity of intersections";         }         elseif (sin($ang1)*sin($ang2)<0)         {             echo "intersection ambiguous";         }         else         {            $ang1=abs($ang1);            $ang2=abs($ang2);            $ang3=acos(-cos($ang1)*cos($ang2)+sin($ang1)*sin($ang2)*cos($dst12));            $dst13=atan2(sin($dst12)*sin($ang1)*sin($ang2),cos($ang2)+cos($ang1)*cos(ang3));            $line3Lat=asin(sin($line1Lat)*cos($dst13)+cos($line1Lat)*sin($dst13)*cos(crs13));            $dlon=atan2(sin(crs13)*sin($dst13)*cos($line1Lat),cos($dst13)-sin($line1Lat)*sin(lat3));            $line3Lon=($line1Lon-$dlon+$pi)%(2*$pi)-$pi;         }     }          public function bearing($lat1, $lon1, $lat2, $lon2)     {         echo " Bearing Start ";         $pi = pi();         $lat1 = $lat1 * $pi / 180;         $lon1 = $lon1 * $pi / 180;         $lat2 = $lat2 * $pi / 180;         $lon2 = $lon2 * $pi / 180;         $dLon = ($lon2 - $lon1);         $y = sin($dLon) * cos($lat2);         var_dump($y);         $x = cos($lat1)*sin($lat2)-sin($lat1)*cos($lat2)*cos($dLon);         var_dump($x);         echo " Bearing Stop ";         return (atan2($y, $x) + (2*$pi))%(2*$pi) * 180 / $pi;     }          public function destination($lat, $lon, $bearing, $distance, &$outputLat, &$outputLon)     {         $R = 6378.137; //km         $pi = pi();         $distance = $distance / 3.2808399 / 1000; //input feet to km         $outputLat = asin(sin($lat * $pi / 180)*cos($distance/$R) + cos($lat * $pi / 180)*sin($distance/$R)*cos($bearing * $pi / 180)) * 180 / $pi;         $outputLon = ($lon * $pi / 180 + atan2(sin($bearing * $pi / 180)*sin($distance/$R)*cos($lat * $pi / 180), cos($distance/$R)-sin($lat * $pi / 180)*sin($outputLat * $pi / 180))) * 180 / $pi;     }          public function crossProduct(&$v1, &$v2, &$vR)     {         $vR[0] = (($v1[1] * $v2[2]) - ($v1[2] * $v2[1]));         $vR[1] = -(($v1[0] * $v2[2]) - ($v1[2] * $v2[0]));         $vR[2] = (($v1[0] * $v2[1]) - ($v1[1] * $v2[0]));     }          public function normalize(&$v1, &$vR)     {         $fMag = sqrt((pow($v1[0], 2)) +             (pow($v1[1], 2)) +             (pow($v1[2], 2))         );              $vR[0] = $v1[0] / $fMag;         $vR[1] = $v1[1] / $fMag;         $vR[2] = $v1[2] / $fMag;          }          public function magnitude(&$vR)     {         $fMag = sqrt((pow($vR[0], 2)) +             (pow($vR[1], 2)) +             (pow($vR[2], 2))         );         return $fMag;     }          /**      * Determine distance between point and line in feet      *      * @param $xpoint1      * @param $ypoint1      * @param $xline2      * @param $yline2      * @param $xline3      * @param $yline3      * @return float      */          public function pointToLineDistance($pointLat, $pointLon, $line1Lat, $line1Lon, $line2Lat, $line2Lon)     {              if ($line1Lat < $line2Lat)         {             $temp1 = $line1Lat;             $temp2 = $line1Lon;             $line1Lat = $line2Lat;             $line1Lon = $line2Lon;             $line2Lat = $temp1;             $line2Lon = $temp2;         }         $lineBear = $this->bearing($line2Lat, $line2Lon, $line1Lat, $line1Lon);         echo "lineBear ";         var_dump($lineBear);         if ($lineBear > 180)         {             $temp1 = $line1Lat;             $temp2 = $line1Lon;             $line1Lat = $line2Lat;             $line1Lon = $line2Lon;             $line2Lat = $temp1;             $line2Lon = $temp2;         }         echo "line1Lat ";         var_dump($line1Lat);         echo "line1Lon ";         var_dump($line1Lon);         echo "line2Lat ";         var_dump($line2Lat);         echo "line2Lon ";         var_dump($line2Lon);         $v1bear = $this->bearing($pointLat, $pointLon, $line1Lat, $line1Lon);         echo "v1bear ";         var_dump($v1bear);         $v2bear = $this->bearing($pointLat, $pointLon, $line2Lat, $line2Lon);         echo "v2bear ";         var_dump($v2bear);         $v1dist = $this->pointToPointDistance($pointLat, $pointLon, $line1Lat, $line1Lon);         echo "v1dist ";         var_dump($v1dist);         $v2dist = $this->pointToPointDistance($pointLat, $pointLon, $line2Lat, $line2Lon);         echo "v2dist ";         var_dump($v2dist);         $v1[0] = sin((180-($v1bear-$lineBear)+360)%360 * $pi / 180) * $v1dist;         $v1[1] = cos((180-($v1bear-$lineBear)+360)%360 * $pi / 180) * $v1dist;         $v1[2] = 0;         echo "v1";         var_dump($v1);         $v2[0] = sin(($v2bear+$lineBear+360)%360 * $pi / 180) * $v2dist;         $v2[1] = cos(($v2bear+$lineBear+360)%360 * $pi / 180) * $v2dist;         $v2[2] = 0;         echo "v2";         var_dump($v2);         $vR = null;         $this->crossProduct($v1, $v2, $vR);         echo "vR";         var_dump($vR);         $mag = $this->magnitude($vR);         echo "vR mag";         var_dump($mag);         $mag2 = $this->pointToPointDistance($line1Lat, $line1Lon, $line2Lat, $line2Lon);         echo "line mag";         var_dump($mag2);         $d = $mag / $mag2;         echo "result";         var_dump($d);         //$R = 6378.137;         //$d = $d * 1000 * 3.2808;         return $d;      Our goal is to have an accurate Point to Line Segment Calculation so point C can be compared against Line AB Sorry for the confusion here and hope you can help Thanks!


title: Can't export a polygon shapefile to MySQL using ogr2ogr?

text: I am having problems with ogr2ogr and keep getting different versions of the error: ERROR 1: MySQL error message: The used table type doesn't support SPATIAL indexes. Description: ALTER TABLE 'test_poly' ADD SPATIAL INDEX('SHAPE') my command (entering it in FWTools Shell) is: ogr2ogr -f "MySQL" MYSQL:"test,host=27.0.0.1,user=root,port=3306" -nln test_poly -a_srs "EPSG:3857" -update -overwrite ...adding '-lco GEOMETRY_NAME ' doesn't do anything... ...also moving the ti tge ebdm behind -lco engine=MYSIAM does nothing... All I see is the tables 'geometry_columns' and spatial_ref_sys' and 'test_poly' being created...but no data *(i.e. when I use "Select Rows - Limit 1000"). What am I missing? I am a bit new to MySQL...but I read as much documentation as I could find...I thought I could set the spatial index by going to Engine: MYSIAM....am I wrong?


title: Why can't I see some polygon labels?

text: I create some features of polygon. And then, I put label with labeling from tool bar. I could confirm label of few features. On the other hand, I could not see the label of another features. I try to change scale, place of label and coloring. Still I can not see some label. Is there any reason? Is this a bug of QGIS? I am using Qgis 1.8.0 with Windows 7.


title: How to query all records (>1000) and export to csv?

text: I posted in arcgis forum but never got any answer. Can anyone tell me how to solve this? Assume you have a vehicle tracking records from Oct.1 to Dec. 31 with wind speed information. All data is saved in geodatabase (sde-sqlserver) and up in ArcGIS Server 10.1 as feature layer. A time slider show the locations of a car with wind speed. When a user change a time-range (eg. Oct.2 - Oct.4), first query task (for count) calculate the number of features within the range. There are usually more than 1000 results even two days (eg. 1750) (I don't want to change this limit though). I used another query task (executeforIds) to keep all records in hand but reduce the amount with modulus (1/10) which is still enough number for making a nice chart for an overall trend of wind speed. However, I also want to provide an option to download a whole dataset in csv (in this case 1750 rows) Here, I used findtask to retrieve attribute dataset within the time-range.               try {         //console.log(app.objIDs);         var attribs;         csvdata = "";              var find = new esri.tasks.FindTask("http://xyz.com/arcgis/rest/services/Realtime/Car_Wind_WM/MapServer");         var params = new esri.tasks.FindParameters();         params.layerIds = [0];         params.searchFields = ["OBJECTID"];              for (var i = 0; i < app.objIDs.length; i++) {             params.searchText = app.objIDs[i];             find.execute(params, function (results) {                 attribs = results[0].feature.attributes;                 csvdata += attribs.Date_Central + ',' + attribs.Longitude + "," + attribs.Latitude + "," + attribs.windspeed + "\n";                 console.log(csvdata); //1             }, function (error) {                 alert("Error");             });         }     } catch (error) {         alert("Change the time range first");     }     console.log(csvdata); //2     setTimeout(function () {         formatData(app.csvdata);     }, (3 * 1000));      csvdata was undefined at console.log2, although all csvdata (in console.log1) show data in console. The issue seems timing of find.execute complete, so I added setTimeout. This seems work but when i increase the time-range, it won't obviously. Is there anyway to keep all records (1000 - 200,000) in a specific time range and export to csv? Any ideas/help appreciated! Thanks


title: Issues while changing ArcSDE from a Workgroup to Domain Environment

text: Our organisation was a having a multi-user Geodatabase ( ArcSDE 10.1 gateway on an Oracle 11 g DB) in a Workgroup configuration. The type of Authentication for DB connection was "Database authentification" Now Our IT is moving ahead with a New Domain/Active directory based Server access - This means the existing workgroup users will be changed to Domain users. Now I though the new users will be able to access the ArcSDE connection using same old Database Username and password. But encountering an error : Failed to connect to specified server : ORA-12154 : TNS : could not resolve the connect identifier specified.No extended error What does it mean and whats the way forward, if we prefer not to disturb existing connections/usernames , but wanna change to Domain.


title: ArcPad Raster Not Displaying Correctly

text: I have a hillshade that I would like to use as a background in an ArcPad 10 map. I get everything set how I want in in ArcMap and when I export the map to use on my Trimble the hillshade doesn't show up right: ![enter image description here](http://i.stack.imgur.com/aXLK5.png) The locations of each image are not exact but you get the idea. I've tried forcing it to TIFF, JPEG2000, and using the native format. Nothing seems to work. Initially the raster was stored in a geodatabase, so I tried converting it to a TIFF and exporting it from there - when I do that the image doesn't even load in ArcPad. EDIT - I've now also attempted to load the raster directly onto the Trimble and then load it as a layer in an empty APM rather than use the one created when I used the 'Get Data For ArcPad' button on the Arcpad Data Manager Toolbar in ArcMap. Still nothing seems to work, the raster just will not display. The raster isn't huge, about 110 MB, 32 bit, unsigned integer, and I've checked the projection about 40 times, everything is in the same projection. What am I missing about how to get background rasters to display correctly in ArcPad? Should I be using a different file format?


title: Efficient way to handle NA values from analysis in R with Raster

text: I am not 100% sure if GIS is the correct stackexchange for this, but here we go. A problem I have been bested by: I have a raster layer of approximately 240 million cells. It could be a DEM or anything similar. I also have a series of sampling-site polygons of irregular shape located throughout the extent of the DEM but only occupy about 0.1% of the space. I am using statistical tests to compare the distribution of values (elevations in this example) between the sample-site locations and the overall DEM (considered background values). I have used the MASK() function in the Raster package of R to extract the the DEM values where they intersect non-Null values of the sample-site raster. It returns a raster that is 99% NA and the remainder are the values at the sample sites. From here, I draw roughly 50K random samples from the DEM and I test them against the distribution of values at sampling-site locations. However, I have only found the most inefficient ways to remove or ignore the NA values (eg. `x <- na.omit(y)`) *edited to add: What is an efficient way to extract the values from the sampling-site raster into a vector that contains no NA values? I aware of the `na.rm` flag fro some functions in the raster package, but I have not used it to success.   I have successfully implemented this general process by turning the sampling- site raster into cell centroids within sampling-sites and extracting values, but that has extra steps. I apologize for being so verbose, but I would appreciate any and all ideas. edit* this is the most effective way I have found is `site_smpl_freq <- as.data.frame(freq(site_smpl, useNA='no', progress='text')` but it still takes a few minutes to run edit* to add a code example.                   ###sample background data and put in data frame         rand_smpl <- sampleRandom(raster("DEM"), collapse =''))),50000)         rand_smpl_freq <- as.data.frame(count(rand_smpl))              ### then a bit that modifies the table if values exceed a certain threshold              ### extract raster values at the location of sampling-sites         sites_extract <- mask(DEM, sampling_sites_raster)              ### Here is where I create the freq table using the useNA option         ### It works, but it takes a long time and seems inefficient         site_smpl_freq <- as.data.frame(freq(sites_extract, useNA='no', progress='text'))              ### then I modify the table as above if values exceed a certain threshold         ### This is followed by some manipulations that add columns for cumulative counts and percentages, then to ggplot()


title: Create point geometry in a feature class with all the attributes prepopulated

text: So here is the problem. I have a text file with space delimited values. A standard text file with the headings separated by spaces and then on each next line values for these headings (columns) also separated with spaces. Each row represents a certain geographic point feature; however no coordinates (XY- pair) are stored in this text file. My ultimate goal is to view each row in ArcMap individually (like one can do with the attribute table in ArcMap), edit the attribute values (if needed) and specify the point geometry of the feature by clicking on a map. And here is my issue – it seems as I cannot create a feature class without SHAPE field, but because I don’t have any coordinates in the source text file I cannot populate SHAPE field upon creating a new feature class. What is the most efficient way of achieving this? I am a bit puzzled due to the workflow when all the attributes are populated yet the geometry is to be created. Ideally the solution would be to let user see the attribute table (obtained from the text file), then user selects a certain row user wants to work with, she digitizes a point on the map and the SHAPE field is populated with this point geometry. I understand that this is not how ArcMap was designed, but how one can come closest to this without investing too much in writing an advanced add-in or using ArcObjects? I have considered so far:   * creating a feature class from this text file with some random coordinates, but it is not an applicable alternative because to edit a point feature a user would need to zoom to this point and then move it to another geographic area (using the ArcMap editing session). Since the geographic extent of the points in this collection might be quite large, it would be nearly impossible to use this approach.   * creating a geodatabase table from the text file and then let user click on the map to digitize a map point which would represent a certain row in the table (however creating a point feature in a separate feature class). Thereafter, user can choose to transfer all the attributes of a geodatabase table row to the newly created feature (was thinking of using arcpy.da.UpdateCursor here or running a Python script with the join table & feature class > export logic). However, this would imply that when user digitizes a point feature, he would need to enter a custom ID that would match the ID of the row in the table. Right now it seems as there is no maintained unique ID heading in the text file and since multiple text files can be received independently, this approach looks also pretty cumbersome. Any other suggestions folks?


title: Need Basic Viewer template for ArcGIS JSAPI 3.2/3.3

text: I am looking for basic viewer for ArcGIS JSAPI but not getting proper sample/example. I am going through ArcGIS resource also but looks like its not working .Going through this question also. checking out layout example and getting confused that what is difference between Viewer template and layout?? So any help regarding this will be great !! thanks in advance : )


title: ArcGIS Javascript Viewer with ArcGIS Server

text: I'm certain this question must have been asked/answered, but I just can't find it. I'm running ArcGIS Server and want to build a basic viewer that points to my locally hosted services. I'm not interested in doing anything with ArcGIS.com; however all the examples hosted at esri illustrate interfacing with ArcGIS.com. How can I point to my local map? Alternatively, can you point me to where I can find the answer (as I'm certain this must have been asked already)


title: Plotting large numbers of objects on a chart using R and WKT format

text: I am retrieving thousands of geometry lines in WKT format from a Microsoft SQL Server database. I would like to plot all of those lines in one map, but I am having some difficulty with the code. How should I modify the following code to reach my goal?               library(RODBC)          png(file="examplex.png", width=600, height=480)     setwd("C:/ArcR")          con <- odbcDriverConnect('driver={SQL Server};server=SERVERNAME;database=DBNAME;trusted_connection=true')          objects_1 <- sqlQuery(con, 'SELECT TOP (1) Shape.STAsText() as ShapeWKT FROM TABLENAME ;')          things <- vector("list", 1)          z = 0     for(line in objects_1$ShapeWKT)     {       {         things[[z+1]]<-readWKT(line)       }       z = z + 1     }          plot(things[[1]])           dev.off()      Yes, the code does refer to only one returned record, but I wanted to start the question with code in working order, for those who may not know the answer, but are still capable of testing possibilities.


title: Mapping Instagram Photos

text: Is there a tool I could use to map Instagram photos that are using a specific tag? I don't necessarily want to show the image on a map, but rather a pin that someone could hover over to see the image. To add context, I'm developing a game and would like to include such a feature on the community website.


title: How to export drivingDistance results in pgRoutingLayer on QGIS 2.2.0?

text: Hi and first of all congratulation for the great work on working and explaining the posGIS functions in QGIS : it makes this rich GIS enven richer. Thank's to Underdark's pgRoutingLayer extension, I built a routable network and tested it with Dijksatra function, wich worked percfectly. Trying the next step toward an isochrone map, I tried the drivingDistance function. I get a map of the points correctly answering the query but the "export" button is disabled and I did'nt find a way to at least get a table indicating the travelling cost for each point. It's a bit frustrating knowing the data are somehere around (shown as red crosses on the map) but not being able to get them ! ;-) I'm running QGIS 2.2.0 on a win64 system, PostgreSQL 9.1, Postgis pg91x64-2.0.6-1 and re installed the pgRouting Layer extension from the extension manager of QGIS... (hope I don't foget indicating something). Thank's to everyone able and willing to give me a little light on this. Bouns


title: How to convert data from a .gdb into a shapefile without ArcMap?

text: I have a .gdb folder with LOCK Files, FREELIST Files, ATX Files, GDBINDEXES Files, GDBTABLE Files, GDBTABLEX Files and, SPX Files. I want to convert the parcel data within this folder into a shapefile so that I can load it into Arc GIS online. If I still had my ArcGIS desktop version this would be a simple task however, I no longer have access to this version of the software. Any ideas on how to get this parcel data into a shapefile? I haven't tried downloading QGIS yet so I'm not sure if this software would have that capability as ArcGIS 10.1 did


title: Copy and Paste symbology in Raster?

text: ![enter image description here](http://i.stack.imgur.com/B6Q1r.jpg) I am trying to figure it out how can I take a preserved color from a raster I already set up before and then apply the colormap to a new raster file? Here are the details of what occurred: Before I export it to a Imagine file, the shade relief was in grid file and I change the color ramp and made the edits of the colors I want and save it the style in Arcmap 10. When my ArcGIS 10 was installed last December 2012 and in about a month or so my ArcGIS 10 had problem, so I had to re-install my ARCGIS 10 to correct a problem. Now that my style file I saved the color I want got lost/ or missing and could not find it. Is there a way that can I get the colors from the raster I have and to apply a new shade relief? This is the picture I want the colors to transfer to another raster. as of May 1, 2013 my ArcGIS has been upgraded to 10.1 .


title: Adding GUID field with ArcObjects

text: I'm trying to add a GUID field programmatically to an existing FeatureClass using ArcObjects. Here is my code:               ISchemaLock schemaLock = (ISchemaLock)ipFC;          try     {         // A try block is necessary, as an exclusive lock may not be available.         schemaLock.ChangeSchemaLock(esriSchemaLock.esriExclusiveSchemaLock);              //Ajout d'un champ GUID         IFieldsEdit pNewFieldsEdit = (IFieldsEdit)ipFC.Fields;         IField guidField = new FieldClass();         IFieldEdit guidFieldEdit = (IFieldEdit)guidField;         guidFieldEdit.Name_2 = "OldGlobalID";         guidFieldEdit.Type_2 = esriFieldType.esriFieldTypeGUID;         guidFieldEdit.DefaultValue_2 = null;         guidFieldEdit.IsNullable_2 = true;              pNewFieldsEdit.AddField(guidField);     }     catch (Exception exc)     {         // Handle this in a way appropriate to your application.     Console.WriteLine(exc.Message);     }     finally     {         // Set the lock to shared, whether or not an error occurred.         schemaLock.ChangeSchemaLock(esriSchemaLock.esriSharedSchemaLock);     }      Everything seems to work (no error) and it's based on an documentation example. Unfortunately, when I click on the feature class in ArcCatalog and open the table preview, I have this message showing: ![enter image description here](http://i.stack.imgur.com/0F5t3.jpg) Also, the table open in the preview, but it's all empty (header and row) with 308 records(the correct number of row in the feature class). What am I doing wrong? **EDIT** If I check the properties of my feature class, the new field seems to be there: ![enter image description here](http://i.stack.imgur.com/QLVc0.jpg) But the preview looks like this right after the error message...: ![enter image description here](http://i.stack.imgur.com/dRBbR.jpg) Any ideas? **EDIT 2** I discovered that when I restart ArcCatalog and go back in the properties, the new field is gone and there is no problem opening the table preview, but the new field is nowhere to be found. Maybe there is a function to "Save" everything after the field has been added?


title: Setting defaults in the 'Select By Attribute' SQL editor

text: Is there a way to set default values in the 'Select By Attribute' SQL editor (the where clause) ? I want to set a permanent value that will appear every time I enter the 'Select by Attribute' window, like in this pic: ![alt text](http://i.stack.imgur.com/4mw00.jpg) It doesn't matter to me if it'll appear in all layers that will be selected or only in specific ones. Oh, and I'm using ArcGIS 9.3.1. Thanks in advance.


title: Can one expose variables to the Python console from a plugin in QGIS?

text: I have a QGIS plugin that performs a long-running operation, eventually producing and loading new shapefiles into QGIS. (I have this as a plugin rather than just a function that can be called from the console because the console doesn't work very well for long-running operations.) Internally, the plugin creates a complex Python data structure. I would like a user to be able to access this data structure from the QGIS Python console. I know that this could be done by serializing the data structure to a file and then loading it from a file (slightly more difficult in this case because the data structure cannot be pickled) but I am wondering if there is some sort of global variable inside QGIS to which I can assign my data structure from the plugin so that it can be directly used from the Python console.


title: Calculating walking routes along a network(ArcGIS)

text: I've created a network consisting of footpaths, dirt tracks and junctions. I would like to calculate a route using network analysis by giving ArcMap the time and walking speed that the route should be, and then getting back a route with the same beginning and end point, so for instance I'll calculate a route travelling at 1m/s or 4km/hr for 15 minutes. I then would like a 1km route to be calculated back to me. Additionally it would be helpful if I could be told what part of the route is passing junctions, along a footpath etc. These are stored in an attribute field in the attribute table. Any insight would be greatly appreciated.