title: Is there any way to configure MapFish config.yaml from Javascript?

text: I am using the mapfish print module in my webmapping application.In that I need to have various mapfish print layouts with different background pdf options. For that, am I need to create each config.yaml? or can we configure it from client side (from javascript)? System: Windows XP / Tomcat7 / Geoserver 2.4.0/printing-2.1-SNAPSHOT.jar For Example:                #===========================================================================      A4 portrait:     #===========================================================================     mainPage:       pageSize: A4       landscape: false       rotation: true       backgroundPdf: '${configDir}/MyCompany.pdf' #Here I need to change as per the client template            items:            - !columns                     absoluteX: 50           absoluteY: 690           width: 502           config:             borderWidth: 0.3             cells:               - padding: 2           items:             - !map               width: 500               height: 600      and my javascript code for layers:                   var printurl = 'http://xxx.xxx.x.xx:8080/geoserver/pdf/print.pdf?spec={' +     '"layout":"A4 portrait",' +     '"srs":"EPSG:404000",' +     '"units":"m",' +     '"dpi":300,' +     '"outputFilename": "mapPrint",' +     '"layers":[{"baseURL":"http://xxx.xxx.x.xx:8080/geoserver/cite/wms",' +                 '"opacity":1,' +                 '"singleTile":false,' +                 '"customParams":{},' +                 '"type":"WMS",' +                 '"layers":["Oxford_Map"],' +                 '"format":"image/png",' +                 '"styles":[],' +                 '"overview":true' +               '}],' +       '"pages":[{' +                 '"center":[' + osMap.getCenter().lon + ',' + osMap.getCenter().lat + '],' +                 '"mapTitle":"Sample Title",' +                 '"comment":"This is the map comment",' +                 '"scale":200000,' +                 '"rotation":0}' +                ']}';                    window.open(printurl);        Kindly suggest me the solution to achieve this. Thanks in advance


title: Is there a name for a situation when the place is clearly or unclearly named?

text: This is not specific to any system. Suppose there's a large red rock on a terrain which can be easily found and clearly seen and there's an artificial object such as a mall near that large red rock. That object could have a name that matches its location such as "Large Red Rock Mall" and so it would be intuitive to look for that mall near that rock or it could have some mismatching name that would make the search much harder. I'm pretty sure this arises in GIS systems and causes people to place some kinds of metainformation next to such badly named objects. Is there a widely used term for these two situations that would mean something like "how well the object name matches its location"?


title: What is the best plain text format for georeferenced raster data?

text: I have to translate satellite images in a file in `.txt` format or another, such as Excel or `.csv`, in which there are pixel values corresponding to (longitude,latitude) couples. What is the best file format to store this (in terms of dimension and limits of the file because pixels number is in the order of 10^5)? In your experience, is a matrix format representation better or a columns representation (one column is for longitude, one for latitude and one for value, so every row of the text corresponds to a pixel)?


title: Impossible to sum rasters because of nodata pixels

text: I have a set of rasters (.vrt) with daily soil moisture data. I want to sum the pixels of all rasters in order to have a measure by month. However, the whole world is not covered each day, which results in nodata values at places where measures exist for the other days. What I want to do, is sum the values of each raster. However, it seems that each time a nodata pixel is in the sum, the resulting pixel is directly categorized as nodata. **I would like to have the opposite: ignoring all nodata values and summing the rest.** I thought of 2 ways of solving the problem:   1. summing rasters ignoring nodata values    2. converting nodata pixels to value 0, then sum all the rasters ![enter image description here](http://i.stack.imgur.com/UH9Wx.jpg) Unfortunately, I can't find any tool to do this. Can anyone help me?


title: How to find out to which road each points belongs to?

text: I am new to GIS . I hava a folder it include a .mxd file and a .gdb folder, the .gdb folder hava many .gdbtable and .gdbindexes files etc, it's a road network data of a city. Now, I want to know which road it belongs to for a given latitude and longitude, which software or sdk should I use? is there have a similar open source project?


title: How to use GRASS with HEC-RAS?

text: I am trying to use HEC-RAS for the flood modelling of my flood simulation. How do I use the text file output of HEC-RAS with the GRASS script r.inund.fluv?


title: Why do you use ArcGIS for Desktop?

text: I'm new to GIS, having only dabbled with ArcGIS for Desktop for about 4 weeks in 2007. The business I am at wants to target writing complete solutions that involve GIS as it would benefit their hardware sales. They do not know which market they want to target but want me to pick the GIS software to use, yet I am very green to GIS markets. All i know if target platforms are windows, windows mobile, android and web applications. The idea of mobile applications means data connection is not 100% so internet based services may need to be ruled out, i.e. GoogleMaps. I was struggling to work out how to phrase this as a question, given the huge range of GIS products available, Esri's ArcGIS for Desktop, CadCorp, MapInfo, GoogleMap/Earth, qGIS, Manifold, openJump, openstreetmap etc. To avoid the what do I buy question, I instead ask **the question** why do you use Esri ArcGIS. From my experience its slow to navigate around maps and quite verbose to program in causing quite a lead time in development. Esri is also the most expensive product on the market, and i believe also the most popular. But why do people continue to use it, when other systems like CadCorp have the same functionality if not more, seem to be more responsive, can import Esri data and cost less. I feel that I must be overlooking something here. I know client demands in some industries like defense, want Esri but why is it still so popular, given I often hear how other products are betters (Is this a Windows vs. Mac example on market share vs. quality) P.s. This question has been spawned from **this one on StackOverflow**.


title: How to save selected feature("polygon") as image from the shape file using C#?

text: I am new to ArcGIS and trying a do following things..               1) Select polygon in the loaded shape file.(right click on polygon -> choose option  (select features).          2) Click button (build as Add-in) in C# on the toolbar and selected polygon save as image at specific location.      Thanks in advance.


title: Where can I get polygons for the Municipalities of Puerto Rico?

text: I'd like to find GeoJSON files to draw the polygons of municipalities of Puerto Rico. It might be nice get the Nokia Map (or any reasonable publicly available map) of the same regions and overlay the results.


title: Why are edits in shapefile table not saved?

text: I have created a shapefile (point data) and wish to change some parameters in the files table data. I can edit the data and see the coresponding change in my my symbology. However, when I save the shapefile, the data and symbology revert back to the way it was before the edits. What am I doing wrong? I have a shape file of a series of points. One column in my table has values between 1 and 6 that show up as color-coded points on my map. The data for the column came from a spreadsheet that I had joined with the shapefile. I was trying to update certain values in the column (I set the shapefile so I could amend it, opened the table and changed the value. The color of the point on my map changed, however, when I tried to save the changes, the color (and value) reverted to the previous settings. I did find a way to make it work. I amended my original spread sheet in Excel and exported it as a dbf. I then unjoined the dbf and shapefile and rejoined with the new data. Don't know if that's the correct way, but it worked.


title: Is there a way to only append new data?

text: Is there a way to append only newly added records from a database to another database? I looked online and couldn't find an answer. I figured this would be somewhat straight forward. We have a working database that I want only append new records to our 'live' database. Both of them are File GDB. * * * Update 1 I have two File GDBs. One is a working GDB where users can make edits. The other GDB serves as a 'live' GDB which needs to get updated when the 'working' has changes made. Right now I have to stop the service remove the live database and copy over the working database in it's place, then starting the service again for every client. I was looking at a way to just copy the updated records so I don't have to stop the service and know that only new updates went to the live database. Should I put the live database on a SDE?


title: Whats a Python Script/Method to use to get the number of fields with data in an attribute table?

text: I am doing some data migration and need the number of records with actual data, sans null and blank fields, without switching back and forth with select by attribute. Ideally I would like to run a script for a table or feature class that gives me the count of each field that has data.


title: Measure average distance between two lines with common endpoints

text: I have two shapefiles, each with a set of lines generated from start and end points. One shapefile has the straight lines generated from the XY To Line tool, while the other has lines generated from a least cost path tool in Python. ![enter image description here](http://i.stack.imgur.com/aS26Z.png) I am looking for a method to quantify the error or distance between them, something that attempts to capture the overall variation between the two lines, not just the greatest or shortest distance between them (The shortest distance would also be 0 as they have the same start and end points). I have considered closing them into polygons, then dividing the area by the straight- line distance to get an 'average polygon height'. I have also considered converting one set of lines into points and then averaging the distances generated from the Near tool for each line feature. However to do this I would have to delete the end points as they are essentially false '0' distances. Are there other methods to compare these features? An important aspect to note is that sometimes the least cost path line crosses over the straight line so I would often have two polygons.


title: Best simple GIS for Estate inventory and mapping

text: I think my GIS needs would be considered simple for the 3500 acre estate I manage:   1. **create maps** of our roads, trails, fields, and buildings, and **show distances** on the roads and trails;    2. **calculate areas** in SF or acres for tasks such as fertilizing fields or forestry projects. It would be nice if I could produce a database of the results so I can automatically calculate the miles of certain road types we have, water resources, or the acres of various areas to be fertilized or timbered. I want to **use layers of satellite photos or topo maps** (which I can geo-locate), my drawing layers, and **import Garmin data** also. I guess that can be done with a pretty simple system, no? I use fGIS (Forestry GIS) which was free but buggy, with no hope of being fixed now that they stopped updating the free version. It was relatively easy to learn, but extensive **editing of polygon areas** leaves visual anomalies, and the database does not update reliably when editing areas. Very frustrating. What's out there that can do my simple tasks (reliably) without having to learn a lot of complex things I'll never use. I'll pay for a simple program (up to $200?) if that's what it takes to get reliability. Thanks in advance for your suggestions!


title: Compute the area of a given polygon (in vector format) lying between specified lines of latitude

text: I have species distributions (in vector format) and I would like to calculate how much of the area for a given species distribution is within certain lines of latitude, such as temperate and tropic zones. Using the Wikipedia definition: The north temperate zone extends from the Tropic of Cancer (approximately 23.5° north latitude) to the Arctic Circle (approximately 66.5° north latitude). The south temperate zone extends from the Tropic of Capricorn (approximately 23.5° south latitude) to the Antarctic Circle (at approximately 66.5° south latitude). Thus, the tropics would be between 23.5° south latitude and 23.5° north latitude. For example, using this shapefile of the Atlantic Ocean (choose shapefile in the drop-down menue) plotted on a worldmap, one could easily calculate the total area of the Atlantic Ocean;               require(sp)     require(ggplot2)     require(rgeos)     require(rgdal)     require(maps)          setwd("~/test/iho")     ao <- readOGR(getwd(), layer="iho")     aof <- fortify(world, region="name")          # Not necessary for the calculation per se, but still nice. Although not the best looking map     world <- map("worldHires", col="gray90", fill=T)          # Plot      pp <- ggplot(data = world, aes(x = long, y = lat, group = group)) +     geom_polygon(fill = "grey50") +     geom_polygon(data = AO, aes(x = long, y = lat, group = group), fill = alpha("cyan", 0.5)) +     coord_equal()          # Total area     gArea(SpatialPolygons(ao@polygons))     [1] 7512.821      But how could we restrict the calculation of the area to specified lines of latitude, e.g. tropic and temperate zones as defined above? Any pointers on this would be highly appreciated, thanks! Plot ![enter image description here](http://i.stack.imgur.com/Xxzhi.jpg)


title: Error when using ServerStyleGalleryClass (Arcobject)?

text: First, I used: IStyleGallery styleGallery = new StyleGalleryClass(); I can run my program without error (on my computer). But this require using ESRI.ArcGIS.Framework (need install Arcgis Desktop). And, I can't use for my client computers. So, I used ServerStyleGalleryClass, and I used "MakeServerStyleSet" utility to convert my style file into server style. Then, I used below codes, but I got the error " **Error HRESUT _EFAIL has been returned from a call to a COM component** " (because after getting Items, styleItems is NULL)                       IStyleGallery styleGallery = new ServerStyleGalleryClass();                  IStyleGalleryStorage styleStor = (IStyleGalleryStorage)styleGallery;                         string startupPath = Environment.CurrentDirectory;                       string strFilePath = startupPath + "\\Data\\Styles\\SoDo.ServerStyle";             styleStor.AddFile(strFilePath);                  IEnumStyleGalleryItem styleItems;                              styleItems = styleGallery.get_Items("Line Symbols", strFilePath, "Default");  // Return NULL value             styleItems.Reset();             IStyleGalleryItem styleGalleryItem = styleItems.Next();      Are there anyone know what's wrong ? Thanks and regards, Tai


title: Surfer problem - overlapping grd bln

text: I have the following problems with Surfer: 1, I have a grid file and a bln but i'm not sure that they overlap each other exactly. I set the coordinate system with grd and bln! (WGS84) but there is no changes happend... ![enter image description here](http://i.stack.imgur.com/N7CKi.png) 2, I tryed to blank the grid file around bln but i got this message: ![enter image description here](http://i.stack.imgur.com/fkWZl.png) Does anyone can help me how to fix the exact position to overlap each other and blank the grid around bln?


title: Creating random location within a network from a given location and a given distance

text: For a habitat selection study, I am trying to identify availability. My species lives along waterbodies and I could assess distances moved between two consecutive locations using the network analyst (Calculating distances between consecutive points along rivers (polygon) using ArcGIS Desktop?). I would like to get a potential location the animal could have reached within the same distance. For better understanding: I have location A and the distance d from location A to B I have a network of rivers and other waterbodies I now want to get the location C using A as a starting location and distance d as the distance along the network. Is that possible to do and if so, how? Or do you have any recommendation how to proceed? Thank you already in advance for your help.


title: How do you duplicate a point within a shapefile using Python?

text: How do you duplicate a point within a single feature class using Python? I have a partial sample script below, but in a nutshell, I want to duplicate a point, copy it into the same shapefile, and populate the fields with user- provided strings. I suspect this is elementary, but I'm new at this and am frustrated with loops and cursors.               # Script tool will take a point file and allow the user to duplicate a single point     # while updating necessary field information. The purpose is not to delete or overwrite     # the original point object, but rather to add a duplicate point with the new information.     # This allows historical context for a point that spatially never changes, but who's      # fields are dynamic. No information is hard-coded.          import arcpy     # set up input variables for target folder and target dataset.     targetFC=arcpy.GetParameterAsText(0)  # this is the point file     targetKeyField=arcpyGetparameterAsText(1)  # this is the key field in the point file     newKeyID=arcpy.GetParameterAsText(2)  # must be duplicate of a string in targetKeyField     newField2 = arcpy.GetParameterAsText(3)     newField3 = arcpy.GetParamaterAsText(4)          # Add new fields to table     in_table = targetFC     field_name2 = "Field_2"     field_name3 = "Field_3"     field_type = "TEXT"     arcpy.AddField_management(in_table, field_name2, field_type)     arcpy.AddField_management(in_table, field_name3, field_type)          # Loop through targetFC to find a match between newKeyID and a string in targetKeyField     with arcpy.da.SearchCursor(targetFC, [targetKeyField, "SHAPE@"]) as cursor:               # insertCursor based on the match; duplicate the point in the table               # Populate the new cursor with the new parameters (newField2, newField3, etc)          # Error if the newParcelID does not match a string in the targetKeyField          # User is brought back to enter a new newKeyID string.


title: How to apply WHERE clause to relationship class using ArcObjects?

text: I'm trying to query objects related to objects and satisfying some query in ArcObjects. IRelationshipClass interface contains methods for getting all related objects but how can one filter them? I don't believe that such ability doesn't exist.


title: Labeling Issues with Geoserver

text: I have everything working on my geoserver except for the labeling. I have searched and I cannot find any solution. I am by no means an expert. I can modify the look/symbology of my polygons, lines, etc... but when I add a style that utilizes a label, nothing shows up on my map. I have created new labels with the sld files I downloaded directly from geoserver docs. I also changed the attribute field name that I want to use in my shapefile as the label. When I open the layer on the map, nothing shows up, not even the polygon. I am sure I have not enabled something. Any help would be appreciated... geoserver 2.4.1 Here is the sld I have recently tried: http://docs.geoserver.org/stable/en/user/styling/sld- cookbook/polygons.html#label-halo               <?xml version="1.0" encoding="ISO-8859-1"?>     <StyledLayerDescriptor version="1.0.0"         xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"         xmlns="http://www.opengis.net/sld"         xmlns:ogc="http://www.opengis.net/ogc"         xmlns:xlink="http://www.w3.org/1999/xlink"         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">       <NamedLayer>         <Name>Label halo</Name>         <UserStyle>           <Title>SLD Cook Book: Label halo</Title>           <FeatureTypeStyle>             <Rule>               <PolygonSymbolizer>                 <Fill>                   <CssParameter name="fill">#40FF40</CssParameter>                 </Fill>                 <Stroke>                   <CssParameter name="stroke">#FFFFFF</CssParameter>                   <CssParameter name="stroke-width">2</CssParameter>                 </Stroke>               </PolygonSymbolizer>                       <TextSymbolizer>                 <Label>                   <ogc:PropertyName>name</ogc:PropertyName>                 </Label>                 <Halo>                   <Radius>3</Radius>                   <Fill>                     <CssParameter name="fill">#FFFFFF</CssParameter>                   </Fill>                 </Halo>               </TextSymbolizer>             </Rule>           </FeatureTypeStyle>         </UserStyle>       </NamedLayer>     </StyledLayerDescriptor>


title: Can OSM's iD editor be used on custom maps?

text: I'm setting up a community-based mapping solution for a local NGO. They need their own maps and, after some consideration, I have decided to go with Mapperz suggestion and use MapBox. It's good to use MapBox technology as it is scalable, modifiable and, using their fantastic iD editor, should allow user edits. I cannot work out how to make my maps editable, however. To provide a concrete example, how would I add an editor that would allow this layer of points to be modified, allowing new users to create new points just like on OpenStreetMap (OSM)? I know it can be done with GeoServer, but want to retain the beautiful simplicity of MapBox for this one.


title: Does QGIS feature a tool like ArcGIS Data Driven Pages?

text: Has QGIS progressed to the point of having a Data Driven Pages type tool set yet? Or perhaps something similar to the old DS MapBook pre arcgis 10?


title: ArcGIS10 Highest point via polygon features

text: I am using **ArcGIS 10.0** with **3D Analyst** , **Spatial Analyst** and **Military Analyst**. I feel like I am halfway to solving a problem but do not seem able to completely solve it.   * I have a polygon shapefile with about 100 polygons and each one has a unique ID.    * I want to overlay that on a raster and then for each polygon extract the highest value.    * I used the **Military Analyst>Highest Point** and also **Spatial Analyst>Zonal Statistics** and they both work.    * However, the main thing I need in the output is what polygon it is linked to.    * It seems like the zonal statistics work on zones but the id of the zone from the polygon is not transferred to the output.  So how can I get the max values back to the polygon shapefile to update a field? Update: The solution I found was Zonal Statistics To Table in the Spatial Analyst Toolbox. I just selected ALL statistics.


title: QGIS Raster Calculator: Need values to be set to 0 instead of no data

text: I have a landcover map with different values for the landuse options e.g. 190 for commercially used areas. Now I want to extract only these areas using the Raster Calculator with the expression > "Raster@1" = 190 This works fine, the resulting Raster contains value 1 for all cells which where 190 before (as it is supposed to) but no data values (high negative values) for all other cells, which I need to be zero instead. When I did the same operation to other rasters, QGIS would set the other cells to 0, which in this case is necessary for me to add the result raster to another raster later on. Any ideas how I can avoid that QGIS sets the cells to no data cells? And what could be a reason that it deals differently with rasters of the same format when applying the same operation with the raster calculator? Both rasters are .tif but from different sources.


title: Can QGIS be used to develop a vectorization tool?

text: First off, I don't now the lingo so forgive me if I can't phrase this question using the appropriate language. I am thinking of writing a c++ program that can convert a simple "color map", that is a map of land data that is color coded by land type, ie: lake=blue, grass=green, shoreline=yellow etc. and turn it into a vector shape file assigning "adjustable" connecting points data between the shape file lines or curves of each shape. Possibly even adjusting the distance of one shapes to another shape by the third shape that is in between the two. For example shoreline (yellow) width adjusted from, grass (green) to lake (blue) edge, based on whether it is an inside curve (more distance) or outside curve (less distance). Question, does QGIS have the ability to do something like this or can it be programed to do this? If so, can someone point me to the appropriate terms to look into the documentation about it?


title: How can i use ArcGIS server 10 mapservices in openlayers?

text: I'm new in openlayers . i'd like to use mapservice of ArcGIS server 10 in open layers.I search and found examples of using an ArcGIS Server 9.3 Rest API layer for openlayers. I found OpenLayers.Layer.ArcGIS93Rest instance but not ArcGIS 10 . How can i use ArcGIS server 10 services in Openlayers? I wrote the below code . i use ArcGIS server 10 and The REST is working right .               <html lang='en'>     <head>              <title>My OpenLayers Map</title>            <script type='text/javascript' src='OpenLayers.js'></script>         <script type='text/javascript'>                  var map;                  function init() {                    map = new OpenLayers.Map('map_element',{});     var arcgis = new OpenLayers.Layer.ArcGIS93Rest("MyName","http://xxxxxxx/ArcGIS/rest/services/test/MapServer",                    {layers: "show:0,1,2,3,4"});                              map.addLayers([arcgis]);                              }              </script>     </head>          <body onload='init();'>     <div id='map_element' style='width:1000px; height:500px;'>     </div>     </body>     </html>      Thanks for advance


title: ArcGIS "Zoom to layer" scale

text: I'd like to quickly inspect the features in a feature class by double clicking the row in the table view and looking at the surrounding base layer. This works, but the feature fills the screen, so I have to zoom out for each feature I inspect. Is there a way to set the zoom layer, or another method for quickly inspecting the area around many features in a feature class? Thanks!


title: What size-reduction can I expect on average when gzipping MBtiles?

text: As part of checking some prereqs for an idea (IOS app with MBtiles on local storage enabeling offline maps) I'd like to know if it's useful to gzip MBtiles when transporting them to an IOS device. In other words, is there a useful reduction in size when gzipping MBtiles? (or is the MBtile-format, already packed in some way, thus limiting the use of gzip or other packers). If so, how much size reduction can I expect? (percentage ballpark) Thanks, Geert-Jan NOTE: crosspost from SO (as it's within both domains) http://stackoverflow.com/questions/13864691/what-size-reduction-can-i-expect- on-average-when-gzipping-mbtiles


title: Mapserver vs QGIS Server for WebGIS with access control

text: I'm looking to set up a FOSS web GIS to allow sharing of large data files. From online discussions I gather this can be done using a variety of software combinations, eg: PostGIS + MapServer + Open Layers or alternatively PostGIS + QGIS Desktop + QGIS Server + QGIS Client. Could people experienced in this area please detail any advantages and/ or disadvantages that might be associated with these two options? Are there any problems setting up either of these two systems on a 64-bit machine? The end product webGIS would ideally give differential access via username and password, with different selections of data available to different users. Any advice appreciated.


title: How do I drop the z value from the geometry and transfer it to a new field?

text: Having a points shapefile with z values, how do I keep in the geometry only the x,y values? I also want to move the z values to a newly created double field.


title: How to summarize Excel data within the zones of another dataset by using ArcGIS 10.2

text: I have the following Excel data, I want to summarize the P-value within the zones of map dataset. I have sereached a lot and learned I might need to convert Excel data into XY table, and then into a raster before using Zonal Statistics tool. So my question might eventually be how to convert the Excel data into a raster. Thanks!               LAT LONG    P-value     42  19      0     -32 -57     0.000199835     -25 -56     0.000148499     -11 -73     4.36478E-06     -11 -72     1.30944E-05     -11 -36     0     -8  -75     0     2   -58     3.41092E-05     .     .     .


title: GeoServer and PostGIS connection technology

text: Does anybody know how GeoServer connects to PostGIS. Which technology is used? Is it JDBC? Thanks


title: Add point and update column incremental

text: In existing feature class we need to add point and some column value need to be updated in incremental using vba code i have some sample code please any can modify it?               Private Sub UIToolControl1_MouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)     Dim pMap As IMap     Dim pMxDoc As IMxDocument     Set pMxDoc = ThisDocument     Set pMap = pMxDoc.FocusMap       Dim pSelected As IEnumFeature       Set pSelected = pMxDoc.FocusMap.FeatureSelection       pSelected.Reset          'Get the first layer in the map     Dim pFeatLyr As IGeoFeatureLayer     Set pFeatLyr = pMap.Layer(0)                'Create a point from the mouse down click     Dim tmpPoint As IPoint     Set tmpPoint = New Point     Set tmpPoint = pMxDoc.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y)          'Get the feature class     Dim pFClass As IFeatureClass     Set pFClass = pFeatLyr.FeatureClass          'Create the new point feature              Dim pfeat As IFeature         Set pfeat = pSelected.Next         Set pfeat = pFClass.CreateFeature         Set pfeat.Shape = tmpPoint              Static rec         Dim pStart, pInterval         pStart = 0         rec = 0          pStart = 1 'InputBox("Enter Starting Value ", " Input Box", "")          'Update a value       pInterval = 1              Do While (Not pfeat Is Nothing)             If (pfeat.Shape.GeometryType = 1) Then                 If (rec = 0) Then                     rec = pStart                 Else                     rec = rec + pInterval                 End If                       pfeat.Value(pfeat.Fields.FindField("MAP")) = "Test"             pfeat.Value(pfeat.Fields.FindField("LOT")) = UCase(CStr(Format(rec, "###000")))                  pfeat.Store               End If              Set pfeat = pSelected.Next         Loop         pSelected.Reset          'Refresh the view     pMxDoc.ActiveView.Refresh          End Sub


title: Can QGIS Trace Features?

text: I generally have an doubt about QGIS. Is it possible to Trace the feature in QGIS? As in the case like ArcGIS for Desktop which has a tool called "Trace" in its Editor Toolbar? If yes, how we can do it?


title: How to use cURL to create new GeoServer layer "LAYER2" from a PostGIS view "MYVIEW"?

text: I am going to populate my GeoServer with lots of layer with PostGIS views at the backend. For this reason am learning the interaction with GeoServer REST API by curl client in GeoServer site. However, it does not provide clear example for doing this by cURL. Hence I then followed the cURLcommand in this post. The problem is that the command gives me a new layer with the same name with the table/view in my PostGIS: my PostGIS view "MYVIEW" is _always_ published as GeoServer layer "MYVIEW". Question: how to use curl to create new layer "LAYER2" from a PostGIS view "MYVIEW"? Am planning to publish _a_ PostGIS view several times as different GeoServer layer name (its like the "Publish Again" in the web GUI). Am using GeoServer 2.5, PostGIS 2.0, both on a Win Server 2003 32-bit; and cURL 7.33.0. Heaps of thanks


title: How can this Postgresql be solved

text: I am new in Postgrsql. I am trying to Insert few records in a column. I have a where condition. I am trying the following code               INSERT INTO table_name(column_one)         VALUES ('1000')         (SELECT * from table_name WHERE column_two = 'boo') ;      Here is the table structure column_One||Column_two||Column_three One||aaa||xxx two||bbb||xxx three||ccc||xxx four||ddd||yyy five||eee||yyy Now I want to change the all the value of column_two to 'ttt' where column_three = 'xxx'


title: Ordnance Survey data on GeoServer 2.x

text: Has anyone had any success deploying the Ordnance Survey's free datasets on its open sourced OSGBWebMapTools framework using GeoServer 2.0.2? I've been able to set up the datasets on GeoServer 1.7.6 and would prefer for it to use the out of the box caching that GeoServer 2.x supports.


title: Custom Query Task

text: I'm building a web application in ArcGIS Server for .net and I want to create query task for each layer so that each query depends on the previous result query task, how can I do that... please help me??? Thanks


title: Add a new group layer with python ArcGIS 10

text: Does anyone now how to add a group layer with python can I use arcpy.mapping.AddLayer but surely this is only for an actual layer as opposed to a group layer. so far I have this               import arcpy     mxd = arcpy.mapping.MapDocument("CURRENT")     df = arcpy.mapping.listdataframes(mxd, "layers")[0]     arcpy.mapping.AddLayer      Many thanks for your help,


title: VB ArcGIS 9.3 - Move column to the left

text: I'm trying to move text that is not aligned to the far left of the column due to programmer input. I'm trying to figure out the VB coding for it, but nothing seems to happen in the Attributes table (shp file). example: PERMIT ID 1-ZUN 1-ZOR                  2-SUM          4-PBR             2-SUN      1-ABC and so on... I can't seem to get the out of alignment text to move all the way over to the left. Thank You, Zoran


title: Where can I obtain an up-to-date list of US ZIP Codes with Latitude and Longitude Geocodes?

text: _NOTE: This began as aquestion on Stack Overflow, which has subsequently been closed. I also noticed a similar question about Most Up-To-Date Source for US Zip Code Boundaries, but I believe this question is different in that I'm not looking for_ **_boundaries_** _as much as I'm looking for_ **_coordinates_**. _Sorry for new newbie question. I'm not sure where to look to find reliable and up-to-date data._ We have a table in our database that has latitude and longitude geocode coordinates paired with US zip codes. A sample of the data looks like this:               Zip   State  Latitude    Longitude     30000   GA  33.906553   -84.206311     30001   GA  33.810659   -84.607964     30002   GA  33.77429    -84.260712     30003   GA  33.906553   -84.206311     30004   GA  34.113832   -84.294578     30005   GA  34.079927   -84.221166     30006   GA  33.906553   -84.206311     30007   GA  33.968777   -84.43282     30008   GA  33.902022   -84.580318     30009   GA  33.906553   -84.206311      The problem is that our data hasn't been updated for a few years. Where can I obtain (for free or for purchase) updated data for this table?


title: Free Mercator, Vector Maps

text: Are there any free, vector, mercator projection maps available online? I'm not wanting satellite imagery, but more a stylized map along the lines of this: ![alt text](http://i.stack.imgur.com/WKOoP.jpg) However, I need it to be vector-based such that I can create sharp tiles for greater levels of zoom. Ideally, I would like an Illustrator file for something resembling the above map.


title: Viewing ST_MULTIPOLYGON data from ArcSDE DB2

text: We have inherited some tables that were created with ArcGIS/ArcSDE, and the data in these is still being used by our main web application to perform some spatial lookups. The queries are pretty simple, we just pass in some x/y coords and the query returns a code uniquely identifying the shape that the coords exist in. The majority of the mapping solution has now been decommissioned as we are no longer providing live maps, and thus we no longer have the Arc toolset. The basic lookups remain however, and the customer wants to provide us with a new shapefile for import. We used to use the tools to check that the new shapefile fit in with the existing ones visually, and to assign the unique code to the shape. Without the tools I am unsure how to proceed. There are three tables, each of which is associated with a different lookup, and each table has a column that looks like:               Column     Type      Type     name       schema    name               Length   Scale Nulls     ---------- --------- ------------------ -------- ----- ------     SHAPE      DB2GSE    ST_MULTIPOLYGON           0     0 Yes        along with some other columns. Can anyone recommend any free tools we can use to view this data visually? Is it even possible? Sorry if this comes off as very basic or n00bish, I'm a Java & Web developer and have no real experience with GIS solutions. If you need any other info please let me know.


title: Learn ArcObjects

text: Is it mandatory to have ArcEngine Licence to learn ArcObjects?I was able to develop Addins for arcmap but I need in-depth knowledge of ArcObject so started exploring MapControl Application but it started flashing message boxes for using Unlicensed control.If ArcEngine is must then is there any trail version of Arcengine 10.2 Licence available for learning.Is there are any online manual to learn ArcObjects.


title: how to install and use mapcache?

text: i installed mapserver 6.4.1 using osgeo4w and i created a mbtiles file for a small region of openstreetmap (loaded into postgis) using tilemill. my questions are: a - do i have mapcache?? mapserver site sais that mapcache is part of mapserver but i did not understand if i need to install it separately or is it 'in' the mapserver. b - if mapcache is not installed automatically (i assume it isnt, but i hope it is:) how do i install it? i cannot find compiled version for windows and i tried to build it myself but ran into problems of missing libraries etc. c - how do i use it to serve the mbtiles? i managed to use mapserver via ../cgi-bin/mapserv.exe?map=... but how do i put mapcache in the middle between the client (will be openlayers) and mapserver? (as i understood the cache server sits between the client and the server) or do i still talk to mapserver and it talks with mapcache? thanks allot!


title: Python If else statements

text: I'm trying to populate a field from another. The catch is that it isn't 1 or 2 values. If my field A = 4 then I want it to return field B to 0. But if Field A is 1, 2 or 3 then I want the user to be able to use the domain drop down list to choose what field B is--because it could be one of 3 other values. Is that possible? Below is the code I think is a start. But I need it to return 1, 2 or 3 if WaterType = anything but 4.               def Reclass (IrrigType):       if WaterType = 4:          return 0       else:          return 1


title: QGIS, Postgis: Geometry type does not match column type

text: I'm trying to import some polygon shapefiles to Postgis in QGIS via SPIT. One of them can't be imported and returns this error:               ERROR: Geometry type (Polygon) does not match column type (MultiPolygon)      I've tried to change attribute "Feature Class" in that table in SPIT widnow, from MULTIPOLYGON to POLYGON, but nothing happened. Is there any way to make Postgis to accept both types (polygon and multipolygon)? Or maybe somehow I can convert shapefile geometry from polygon to multipolygon? Any ideas? I've tried Qgis 2.0.1 in Windows and Qgis 2.3 in ArchLinux.


title: GeoMedia + WFS 1.1.0 -- how to specify a non-default SRS in a GetFeature request?

text: I'm forming a WFS post request like the one below. Notice I have SRSNAME="epsg:4326":               <GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS"     version="1.1.0" maxFeatures="500">       <wfs:Query typeName="SewerMainline" SRSNAME="EPSG:3857">         <Filter xmlns="http://www.opengis.net/ogc">           <BBOX>             <PropertyName>LinearGeometry</PropertyName>             <Envelope srsName="EPSG:4326" xmlns="http://www.opengis.net/gml">               <lowerCorner>46.226130203549 -119.23339223652</lowerCorner>               <upperCorner>46.226323539414 -119.23301630567</upperCorner>             </Envelope>           </BBOX>         </Filter>       </wfs:Query>     </GetFeature>      But the result looks like this. Notice the geometry is still in EPSG:3857 (the DefaultSRS):               <gmgml:FeatureCollection xmlns="http://www.intergraph.com/geomedia/gml"     xmlns:gml="http://www.opengis.net/gml"     xmlns:gmgml="http://www.intergraph.com/geomedia/gml"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xsi:schemaLocation='http://www.intergraph.com/geomedia/gml http://usalvwdgis1:801/WFS1/request.aspx?request=DescribeFeatureType&VERSION=1.1.0&SERVICE=WFS&OUTPUTFORMAT=text/xml;subtype=gml/3.1.1'     numberOfFeatures='4'>       <gml:boundedBy>         <gml:Envelope srsName="EPSG:4326">           <gml:lowerCorner>46.2260082243399 -119.233511477885</gml:lowerCorner>           <gml:upperCorner>46.2262617590092 -119.232662186944</gml:upperCorner>         </gml:Envelope>       </gml:boundedBy>       <gml:featureMember>         <gmgml:SewerMainline gml:id="SewerMainline.5635">           <gmgml:ID1>5635</gmgml:ID1>           <gmgml:LinearGeometry>             <gml:LineString srsName="EPSG:4326">               <gml:posList srsDimension="2">46.2262145488833 -119.233114496317               46.2262139292097 -119.233327445878</gml:posList>             </gml:LineString>           </gmgml:LinearGeometry>         </gmgml:SewerMainline>       </gml:featureMember>     </gmgml:FeatureCollection>      I've confirmed the service supports 4326..here is a snippet from GetCapabilities:               <ows:Parameter name="srsName">       <ows:Value>EPSG:3857</ows:Value>       <ows:Value>EPSG:4326</ows:Value>     </ows:Parameter>      I also looked at the WFS 1.1.0 spec and the doc on the SRSNAME state the following: > This parameter is used to specify a WFS-supported SRS that should be used > for returned feature geometries. The value may be the DefaultSRS or any of > the OtherSRS values that a WFS declares it supports in the capabilities > document. The SRS may be indicated using EPSG codes or the URL form defined > in [2]. If the parameter is not specified then the value of the DefaultSRS > for the feature type being queried shall be used. Where am I going wrong?


title: Where are dynamic hyperlinks stored?

text: A while back (ArcGIS 10.0 times, or maybe even 9.3) a colleague of mine created a mxd with a few hundred manholes and attached dynamic hyperlinks to them (pointing to photos of them). (I know this might not be the most efficient method, but done is done.) However, now we can't seem to find this shapefile/mxd, and I would really need a way to search for a shapefile that has such hyperlinks. In the ArcGIS Help (linked above) it states that: _This [hyperlink] association is stored with your layer. They are also stored with your layer if you save the layer to a file. /.../ ArcMap uses the feature ID (FID) field to associate dynamic hyperlinks with features_. This far in my research I've been unable to find a way to see where they are stored or how to convert the dynamic hyperlinks into a field based hyperlink (which could indicate how to access the hyperlinks). I can probably figure out a couple of strings that should be in a list like that, if it could be of any use. Is there a way to search for shapefiles which contains dynamic hyperlinks? Preferably without heaps of programming, but I'm open to suggestions!


title: How to extract the number of vertices in each polygon?

text: I have ArcGIS Desktop 10.2 and my challenge is how to extract the of number vertices in each polygon for all features like this: ![enter image description here](http://i.stack.imgur.com/x7uT5.jpg) ![enter image description here](http://i.stack.imgur.com/rFSAN.jpg) ![enter image description here](http://i.stack.imgur.com/ZTFm1.jpg) I have many parcels in my feature class and I want to extract the number of vertices for all features separately, then I want to display XY coordinates for all vertices. for more information, i just want to convert vertices for each polygon and display number of each vertices staring from 1 number, so if i have polygon and it have a 4 vertices, a want to convert polygon to vertices i display number of vertices like this (1,2,3,4,5), then displaying xy for each vertices, i think the real challenge id to, how to convert all polygon to vertices and make each number of vertices starting from 1 number.


title: How to sort SLD file for BGS Digimap provided by Edina?

text: Does anyone know how to sort the sld files provided here: http://digimap.edina.ac.uk/webhelp/geology/using_data_with_gis/legend_files.htm The reason I ask is that I only want to display the appropriate types in the legend under Qgis. At the moment all of the rock types appear to be displayed. Unfortunately I can't access the LYR file provided by BGS with Qgis. Regards Neil


title: Where does QGS write its error log messages?

text: I want to read and copypaste the error log for the crashes I am experiencing in QGIS 2.0. The error I am getting freezes QGIS so I have to ctrl-alt-del. I can see the last mesasge in the panel, but can't copy it or scroll back to see the earlier messages. When I repoen it, the log message panel has reset to zero (QGIS starting, etc), so all the transform error messages I want are gone. Are the older log messages written to disk somewhere?


title: Adding an existing Feature class to an existing Feature Dataset in c#(arcobjects)

text: I want to add an **existing feature class to an existing feature dataset**. Both the feature class and the dataset have the same coordinate system, I searched over the net but only assistance I found was to create a new feature class in a feature dataset (I tried that and it worked). According my understanding I tried using `IDatasetContainer` but it's not working. Here is the code:               IFeatureDataset featureDataset1 = featureWorkspace.OpenFeatureDataset("featureDataset1");     IDataset datasetFcTenActors = fc_tenActors as IDataset;  // fc_tenActors is my feature class to add     IDatasetContainer container = featureDataset1 as IDatasetContainer;     container.AddDataset(datasetFcTenActors);


title: How do I extract a raster's extent in python?

text: I am looking for an easy way to extract a raster's extent in python. Currently, I am using gdalinfo and then parsing out the corner coordinates. The problem with this approach is that gdalinfo is not consistent in how it reports the corner coordinates. I am working with a variety of file types (hdf, tif, img, asc, etc). I need the extent to be in decimal degrees (or DMS - that I can convert to decimal degrees). This is being used with a PostgreSQL database so I have access to any PostGIS function, gdal, or ArcGIS, although I would prefer a function that does not involve ArcGIS unless it is fast (I am trying to index a large number of files, frequently). It can be run on either Windows or Unix. Thank you, Kevin


title: Make Feature Layer tool problems in Model Builder

text: I am having a slight problem with using the Make Feature Layer tool in model builder. Basically I have a file geodatabase of points. I am trying to make a model to pull out points according to a reference field value. I could just make the expression for the tool a variable but unfortunatly the users who are going to use it are to dense to create a simple SQL statement. I have created a model String variable (VRefNo) to take the reference number (Its alphanumeric hense the string. The column in the geodatabase is also a string) and tried to parse it in the usual way to the expression:               "RefNo" = '%VRefNo%'       and all the other variables are hard coded. I have made the variable a model parameter and checked the add to display check box for the output and made sure nothing is intermediate (There is only one tool in the model and thats it). The model runs ok with no errors but I am not getting an output........ Any Ideas? Many thanks in advance C UPDATE: I can get the select tool to work in model builder when run from the toolbox only when I make the output a model parametre.... Thats all nice but I only want to save the results temporarily to memory (in_memory) and would prefer the user not having the option to change this. Thank you ESRI!! I would make a python script to do it but all the clients dont have python installed on their machines.....


title: Exporting OpenLayers.Layer.WMS to GeoJSON / KML

text: I'm looking the way to exporting an especific region of a WMS layer to some XML format (GeoJSON, GML, KML) using OpenLayers and Geoserver. I've found how to export features objects with OpenLayers.Format.GeoJSON.write(), but this method only allow converting feature objects or geometry objects. An example of my idea: I'm viewing a map of a certain country with a couple of WMS layers with some data. Then I zoom to a particular state of that country and I want to export what I'm viewing to GeoJSON or KML for use that in a desktop GIS application (like QGIS). Does anyone know how to do this? Thanks.


title: How to maintain the data at XML document after changing schema with Diagramer?

text: After exporting XML with schema and data I did some changes to the schema with ArcGIS Diagramer. now i need to import the new schema and all the data to a new empty file GDB. what are the best practices for this ? using "Publish" on diagramer save only the schema. How can i load the data most efficiently (i have more the 40 layers) from XML to geodatabase ?


title: How to automate FGDC metadata generation in ArcGIS?

text: Does anyone know of a tool or script to automate FGDC standard metadata for ArcGIS? I would like to be able to select multiple feature classes and fill company info., dates, etc.


title: Parse a KML for Openalyers

text: I am trying to get a kml from a URL to display in OpenLayers. However, it is a ground overlay so it cannot be displayed the standard way. I found this thread: Does OpenLayers supports KML Ground Overlays? However, I am very lost as to how to parse this manually. I know I can make an AJA request and parse it, but don't think I can do that bc of cross-domain issues. So could someone guide me in the right diirection to get a KML parsed directly from a url? Thanks!


title: Converting Shapefile Elevation field to Height Field

text: HAve been trying to update the elevation field in my shape file (vector file *.shp) into a height field. Have tried to rasterize the shapefile then deduct the height using Raster Calculator with a reference dted (raster map). Then I filled the empty space with nodata. Afterwhich I polygonize. I have managed to get some resemblance of the height but however, I have found that the height in the shapefile is rounded off and the processing process actually cost me to lose some features. All of this is done in QGIS 2.2 Is there a better way I can do this? One of the way I am trying to explore is to use field Calculators in vector shapefile properties. Can I reference an external raster map layer with this? If so, how can I do this? THanks


title: How to solve error 'coordinate exceeds the valid coordinate' in ArcGIS?

text: All of the layers in map document are in wgs84. I am getting an error message in the ArcGIS server log for one specific layer (see below). I ran the analyze tool from the Map Service Publishing option and it did not pick up any errors on this layer. How to fix the issue? Does anyone know the reason for this error?               <Msg time='2012-12-13T13:51:13' type='ERROR' code='103800' target='Test.MapServer' machine='server1' user='?' process='5164' thread='7384'>Texas: Layer_RK:  The specified coordinate exceeds the valid coordinate range </Msg>


title: (arcengine) export selected features from sde to shapefile (with joined fields)

text: I have a SDE featureclass that is joined to an access table in my map control. I want to export selected features of the SDE layer to a shapefile AND retain the joined fields. this following method works great (except for retaining the joined fields)               public void ExportMapLyrToShapefile(ESRI.ArcGIS.Carto.ILayer pInLayer, string inputName, string outputPath, string qry)         {             // Set the GeoFeatureLayer to the layer in the map so that we can use it as the input feature later             IGeoFeatureLayer pInGFLayer = (IGeoFeatureLayer)pInLayer;             IFeatureLayer pInFeatureLayer = (IFeatureLayer)pInGFLayer;             IFeatureClass inputFeatureClass = pInFeatureLayer.FeatureClass;             IDataset inputDataset = (IDataset)inputFeatureClass;             IDatasetName inputDatasetName = (IDatasetName)inputDataset.FullName;                  // Get the layer's selection set (the selected/highlighted features of the layer in the mapcontrol)             IFeatureSelection featureSelection = (IFeatureSelection)pInFeatureLayer;             ISelectionSet selectionSet = featureSelection.SelectionSet;                  // Create a feature class name for the output shapefile and open the output's workspace             IWorkspaceFactory shpWorkspaceFactory = new ShapefileWorkspaceFactoryClass();             IWorkspace shpWorkspace = shpWorkspaceFactory.OpenFromFile(outputPath, 0);             IDataset shpWorkspaceDataset = (IDataset)shpWorkspace;             IWorkspaceName workspaceName = (IWorkspaceName)shpWorkspaceDataset.FullName;             IFeatureClassName shpFeatureClassName = new FeatureClassNameClass();             IDatasetName shpDatasetName = (IDatasetName)shpFeatureClassName;             shpDatasetName.WorkspaceName = workspaceName;             shpDatasetName.Name = qry.Replace(" = ", "");                  // Use the IFieldChecker interface to make sure all of the field names are valid for the output shapefile.             IFieldChecker fieldChecker = new FieldCheckerClass();             IFields shapefileFields = null;             IEnumFieldError enumFieldError = null;             fieldChecker.InputWorkspace = inputDataset.Workspace;             fieldChecker.ValidateWorkspace = shpWorkspace;             fieldChecker.Validate(inputFeatureClass.Fields, out enumFieldError, out shapefileFields);                  // We also need to retrieve the GeometryDef from the input feature class.             int shapeFieldPosition = inputFeatureClass.FindField(inputFeatureClass.ShapeFieldName);             IFields inputFields = inputFeatureClass.Fields;             IField shapeField = inputFields.get_Field(shapeFieldPosition);             IGeometryDef geometryDef = shapeField.GeometryDef;                  // Now we create a feature data converter to "Export" the selected features to a shapefile             IFeatureDataConverter2 featureDataConverter2 = new FeatureDataConverterClass();             IEnumInvalidObject enumInvalidObject = featureDataConverter2.ConvertFeatureClass(inputDatasetName, null, selectionSet, null, shpFeatureClassName, geometryDef, shapefileFields, "", 1000, 0);         }      the issue is with the IFieldChecker interface. it validates all the fields and removed the joined fields before exporting to a shapefile. Does anyone have any insight on this issue? If so, please help! I'm stumpped! btw... i also tried using an IDisplayTable as my input feature and I get the same output (missing joined fields) Thanks, Derek


title: UK road network dataset

text: Can anybody guide me to a website or a source to download the Geographical UK road network data set. The data set should include the road distances, since I want to apply shortest path search algorithm on it. I searched the web for such data but I could not find it in readable format.


title: header information is missing from image, after writing using opencv

text: I am doing complement of an image using open-cv python, while writing the image, open-cv is not writing the header information in the complemented image. my image data are in TIFF format. i am doing like this...               import cv2     img = cv2.imread("image.tiff", -1)     for i in xrange(0, len(img)):         for j in xrange(0, len(i)):           img[i][j] = 65535-img[i][j]     cv2.imwrite("complemented.tif", img)


title: Rendering OSM with QGIS for MapServer to use in OpenLayers

text: I want to show tiles in OpenLayers offline. I've installed QGIS 2.0, TileCache, and MapServer on Windows. Enabled plugin OpenLayers in QGIS. What kind of data I suppose to extract from QGIS with my own OSM file? And how can I done this process? I'm new in this map things and I'm now so close I think.


title: Using python to get extent and split coordinates into list

text: I have the following code:               for fc in fcs:         desc = arcpy.Describe(fc)         ext = desc.extent         ext.split(" ")         print ext      I'm getting error: AttributeError: Point: Get attribute split does not exist I know my fcs list is okay and the extent property is working correctly. I want each fc in fcs to output a list with the coordinates like this: [-179.168566355952, 51.2134728616834, 179.748708978836, 71.3896098800921, NaN, NaN, NaN, NaN]


title: Can I use GeoWebCache with GeoServer Layers which have different native and declared SRS?

text: We are using GeoServer to serve raster tiles with a native SRS of 27700, but are forcing use of a declared SRS of 900913. When I try to seed these tiles using GeoWebCache through the GeoServer web admin interface no tiles are cached. However when I use the native SRS of 27700 seeding works fine. Is what I'm trying to do possible? And if so, how do I do it? Thanks,


title: Error import ShapeFile shp2pgsql-gui

text: I'm trying to import a shape file to my PostGIS database but I can not, give a look:               Importing with configuration: 12mie250gc_sir, public, geom, / home/samuelribeiro/Desktop/MALHA_DIGITAL/ac/12MIE250GC_SIR, mode = c, dump = 1, simple = 0, geography = 0, index = 1, shape = 1, srid = 4326     Shapefile type: PolygonM     PostGIS type: MULTIPOLYGONM [3]     Failed SQL begins: "SET TO UTF8 CLIENT_ENCODING;     STANDARD_CONFORMING_STRINGS SET TO ON;     BEGIN;     CREATE TABLE "public". "12mie250gc_sir" (gid serial,     "id" float8     "nm_micro" varchar (100),     "cd_geocodu" varchar (2));     ALTER TABLE "public". "12mie250gc_sir" ADD PRIMARY KEY (gid);     SE "     Failed in pgui_exec (): ERROR: function AddGeometryColumn (unknown, unknown, unknown, unknown, unknown, integer) is not unique     LINE 9: SELECT AddGeometryColumn ('public', '12mie250gc_sir ',' geom ', '4 ...                     ^     HINT: Could not choose a best candidate function. You might need to add explicit type casts.          Shapefile import failed.


title: Intersection between two SpatialPolygonsDataFrame using gIntersection function in R

text: I want to select a subset of my map (a SpatialPolygonsDataFrame) to create a new vector map = part of the initial map included inside a given polygon (eventually, inside several polygons). I have a large study area, under the object "parcel", and would like to select the part of the map inside the polygon "hr_kud". This is basically the part of my study area used by an animal, so I want to compute basic statistics on this new map and used it for new analyses (of habitat selection). I have to repeat this operation for about 100 animals... Here are my data : _http://dl.free.fr/vX4TA8nsE_ **parcel** = my study area map. and **hr_kud** = an example of homerange used to reduce the study area Here is a part of my R code, used under Rstudio (R version 2.15.2 (2012-10-26)) : > library(rgeos) > > load("Data.RData") > > class(parcel) > >> [1] "SpatialPolygonsDataFrame" >> >> attr(,"package") >> >> [1] "sp" > > class(hr_kud) > >> [1] "SpatialPolygonsDataFrame" >> >> attr(,"package") >> >> [1] "sp" > > object.size(hr_kud) > >> 9536 bytes > > object.size(parcel) > >> 88090144 bytes > > plot(parcel, axes=TRUE) > > plot(hr_kud, col="red", add=TRUE) And when I run my final command, it causes Rstudio to crash : > hr_map <- gIntersection(parcel, hr_kud, byid=TRUE) It is not the first crash reported, but non of the answers find on the net are efficient for me... It's exactly the same using R and all my packages are updated. So If you have any idea of why it's crashing, or of an alternative method to create my subset map or intersect two SpatialPolygonsDataFrame in R, I will be really appreciated ! thanks in advance, Sophie


title: Acquiring road labels

text: So this is a data acquisition questions: I have data retrieved from OSM, QGIS2.0. It's a region of Qatar. Of the 13 thousand or so roads, I only pulled in about 1 thousand road names. The roads do have names, I've researched it. And the names are necessary for a network dataset that will use the street names for routing purposes. This is just the beginning to my problem, but I'll only ask this question here... I don't want to bombard this post with multiple inquiries. Is there a way, or a plugin, or a data source somewhere I do not know about that will let me "append" road names to my current data I already have? I have already manipulated what I have so I really don't want to hunt down another source unless absolutely necessary. Thanks, Logan


title: What's the correct link for adding GeoServer WFS to ArcMap?

text: What is the correct URL to enter in ArcCatalog WFS Parameters when adding a WFS layer from GeoServer into ArcMap? Here's a link to our Get Capabilities document: https://weaveprod.ucdp.utah.edu/geoserver/ows?service=wfs&version=1.0.0&request=GetCapabilities I am using ArcMap 10.1 and experiencing the same problem described here. When I try to add WFS layers from GeoServer, "Feature Types" is blank. That post says it is a bug with 10.1. However, I added WFS from GeoServer not long ago, so I'm skeptical that the answer is to upgrade to 10.2. The only thing that changed was our GeoServer location. I was able to bring in WFS layers from http://www2.dmsolutions.ca/cgi- bin/mswfs_gmap?version=1.0.0&request=getcapabilities&service=wfs. Although that is not GeoServer, I previously had GeoServer WFS working fine. Here's an image of one URL I tried (which was https:// weaveprod.ucdp.utah.edu/geoserver/sf/ows?service=WFS&version=1.0.0&request=GetFeature? - remove space before weaveprod - I can't post over two links). No matter how I change it, no layers are coming up in feature types. There shouldn't be any problem with my WFS layers because I can preview them as WFS through GeoServer. I appreciate any input. Thank you!      ![Adding WFS in ArcMap](http://i.stack.imgur.com/7nl1k.png)


title: Binding between QGIS custom form (Qt Designer) and date/time field in a SpatiaLite database table

text: For my attribute table I created a custom form in Qt Designer. The table has a date field and a time field. In Qt Designer there are widgets for entering date and time. But what data type is expected for the fields in my attribute table in QGIS? The values always stays NULL in every case, when I choose date, datetime or text. Under Layer properties when I choose the edit widget "calendar" there is a calendar popup even when I use my custom form.


title: Adding additional columns of data to CartoDB table? (in-place / no merge)

text: Is there any quick way to add some data to a table without either a) merging / replacing the whole thing or b) having to do it one cell at a time ? example: i have a table loaded now with the counties of Arizona. I would like to add a few columns of county-specific data in-place. I don't want to merge unless i can merge in-place. the end result would be as if i exported the data, added columns to it (e.g. in google docs), and created a new table using that same data. This is the thing to be avoided.


title: GRASS error reading raster map: request for row 1 is outside region

text: I'm a rather inexperienced GRASS user, and am trying to use an addon module called r.geomorphon (see http://sil.uc.edu/downloads.html#software). I've managed to get it installed and am trying to run it, but get an error of:               ERROR: Reading raster map <decal1@PERMANENT> request for row 1 is outside region      and I have no idea what that means. From the Googling that I've done it seems that this error can be caused by some commands when the vector data doesn't overlay the raster data properly - but this routine only uses a single raster DEM file as input. Does anyone have any idea why this might be caused, or do I need to go directly to the author of the addon? In case it affects things, I'm using a simple arbitrary location, as this DEM was generated by a computer model and therefore only has arbitrary X and Y co- ordinates.


title: Precondition in Modelbuilder - use in next process

text: In modelbuilder I am trying to create a tool which will check the coordinate system of the input shapefile. If it is GCS_WGS_1984, then nothing happens. If it is not, then it will reproject it to GCS_WGS_1984. I know I have to create a script and import the tool to modelbuilder, which I have done. Below is the script I used:               import arcpy, os     from arcpy import env     env.overwriteOutput = True     arcpy.CheckOutExtension("Spatial")          Footprints = arcpy.GetParameterAsText(0)          desc = arcpy.Describe(Footprints)     type = desc.spatialReference          try:         if type.name == "GCS_WGS_1984":             arcpy.SetParameterAsText(1, "True")             arcpy.SetParameterAsText(2, "False")         else:             arcpy.SetParameterAsText(1, "False")             arcpy.SetParameterAsText(2, "True")          except Exception as e:     AddPrintMessage(e[0], 2)      And my model: ![enter image description here](http://i.stack.imgur.com/3GgHc.png) I connected the "NOT" to the "PROJECT" and set it as a precondition, but when I try to run it, I get an error telling me that no input is set for the Project Function. I know that the Footprints are not GCS_WGS_1984. So how do I get the model to run properly? Is there a problem with the model, script, or both? Thanks! * * * Ok, so I added in the project tool as suggested, but then I get the following error: ExecuteError: ERROR 000622: Failed to execute (Project). Parameters are not valid. ERROR 000628: Cannot set input into parameter out_coor_system. My script now looks like               import arcpy, os     from arcpy import env     env.overwriteOutput = True     arcpy.CheckOutExtension("Spatial")          Footprints = arcpy.GetParameterAsText(0)     NewProject = arcpy.GetParameterAsText(2)     OutCoorSys = "GCS_WGS_1984"          desc = arcpy.Describe(Footprints)     type = desc.spatialReference          if type.name == "GCS_WGS_1984":         arcpy.SetParameterAsText(1, "True")     else:         arcpy.Project_management(Footprints, NewProject, OutCoorSys)


title: Does leaflet support wms tile layers in applications/openlayers formats?

text: I am trying to create a tilelayer.wms overlay on top of a wfs base map and I wasn't sure whether leaflet allows the applications/openlayers type of format which I served up from geoserver or only images/pngs.


title: Editing polylines in QGIS (extend, trim, fillet etc)

text: I was wondering, if its possible to edit lines and polylines in qgis, in similiar way as autocad commands "extend", "trim" and "fillet"? About how the commands for in Autocad, very shortly: The EXTEND command allows you to extend an entity to touch another entity in a drawing. The TRIM command allows you to shorten an entity to an intersection or remove a section of an entity between two intersections. Fillet: Constructs an arc of specified radius between two lines, arcs, circles, or will create arcs of the specified radius at the vertices of a polyline. Radius of the arc to be constructed may be set to 0, which will make a sharp corner. I am updating certain trailpath map and the accuracy isnt really issue - so i could just use snap and digitize/split & delete, but I began to wonder if there is for example plugin to do this in more efficient way?


title: Filtering (non-WFS) features in OpenLayers

text: Say I have a vector layer with a couple hundred features, and I just want to operate on a filtered subset of those features, such as those that have a State attribute of "OR". Am I reading the OL docs correctly that the Filter classes are only for filtering WFS requests? Is there some other way of filtering ordinary features by a specific attribute (e.g. for zooming to the extent of just those features)? Or do I have to just manually iterate over the features and populate an array of the desired ones? (Not a huge deal, by the way; just wondering if there's a more OpenLayers-y way of doing this).


title: Counting raster points within boundaries in another layer?

text: I know this question is similar to some out there, but I have tried all the 'solutions' and none of them are working for me. I am using the latest version of Qgis. I have a raster layer with lat/long/ARI attributes (average recurrence intervals) I have a vector layer with country boundaries I want to count/collect all the raster points within each country and then export this data in to a text file so I can then calculate min/max/mean values of ARI within each country. PLEASE help, thesis due in in 2 days!! Thank you.


title: How to make Map Book of pages with same area shown but different layers turned on/off?

text: In ESRI a Map Book is best suited for a series of features that each get their own page. It allows you to pick a feature and generate a Map Book Page for each feature including any additional information you wish to add to each page via dynamic text, charts, etc. Is there an alternative for say a series of pages showing the EXACT same area but with different layers turned on and off? We have a Capital Improvements document that I have to create showing the City Boundaries on every page. One page has all police and fire stations listed, another shows proposed water systems, another shows expressways and highways and work being done near or on them... etc., ad nauseum. Is there some way to set this up so that I **DON'T** have to created a separate MXD for each Map Page of this document?


title: Sending map extent in (geo)JSON

text: I have a leaflet map that I need to fitBound on a given rectangle. The coordinate for the fit bound will be transfered in JSON via a REST call on a server. We are using GEOJson to encode our geometry So my question is : what would be the correct way to encode this using geojson? The RC candidate seemed to include a BOX type that would be perfect, but this type is not present in the final specification. So far I see :   * There is a bbox attribute, but it seem to apply to a specific geometry. I couldn't use it on its own.   * I could just send a dumb JSON array `[-90, -180, 90, 180]`, but then I lose the advantages of using a standardised format.   * I could use the BOX type but it appear to have been dropped. What should I use to send this information?


title: QGIS WMS using tile size restrictions

text: When I add a WMS layer with a tile size restriction (2048 2048) the resulting WMS datasource in the QGIS project file is               <datasource>tiled=2048;2048,url=http://openmaps.gov.bc.ca/mapserver/base3</datasource>      This does not look to be a properly formed GetMap request, which I believe is resulting in the WMS server sending out a tiled WMS feed while ignoring the fact that the feed is transparent. Using the transparency tools in layer properties results in the entire layer (features and background) becoming transparent. If the tiled portion of the datasource is removed, the WMS feed displays correctly but does not print. If you attempt to demo this, use the Layer group called "BASE_MAPPING_20K" So is there a way to edit the GETMAP request to be properly formatted with Width & Height & Transparent? thanks! C


title: How many stereo satellite imagery required to prepare DEM of an area?

text: I want to know how to find the nos. of scene of stereo CARTISAT-1 data required to prepare DEM of an area(say 84000 sq km)? any suggestion/solution/calculation?


title: Applying styles to Polygons

text: Still learning OpenLayers and I think my problem may be a lack of understanding the terminology, however. Is it possible to draw polygons in a different colour within one vector layer, or do all polygons get their colour from the colour set within the layer? I ask because I have a map which draws the borders of several (up to 10) different countries around the world and I'd rather have one layer with different coloured polygons rather than have several different layers. I have the following code:               var polyCountry = format.read("POLYGON((" + polyString + "))");     Zip15021.addFeatures([polyCountry])      Which works perfectly, but can't see any documentation anywhere on how to style the polygon.


title: How to remove a layer from the Layerswitcher in Openlayers

text: I have an init-Function, there some layers are added with the option displayInLayerSwitcher = false; Thats ok, but in some situations i need to set this later in the application to true. So i want to reset the option. The ways i tried to figure out: 1:               my_layer.displayInLayerSwitcher = true;     my_layers_switcher.redraw();     // Result is, that my_layer is resetted and in the LayerSwitcher nothing changed. 2:               my_layer.displayInLayerSwitcher = true;     my_layers_switcher.destroy();     map.removeControll(my_layers_switcher);     my_layers_switcher = new OpenLayers.Control.LayerSwitcher();     map.addControll(my_layers_switcher);     // Same Result as by way 1 Anyone, who have an idea for this?


title: How to reproject aqua modis images / ocean color?

text: I am working with aqua modis, ocean color, L2 - SST image but in order to do I must reproject it. I use the gdal_translate to convert the format of the image but reprojection is becoming very difficult... When I download it, it has a north down projection. This image has 5 bands and the two first bands are the lat lon in decimal degrees. Do you know how can I reproject them by using the band 1 and band 2 as coordinates?


title: Is it possible to run a search cursor on a multipart feature class?

text: I have a multipart feature class of cities. I want to run a search cursor on a cities feature class where:   1. one city is selected and a select layer by location is run to select all parcels that are within a certain distance X;   2. Values from the selected parcels are then summed together;   3. move on to the next city record Currently, I am having trouble getting my select by location statement correct. Instead of only selecting the parcels that are within distance X of one city, it's selecting all the parcels that are within distance X of all the cities in the feature class.                   arcpy.MakeFeatureLayer_management(city, c_layer)         cCursor = arcpy.SearchCursor(c_layer)         print "Created search cursor on c_layer"          arcpy.MakeFeatureLayer_management(parcel, p_layer)          for row in cCursor:         geoName = row.getValue("GEO_NAME")         print geoName         geoID = row.getValue("GEO_ID")         print geoID                   arcpy.SelectLayerByLocation_management(p_layer, "WITHIN_A_DISTANCE", c_layer, search_radius, "NEW_SELECTION")         print "Completed select by location on p_layer"         y = arcpy.GetCount_management(p_layer)         print y


title: Small script crashes Python

text: I'm running a rather simple script with ArcPy, which extracts values of raster to points of a shapefile:               def raster_overlay(input_files):         for raster in input_files:             in_shp = "temp/shapefiles/points.shp"             in_raster = raster             print in_raster             ExtractMultiValuesToPoints(in_shp, in_raster, "BILINEAR")          raster_overlay(raster_files)      The variable `raster_files` is a list with strings pointing to a number of raster files on the local hard disk. The shapefile contains around 50 points, and each raster is around 15MB. If the list of raster is small (more or less <20), everything works as expected. However, I have around 50 raster images. Using the complete list, Python crashes (`"python.exe has stopped working"`) after processing 21 images or so. The values of the first 20 raster are correctly appended to the shapefile (one column for each raster). I monitored python.exe in the Windows 7 Resource Monitor. Memory usage of Python starts around 15 MB and then gradually increases to around 700 MB (and then Python crashes). So, memory leakage might be the reason for the crashes (although the PC has 8 GB of RAM). I tried to include `gc.collect()` and `del in_shp` and `del in_raster` inside the loop, but nothing changed. What else could I try? PS: I just tried changing `BILINEAR` to `NONE`, and the script didn't crash. However, memory usage still increased in the same way (up to around 1.1 GB). And I would like to use bilinear interpolation, so the question is still relevant. Edit: Cross-posted here to the ESRI support. I'll update this question if they can give a solution.


title: How to convert shapefile to KML file using ArcPy?

text: Python script that checks to see if a specific layer file exists in the current workspace and, if it does, converts the layer file to a KML file. Does it work with a shapefile? Code so far:               for file in arcpy.ListFiles("cities.shp"):         desc = arcpy.Describe(file)         #print "Name: " + desc.BaseName         name = desc.baseName              if name == "cities.shp":              arcpy.LayerToKML_conversion("cities.shp", "cities.kmz")              print "Converted"         else:             print ("There are no layers in ",env.workspace,".")


title: Change python + ogr2ogr.exe to python + ogr

text: I have written several complicated python scripts that end up using ogr2ogr to load or translate data. I have been converting these scripts to standalone exe files meaning the team do not require Python installed and some of the additional modules I use in other parts of the code. However, I always end up using a subprocess and calling shp2pgsql.exe or ogr2ogr.exe, like this               load_ogr = """ogr2ogr --config PG_USE_COPY YES -a_srs "EPSG:27700" -skipfailures -gt 65536 -f PGDump /vsistdout/ %s -lco GEOMETRY_NAME=geom -lco SCHEMA=data -lco CREATE_SCHEMA=OFF -lco CREATE_TABLE=OFF -lco SPATIAL_INDEX=OFF -nln %s | psql -d multi -U postgres -f -"""%(shapefilename,tablename)          run = subprocess.Popen(load_ogr, shell=True)          run.communicate()      Which iterates through a file list and loads the data in. However, I can not bundle this code effectively into a standalone exe because it calls ogr2ogr found via it being installed on the host machine and found in the PATH How can I change this to use the python ogr bindings (ogr.py)? I have found very little code examples or tutorials on how to use the python ogr version, so any pointers to good resources would be very useful too


title: Adding a polygon in ArcGlobe via GraphicsContainer.AddElement

text: I'm trying to add some data to an ArcGlobe; however, it's not showing up and I'm wondering what the issue is. I am doing the following               IGeometry geometry;     Ipolygon polygon = myPolygon;     polygon.SpatialReference=  SetSpatialReference();           geometry = polygon as IGeometry;     IZaware zAware = geometry as IZaware;     zaware.Zaware = false;          IElement element;     IPolygonElement polygonElement = new PolygonElementClass();     element = polygonElement as IElement;     element.Geometry = polygon;          IFillShapeElement fillShapeElement = polygonElement as IFillShapeElement;          ISimpleFillSymbol sfs = new SimpleFillSymbolClass();     sfs.Style = esriSimpleFillStyle.esriSFSSolid;     sfs.Color = myColor;          fillShapeElement.Symbol = sfs;     ((IGraphicsContainer)myGlobeGraphicsLayer).AddElement((IElement)fillShapeElement , 0);      Anyone see any major issues? EDIT 1: Made sure to use code-sample tool.


title: "dataset does not exist or is not supported" using large GRID raster

text: I am trying my hand at arcpy for the first time to create a conditional raster from a set of threshold values. I have 3 large GRID format rasters (mos_zb3, mos_zb4, pca_finb2) I am trying to feed into arcpy using the following code: import arcpy from arcpy import env from arcpy.sa import * arcpy.CheckOutExtension = "Spatial" env.workspace = "C:\final_mosaic_files\for_python" Z3 = Raster("mos_zb3") Z4 = Raster("mos_zb4") PC2 = Raster("pca_finb2") outCon = Con(Z4 < -0.9274,2, Con(Z3 <-0.6223,2, Con(PC2 > 1.13,2, Con(Z3 <-0.05342,2,1)))) outCon.save("C:\classifications\actual_real_deal\CART") I keep getting "dataset does not exist or is not supported" errors in the beginning when python tries to read the rasters in as objects. I know the rasters are in the workspace folder, and I have used them in several other analyses so am confident about their integrity. I have searched the other questions about this error message on the exchange and don't see a direct answer for my problem. Thoughts? Thanks in advance, I appreciate the help.


title: Query Selected Records Only: Javascript API

text: For a web application I am working on, I currently have a feature layer with ID 0 (Street Lights) and feature layer with ID 1 (Maintenance Records Table). Multiple records in layer ID 1 are related to ONLY 1 record in layer ID 0 (Street Light have 0 or many maintenance records). I am attempting to perform a query on layer ID 0 (such as, select all of the traffic lights that have a wattage over 400). I then want to perform a query on layer ID 1 and select only the records that are associated with the ones from the first query. Therefore, I want all of **the maintenance records** for lights that have a wattage over 400. I understand how to do this with a Relationship Query. However, the final result is that I then want to perform another query on ONLY those selected records based on the date of maintenance. My problem is that a Query Task only seems to work on a feature layer URL. Is there anyway that anyone knows how to perform a query on another query's results instead of a feature layer URL? Thanks. **UPDATE:** I guess another way to ask this is, If I run the selectFeature function on a feature layer, can I run another selectFeature function on only those previously selected features?


title: Why is * .tlb not visible?

text: I've created a Visual Studio 08 Active X - MXCommands dll for a VBA button within ArcMap 9.3.1. I'm able to load and use the .tlb on my computer; however when I try it on my test computer the .tlb file is not visible. The MXCommand is not listed in the Component Category Manager under ESRI MXCommands on the test computer. I used RegAsm (e.g. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe C:\Temp\Mydll.dll) to try and register it on the test computer, but this did not help. Both computers are running MS XP professional. Any suggestions of what I could do or try next would be greatly appreciated. I also tried this command to register it: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe C:\Temp\Mydll.dll/tlb: Mytlb.tlb/codebase And received a RegAsm Error - RA0000 The given path's format is not supported. Thank you!


title: Slow Labeling in ArcMap 10 (ArcView License)

text: We recently updated most of our users to ArcGIS10. One of my users is having an issue with incredibly slow labeling in ArcMap. The shapefile geometry displays right away, but the labels take _minutes_ to show up at all. The shapefile is of all the parcels in a county and it seems like maybe ArcMap is labeling _all_ the parcels, not just the ones in the current extent. It works just fine in ArcMap with an ArcInfo license. I don't have access to an ArcView 10 license to troubleshoot myself. Are there any significant changes between ArcMap 9 and 10 for ArcView licenses that might cause this and is there's any way to fix it?


title: Is PPDM Lite still available as a Geodatabase template?

text: I have been looking for a Geodatabase template that conforms to the PPDM Lite standard and believe that one was previously available here. However, that page no longer exists and no Geodatabase download is mentioned at the PPDM Lite 1.1 page. Does anyone know if one is still available anywhere?


title: ARCSDE; creating new geodatabase in database servers in arccatalog

text: I use arcsde 9.3. I want to access a geodatabase on mobile. when I want to create new geodatabase in the list of database servers in arccatalog the error is "error creating geodatabase no arcsde server license found" . but there is no option to install in the cd of arcsde instead of post installation. what can I do?


title: arcpy Geometry tools give incorrect results

text: I'm new to python and arcpy but I've been trying to learn how to run geoprocessing tools using arcpy. I have (for this example) 2 shapefiles, a and b, which are both polygons. From plotting them in arcMap, I know that b is found entirely within a. I would like to write a script that will take these two shapefiles and give me a True/False response about whether or not one polygon contains the other. I was thinking of using the arcpy.Geometry.contains() function. I have the following:               >>> a_shp="C:\\Data\\shapefile_a.shp"     >>> b_shp="C:\\Data\\shapefile_b.shp"          >>> #read in as geometry     >>> a=arcpy.CopyFeatures_management(a_shp, arcpy.Geometry())     >>> b=arcpy.CopyFeatures_management(b_shp, arcpy.Geometry())          >>> arcpy.Geometry.contains(a[0],b[0])     False     >>> arcpy.Geometry.contains(b[0],a[0]) #maybe I got the order wrong? Trying the other order     False          >>> #Maybe I'm getting the syntax wrong, trying something else     >>> a[0].contains(b[0])     False     >>> b[0].contains(a[0])     False      I get no error messages but clearly something isn't working properly. Am I doing this right? Any pointers would be greatly appreciated. Thank you!


title: create a fishnet using lat/lon table text file

text: I have a text file with lat/lon table values and want to use this information to generate a fishnet using python. Any heads up would be deeply appreciative. Also please point to if this has been already addressed. Thanks, Ibe


title: List layers in directory .Net ArcObjects or plain .Net  -- C# preferably

text: Any code samples to list arcgis layer files from a directory so they can be looped over?


title: Change MADtedLayer renderer

text: This question is relative to a past question of mine at Rendering raster layer from DTED based on height color map (that remained unanswered), so if you believe that I should merge those two, let me know. I have a MADtedLayer created from a dted catalog using military analyst. The only way I managed to display the data, was using the UseUniformRenderer property of the layer. I want to be able to change the renderer. To be more precise, I want to display each elevation with a specific color, that is already available from a file. My guess is that I need a RasterDiscreteColorRenderer with a corresponding RasterColormap (although I'been unsuccesful with a StretchRenderer also) Here I provide my un-succesful so far code:               public IRasterRenderer CreateDtedRenderer()     {         IRasterColormap colormap = MakeDefaultColormap();              IRasterDiscreteColorRenderer renderer = new RasterDiscreteColorRenderer();         renderer.Colormap = colormap;         return (IRasterRenderer) renderer;     }          public IRasterColormap MakeDefaultColormap()     {         var clrString = DtmColorTable.GetClrAsString();         var blues = new List<double>();         var reds = new List<double>();         var greens = new List<double>();         using (var reader = new StringReader(clrString))         {             string line;             while ((line = reader.ReadLine()) != null)             {                 var vals = line.Split(' ');                 reds.Add(Int32.Parse(vals[1]) / 255.0);                 blues.Add(Int32.Parse(vals[2]) / 255.0);                 greens.Add(Int32.Parse(vals[3]) / 255.0);             }         }              IRasterColormap colormap = new RasterColormap();         colormap.BlueValues = blues.ToArray();         colormap.RedValues = reds.ToArray();         colormap.GreenValues = greens.ToArray();         return colormap;     }          public static IMADtedLayer CreateMADtedLayer(IWorkspace workspace, string catalogName)     {          var inputDatasetName = System.IO.Path.GetFileName(catalogName);               // Open the raster catalog          var rasterCatalog = ((IRasterWorkspaceEx) workspace).OpenRasterCatalog(inputDatasetName);               // Create the MADtedLayer          IMADtedLayer maDtedLayer = new MADtedLayer();          if (!maDtedLayer.Setup((ITable) rasterCatalog)) return null;               ((IGdbRasterCatalogLayer) maDtedLayer).Renderers.Insert(0, CreateDtedRenderer());          maDtedLayer.UseUniformRenderer = true;          maDtedLayer.DisplayElevation = true;          maDtedLayer.ResamplingType = rstResamplingTypes.RSP_NearestNeighbor;          ((IWireframeDisplayProps) maDtedLayer).DisplayWireframe =                 esriMAWireframeDisplayEnum.esriWireframeDisplayNone;               return maDtedLayer;     }      Has anyone ever changed the rendere of a MADtedLayer (or a IGdbRasterCatalogLayer in general?)


title: Map scale vs. map extent vs. map canvas size in Print Map Composer

text: Please help! I am so beyond frustrated. I am using QGIS 2.0 and when I try to create my map in the print composer, I cannot make the scale and the extent the way that I need it. I need my map to be at the scale of 1:10 000. However, the map area is quite large and I need a specific x min and y max in the extent (the x max and y min do not matter). I also need a full A4 size sheet of paper. When I enter the scale in, the map extent is not where I need it. If I change the extent, it either changes the scale of the map or changes the size of the map canvas in the print composer. When I change either one of those back, the scale changes and so on and so forth. Is there some way to lock the scale and then just move the map image inside the map canvas? There must be something that I am missing here!


title: Changing the geodatabase when using HEC-GeoRAS in ArcMap 10.1?

text: I'm running into a weird issue with HEC-GeoRAS and I'm hoping someone here might be able to help me out. For some reason the program is saving layers for a new project in the geodatabase for the previous project I worked on, despite the mxds being saved in two completely different locations. Is there a way to specify which geodatabase the program should use, or to tell it to create a new geodatabase? The way I understood it, it's supposed to create a new geodatabase in the same folder where the map is saved, but for some reason that isn't happening. Thanks for any help you can provide!


title: arcpy export - unable to set exact extent of dataframe

text: I am trying to use arcpy's ExportToPNG function to produce tiles for Nasa WorldWind, which will require very specific extents of outputted tiles. Pretty simple code - abbreviated below:                mxd = arcpy.mapping.MapDocument(mxdPath)      df = arcpy.mapping.ListDataFrames(mxd)[0]      xmin, ymin, xmax, ymax = getWorldWindTileBounds(tileX, tileY, level)           newExtent = df.extent      newExtent.XMin, newExtent.YMin = xmin,ymin      newExtent.XMax, newExtent.YMax = xmax,ymax      df.extent = newExtent           tileFilePath = '%s/%s/%s/%s_%s.%s' % (cacheDirectory, level, tileY, tileY, tileX, tileFormat)      tileDir = os.path.split(tileFilePath)[0]      if not os.path.exists(tileDir):           os.makedirs(tileDir)           if 'png' in tileFormat:           arcpy.mapping.ExportToPNG(mxd, tileFilePath, df, df_export_width=512, df_export_height=512)      else:           arcpy.mapping.ExportToJPEG(mxd, tileFilePath, df, df_export_width=512, df_export_height=512)      The extent of outputted tiles **_is very close, but not identical_** to the extent set in this block of code. In reviewing the documentation for the arcpy DataFrame extent property, I found this: **_"If the aspect ratio of the extent does not match the shape of the data frame, the final extent will be adjusted to fit the new extent within the shape of the data frame. In other words, if you set explicit X, Y coordinates, you may not get the same values returned if you attempt to read them later."_** Since I am using the dataframe instead of a page layout, I initially didnt think was applicable to my use case. But, I have tried all types of shenanigans to set dataframe elementWidth/elementHeight properties to no avail. Does anyone know how I can force the export to match the extent I set exactly?


title: ogr2ogr srs options: where is the well known definition determined?

text: In the ogr2ogr documentation it says that when using `-a_srs srs_def`: > Srs_def can be a full WKT definition (hard to escape properly), or a well > known definition (ie. EPSG:4326) or a file with a WKT definition. Where are the default well-known definitions listed? Do they include ESRI as well as EPSG? If not, why not, and can I add all the ESRI definitions listed at spatialreference.org? Is there an easy way to load an srs definition using an SRID from a PostGIS spatial_ref_sys table, aside from just running some sql to get the text? Thanks!


title: ESRI/ArcGIS draw protractor

text: I am using ArcGIS maps and trying to follow JS API. I am trying to understand how can I add a protractor on the map which will help in angles while drawing polygons. I understand I could add a Feature layer but how do I add an image to it? How can I make the protractor movable, without it being scale up/down with the map?? I would appreciate any help.