What is the most efficient way to search a geodatabase for NULL-like records?

The problem: I have a geodatabase with several datasets and many more feature classes within. The fields within the feature classes have been populated through joins with shapefiles and manual edits. Often times string fields will become populated with whitespace (i.e. '', ' ', ' ', etc) or the string "Null", and numeric fields will become populated with a zero (0). I would like to find these records and replace them with a true NULL value. I have the following code, which uses an UpdateCursor, but it still very slow and doesn't catch all of the NULL-like records. Does anyone know of other ways to accomplish this task?               GDB = arcpy.GetParameterAsText(0) #input geodatabase     arcpy.env.workspace = GDB     datasetList = arcpy.ListDatasets() #list datasets          for dataset in datasetList:             arcpy.env.workspace = os.path.join(GDB, dataset)             fcList = arcpy.ListFeatureClasses()             for fc in fcList:                     arcpy.AddMessage("Processing %s..." % fc)                     #count features                     arcpy.MakeTableView_management(fc, "tempTableView")                     count = int(arcpy.GetCount_management("tempTableView").getOutput(0))                     if count > 0:                             fieldList = arcpy.ListFields(fc)                             for field in fieldList:                                     arcpy.AddMessage("...%s" % field.name)                                     rows = arcpy.UpdateCursor(fc)                                     for row in rows:                                             count = 0                                             if row.isNull(field.name):                                                     continue # if already null                                             elif field.type == "Text":                                                     value = row.getValue(field.name)                                                     if value.lstrip(' ') == '' or value.lower() == '<null>': # looks for whitespace or '<null>'                                                             row.setNull(field.name)                                                             count += 1                                             elif field.type == "ShortInteger" or field.type == "LongInteger" or field.type == "Float" or field.type == "Double":                                                     value = row.getValue(field.name)                                                     if value == 0:                                                             row.setNull(field.name)                                                             count += 1                                             if count > 0: # update row if records have changed                                                     rows.updateRow(row)                                     del rows                     else:                             arcpy.AddMessage("...NO RECORDS FOUND.")


Can I install GIS Software on RSS (informix server) running 11.7.fc6

I currently use ArcGIS Server 10.0 and consume data through a db2 database. I recently installed an RSS informix server and was hoping to pull data from this since it is updated real-time versus the nighly update of the db2. RSS Informix Server Version: 11.7.fc6 OS: AIX 6.1 GIS Server: 10.0 If I stay at Server 10.0, I would have to install ArcSDE (I assume) on the Informix Server. Can SDE be installed on an Informix Server running 11.7.fc6 OS: AIX 6.1? ** Edit: I see ArcSDE 10 isn't compatible with 11.7.FC6. But is it possible to install ArcSDE 10.1 on Informix (assuming Informix version is supported by 10.1) while still remaining at 10.0 Server with capability of publishing the Informix data as a service on Server 10.0? ** If I upgraded to 10.1 Server, the Informix capability is already there without installing SDE, BUT this link shows support for only FC8 and FC4. How would FC6 react or would I need an upgrade to FC8? http://resources.arcgis.com/en/help/system- requirements/10.1/index.html#//015100000071000000


Accessibility to developer of "Alter" and similar constructs in MapInfo MapBasic

Parts of the MapInfo MapBasic API are accessed as follows:                 Alter ButtonPad "Main"             Add ToolButton                 ID 101                 Icon 8                 Calling OnToolClicked                 HelpMsg "Custom Edit Tool.\nCustomTool"             Show      The `Alter ButtonPad` statement with nested `Add` and `Show` commands looks a bit like the builder pattern or a "fluent" interface in object oriented languages. I'm wondering if the Alter ButtonPad statement is defined with a language construct that a developer can take advantage of when building a MapBasic application. For example I'm developing an application that will dynamically populate a form with drop-down lists. It would be nice if I could build up the constraint lists with something like:               Create ConstraintCollection         Add Property             Name "property"             Add Value "value 1"             Add Value "value 2"             Add Value "value 3"      Is defining this `Create ConstraintCollection` statement something that is possible with MapBasic?


Geocoder leaflet for internal use in the company, which take addresses from any part of the street

I am making a personal application routing to be used internally in the company using machine leaflet route. The plugin uses nominatim geocoder, but he geocodificia according to the links of the OSM. I need to get the long / lat of arbitrary points, for example if the A Street No. 1234 is in the middle of the block on the corner geocode returns. That for purposes of mileage will make a difference to me. Would like suggestions of geocoder that meet this need, remembering that the application is built.


How to get all the FeatureClasses from IWorkspace?

Well i create a Geodatabse in my SQL Server using ArcCatalog then i create 5 new FeatureClass, i want to get all the FeatureClasses in this GDB, this is my function to get all the FeatureClasses from a workspace, my problem is that i can't get all the FeatureClasses (5) sometimes i get 2 and sometimes only 1 FeatureClass.                       public static List<ILayer> getLayersFromWokrspace(IWorkspace workspace)         {             List<ILayer> layers = new List<ILayer>();             IFeatureWorkspace fw = (IFeatureWorkspace)workspace;                        // i tried the both ways to get the datasets in the workspace (i tried the type "esriDatasetType.esriDTAny" too)             IEnumDataset datasets = workspace.get_Datasets(esriDatasetType.esriDTFeatureClass);             //IEnumDataset datasets = workspace.Datasets[esriDatasetType.esriDTFeatureClass];                       IDataset dataset = null;             while ((dataset = datasets.Next()) != null)             {                 if (dataset.Type == esriDatasetType.esriDTFeatureClass)                 {                     IFeatureClass featureClass = fw.OpenFeatureClass(dataset.Name);                     IFeatureLayer featureLayer = new FeatureLayerClass();                     featureLayer.FeatureClass = featureClass;                     ILayer layer = (ILayer)featureLayer;                     layer.Name = dataset.Name;                     layers.Add(layer);                 }                 dataset = datasets.Next();             }                  return layers;         }


Validity of ordinary kriging of polygon centroids

I'm in a discussion with a colleague who believes that kriging should not be used to interpolate a surface from polygon based data (i.e. with kriging applied to centroids), because this effectively translates the spatial uncertainty inherent in any polygon centroid into data error in the kriged surface. I'm sure he's right in principal but cannot help thinking that the uncertainty-error question should not be an absolute argument against the method give that uncertainty is (a) unavoidable and (b) a function of zone size and the degrees to which the data has already been aggregated. I'd be interested to hear views from others, particularly anyone with good experienced of kriging interpolation.


How to open a Data Reviewer 10.1 Batch Job in Data Reviewer 10.0

I have begun creating several reviewer batch jobs (RBJs) to use with electric and water utility data. The RBJs came as ESRI templates (electric and water) and I have been modifying them with Data Reviewer 10.1. I recently tried opening the RBJ with Data Reviewer 10.0, which subsequently gave me the following error: > Error opening batch job. This is an incompatible version of the Reviewer > Batch Job. The templates read as version 9.3/10.0, until I modify them and save in 10.1. Does anyone know of a way to downgrade or read the RBJs in 10.0?


Dynamic title in ArcMap

How can I have a dynamic title of the map, which changes depending on the layer chosen? Is this doable? It would save a lot of time and iterations since I should be producing several maps. To illustrate, I want the title to get the name of the first layer ticked if several layers are ticked. Any hint will be useful.


arcpy Problem with updateRow() when trying to update fields with UpdateCursor

I have a list of values which I am trying to add to an existing shapefile. The field where the values need to be inserted has been added via arcpy.AddField_management and thus the values of the rows are empty or 0. The variable expression1 is a list of floats with the length of the rows in the shapefile. To update the rows I use UpdateCursor:               import arcpy     import math     from arcpy import env     env.workspace = "S:/Black grouse modelling/shapefiles"     inFishnet = "fishnet_label.shp"     rows = arcpy.UpdateCursor(inFishnet)     fields = arcpy.ListFields(inFishnet)     for row, i in zip(rows, expression1):         for field in fields:             if field.name == "dist":                 print i                 row.setValue(field.name, i)                 rows.updateRow(row)     del rows     del row      The output I get is as follows:               1265.60109093          Traceback (most recent call last):       File "<pyshell#218>", line 6, in <module>         rows.updateRow(row)       File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\arcobjects.py", line 102, in updateRow         return convertArcObjectToPythonObject(self._arc_object.UpdateRow(*gp_fixargs(args)))     RuntimeError: ERROR 999999: Error executing function.      The value I want it to update with gets printed as requested (1265.60109093). And I think there isn't a problem with the row.setValue() line. The error comes when I am trying to update the row. I have thought it might be an issue with the float numbers. As these might be longer than the field allows for. However, I have tried rounding the numbers and then inputting those values into the rows but that doesn't work either. I have also tried the following code without setValue() but this doesn't work either:               for row, i in zip(rows, expression1):         print i         row.dist = i         rows.updateRow(row)      Any help is appreciated. EDIT: as requested the values of expression1:               expression1[:5]     [1265.6010909259928, 1247.9398102685327, 1232.0557693355686, 1218.0185004559901, 1205.8924977596705]      which is calculated via the following function:               def distFrom(self, other):             ox = other.x             oy = other.y             xDist = self.x - ox             yDist = self.y - oy             return (xDist**2 + yDist**2)**0.5      Obviously I do not need these values to be so accurate, but rounding them to 2 decimals for example does not solve the problem. I have also tried it with a different variable where the values are either True or False and converting these to strings. This does also not solve the problem. I am using python 2.6.5 and arcGIS 10.0


Get IWorkSpace from IGxObject

I am creating a tool that opens an `IGxDialog` which it's objects are filtered to show only workspaces, my question is how can I convert `IGxObject` to `IWorkSpace` or get the selected workspace without taking the selected object name and opening it using an `IWorkSpaceFactory` Thanks in advance


Geoserver WMST Date Format

There is table in SLQ-Server 2008 R2. In this table i have date column with date format like this `2006-09-08 14:39:41.000`. Now i make View from this table on Geoserver side but do nothing wiht date field. And make WMST layer. Now i go into Layer Preview and not see any features.   Okey i says. I take source table and publish it on geoserver but geoserver not see date column.   Whats wrong? In Geoserver docs i see that in WMST i gonna use ISO-8601 time format. How can i convert date format in view on Geoserver? **UPDATE** I make some tests.   I take Shape file with date field (i.e. 2002-08-20) put it into SQL-Server using `ogr2ogr`. SQL-Server says that my date field is date data type. Geoserver says it too. And in Layer Preview i see my features and after addin in address line `TIME=2002-08-21` parameter i can see features with other dates.   After i add `datetime` field in my table and put into dates like `2002-08-20 14.00.00.000`. Geoserver says that its `Timeswap` datatype. In Layer Preview i DONT GET any features addind `TIME=2002-08-21T14.00.00.0Z` not help. When i click on map i get error that `cant convert varchar into datetime`.


How do you update the maxFeatures setting of a WFS layer in OpenLayers

I have a WFS layer which a protocol in the definition. The protocol states that the maxFeatures returned should be 1 to avoid downloading a large amount of data. I can update the value for maxFeatures using layer.protocol.maxFeatures and this registers as updating successfully but when I then call a layer.refress({force:true}); command the actual WFS request still appears to be limited to 1. Is there a good example of how to modify a WFS protocol using javascript once the layer has already been loaded into the map? Many thanks


How to check if domain already exists?

I am trying to check the existence of domains in my file geodatabase which contains 4 domains (automatically populated after I created some annotation feature classes). My code is as follows:               import arcpy          workspace = env.workspace = r"Z:\Test.gdb"          desc = arcpy.Describe(workspace)     domains = desc.domains          for domain in domains:         if arcpy.Exists(domain):             print domain      The issue I have is the behavior of the 'Exists' method'. When I set a conditional sentence to:               if arcpy.Exists(domain):             print domain      the domains does not print. I'm thinking the code reads like 'If the domain exists, then print out the domain'. Because I have 4 domains, it should print these, but it doesn't. I tried the reverse:               if not arcpy.Exists(domain):             print domain      In this case, the domain gets printed out which seems counter intuitive. To me this reads like 'If the domain does not exists, then print the domain which should return nothing because it does not exist' I want to test if any domains exists, instead of using a conditional statement to test if specific domains exist. Thanks, Mike


How do I keep user from selecting a different tool when my custom tool is selected?

I am using VB.Net to write an add-in. I'd like to keep the tool that I created selected even when the user attempts to select a different tool, and only deselect when my tool is clicked on again.


Manually edit a raster to improve a classification?

I have a land cover classification derived from Landsat TM imagery - I created this classification using ENVI. I would like to edit individual and groups of cells in some areas of the classification in order to improve the accuracy of the output by comparing it with aerial imagery. Is there a way, using ENVI or ArcGIS, to manually edit large groups of cells by selecting them and assigning them to a new or existing class? I am aware of merging methods based on class statistics, but the area I'm classifying has a high amount of spectral confusion due to thin cloud cover - it seems like a manual edit is the only way to go.


How to calculate the angle at which two lines intersect in PostGIS?

I want to calculate the angle between two lines where they intersect in PostGIS. The starting point for angle calculations in PostGIS seems to be ST_Azimuth \- but that takes points as input. My first thought was to take the endpoints of the intersecting lines and performing an Azimuth calculation on those. That is not good enough, because most of the line features are not straight, and I am interested in the angle at intersection. So what I came up with is a nested operation that goes through the following steps:   1. Identify all the intersections between the two line feature tables.   2. Create a very small buffer around the intersection point   3. Identify the points where the line features intersect the buffer exterior (taking the first point if there are more than one - I'm really only interested in whether the angle is close to 0, 90 or 180 degrees)   4. Calculate ST_Azimuth for those two points. The full SQL is kind of long to post here, but I gisted it here if you're interested. (By the way, is there a better way than to carry over all the fields going down the WITH statements?) The results don't look right, so I'm clearly doing something wrong: ![output example 1](http://i.stack.imgur.com/MrtJU.png) ![output example 2](http://i.stack.imgur.com/NkpTM.png) EDIT I redid the calculations in EPSG:3785 and the results are a little different but still not right: ![output in 3785 #1](http://i.stack.imgur.com/Pc6uN.png) ![output in 3785 #2](http://i.stack.imgur.com/xipwN.png) My question is where the flaws are in this process. Am I misunderstanding what ST_Azimuth does? Is there a CRS issue? Something else altogether? Or maybe there's a much, much simpler way to do this?


Saving *.dbf as *.xls using Python?

i've been let loose in the workplace to learn python to do things in Arcmap10. so, i've learning python as i go and trying to remember the programming i have done. where i am in this project is converting a dbf, or csv, xls in a simple fashion. from there, all the files will be copied together into one file. i've got the all-in-one xls working, but i can't find an easy, simple dbf to xls solution. i condensed code found here: http://blog.gmane.org/gmane.comp.python.education/page=12 into:               from xlwt import Workbook     import dbfpy.dbf          input0 = '...file.dbf'     output = '...file.xls'          def test1():         dbf = dbfpy.dbf.Dbf(input0)         book = Workbook()         sheet1 = book.add_sheet('Sheet 1')         for row in range(len(dbf)):             for col in range(2):#chop to two for my purposes, gm                  sheet1.row(row).write(col, dbf[row][col])         book.save(output)          test1()      this works, minus the lack of field names.


managing postgresql database table using the pgadminIII sql tool

i have created a database using postgresql 9.1 and a table containing parcel information for a town council database on a windows 7 OS. i created the geometry column using the SELECT AddGeomatryColumn function and left the geometry column empty at first. now i want to insert the coordinates of each parcel using the sql tool from the general plan which is in a hardcopy. which query must i use to insert the coordinates one by one? i think i can insert coordinate for each parcel by specifying the erf number of the parcel. any help please


How to remove black background from geoserver imagepyramid?

I have a large ImagePyramid published in Geoserver (v 2.4). Each granule in the pyramid has nodata set to 0. I'm confused as to which layer parameter in GeoServer should I change to get a transparent background. I tried changing `BackgroundValues`; `InputTransparentColor` and `OutputTransparentColor` but nothing seemed to work. How can I make the background transparent? ![Black color in the background that I'd like to remove](http://i.stack.imgur.com/aOVvI.png)


'The layer and specified base surface do not overlap in extent' error message

I am trying to change the base height of a jpg file to but it comes up with the message:'The layer and base surface do not overlap in extent. Verify they are for the same study area'. Both layers are in the same coordinate system. Can anyone help solve the problem? Thanks


Examples of evolving networks in GIS

I'm a master student working on networks analysis in general. A network is something that has nodes and there are links between the nodes. Nodes and links could have attributes. An evolving network is one that changes overtime (new nodes and links are added..etc). An example of that is Facebook. Nodes are users and links represent the friendship relationship. Users have attributes (gender, age ..etc). A Facebook network as you know is an example of a social network. The issue is that so many people studied traditional evolving networks like social networks, the web, or transportation networks. Currently I'm looking for novel examples of evolving networks to study them. So I thought there might be some examples in _GIS_ that could represent some kind of an evolving network. So my question: Can you give me examples in _GIS_ for evolving networks?


How to use Google Maps projection with GeoDjango/PostGIS

I am building a web service with GeoDjango which involves user submitted events including a location. I created a model field for my location using `django.contrib.gis.db`:               location = models.PointField(srid=900913)      I chose to specify `900913` as I read that this is the projection used by Google Maps and I am getting the location by placing a marker on a Google map. The coordinate is presented to me in lat/lng form. I am storing this point in a PostGIS DB using GEOS:               location = geos.Point(data['lng'], data['lat'], srid=900913)      If I want to view this point on a map, I get the lat and lng from my DB (e.g. `lat = location.coords[1]`) and use them to centre my map and this works fine. When I want to browse a map and display events from DB which lie inside the map bounds I use GeoDjango's `within` query and the maps bounds (in lat/lng format):                   bounds = geos.Polygon.from_bbox((swLng, swLat, neLng, neLat))         events = Event.objects.filter(location__within=bounds)      This appears to work fine and I display pins on the map corresponding to the lat/lng of these events. So far nothing would suggest that anything is going wrong, however I am completely new to this stuff and I want to ensure that I'm getting it right for when I inevitably want to use my location data in more complex ways. The reason I'm suspicious is that my Django admin pane does not display the location correctly on the OpenStreetMap. It shows a point which appears to correspond to the (0,0) point shown here. The displayed text version of the location field is `SRID=900913;POINT(-1.277482509613037 50.874104373286066)`, which is clearly still in lat/lng. As I move my mouse around the admin map I can see the displayed coords in the bottom right corner are in 900913 format, and not in lat/lng. Please can you explain how I can store my location points in the correct format, and what advantages this has over simply using lat/lng (my guess is that if I want to specify say a distance in km for lookups, I can't use my lat/lng locations).


Drawing irregularly shaped boundary polygon around set of LAS points using ArcMap?

I am working with a set of LAS data which is irregularly shaped, picture a starfish as the point coverage, surrounding the starfish may be water on one side, may be more land elsewhere but no points were collected for it. In fact most of the areas around this starfish of points is land without points collected, and inside the starfish shape is a little lake. I want to make a DEM of just the area where points were collected, and there are many ways of doing this, but most will interpolate all the no-point areas inbetween "arms" of the starfish data point pattern. Making the DEM by using a Terrain Dataset allows for the input of a bounding shape, to theoretically omit no-point areas from being interpolated and only geoprocessing inside of the boundary shape. However, I have difficulty coming up with a precise bounding polygon of the outside edge of the starfish to use as my geoprocessing limiting extent. I found a process online in a blog by Clayton Crawford which was picked up by ESRI and used as their help file for the process of turning LAS to DEM's, but it involves downloading a custom VBA script and several steps which went a bit over my head. So I am wondering if anyone out there has a suggestion on how to get that starfish pattern of LAS datapoints inside a bounding starfish-shaped polygon, without the use of VBA, or alternately if there's a way to go right from LAS to DEM raster with no-point areas end up as NoData. I'm using ArcGIS 10.1 for Desktop. Any suggestions on this are appreciated.


How to replicate ArcGIS coordinate transformation with ogr2ogr?

I need to be able to replicate with **_ogr2ogr_** a coordinate transformation that was executed in **_ArcGIS for Desktop_**. Both ArcGIS and ogr2ogr are based on **_EPSG standard definition_**. There's not only one way to transform data from a reference system **A** to a reference system **B** , but many transformations are possible **(T1, T2 ... Tn** ). After a lot of reading i understood that EPSG codes define, among many other things, CRS (coordinate reference systems, A and B in the previous example), and possible transformation between them (T1...Tn). When in gis one performs a coordinate transformation ArcGIS prompts the user with the choice of a transformation. On the other side ogr2ogr simply works specifying the source and destination CRS. two questions then arise:   * what kind of transformation does ogr2ogr performs? is it still based on the transformation defined within the epsg standard?   * Is it possible to force ogr2ogr to use a transformation specified via an epsg code? please keep in mind that my goal is to replicate a transformation executed in gis (thus identified by an epsg code), with a call to ogr2ogr.


Problem while inserting an object into ArcMap

I get this error, when I try to insert a pdf file into ArcMap Layout view. I have clicked on Insert - Object - create from file, browsed the geo pdf and pressed ok. I get this error: > Failed to create object. Make sure the object is entered in the system > registry < I searched for this error and found this: > http://support.esri.com/zh-cn/knowledgebase/techarticles/detail/27401 Where > can I find the script blocking option in Nod32? defence temporary disable is > not enough. Or the problem is not with the scripts running in background in > that time?


Is there Python library (other than ArcPy) for geoprocessing such as buffer?

Excluding ArcPy, is there any python library which can do geoprocessing, such as buffer/intersect, with shapefiles?


What coordinate system should be used to store geography data for celestial coordinates?

I am doing an astronomy project. I want to have the information about our images stored in a spatially enabled database. This, I would think, should be a very easy special case for GIS functions because the sky can be treated as perfectly spherical, and does not require an elliptical treatment like the surface of the earth. Unfortunately, I have not found a way to do this yet and I have been dodging mines with spatial functions that use an elliptical earth. (Pretty much any function that returns meters instead of degrees may be using an elliptical calculation. Luckily, many of the PostGIS functions I've needed appear to have incomplete implementations where the documentation explicitly states that the returned results are for a sphere and not for the ellipsoid. But that may change with future versions, which is a cause for concern.) Background: I am presently using PostgreSQL with PostGIS and WGS 84 coordinates (SRID=4326). This works fairly well. I am creating a closed POLYGON from the right ascension and declination of the four corners of the image. I have a lot of images (10k or more), covering a large area of the sky. Each images is about 1 degree square. From the set of these images, I am making mosaics from small subsets of 15 to 30 images. Each mosaic is about 1.5 degree square. Presently, I am storing the geography of the mosaics as a MULTIPOLYGON that consists of all the POLYGONS corresponding to each image that went into the mosaic. [A better solution would be to create a single POLYGON that describes the _perimeter_ of the union of all the individual polygons. I don't know if this can be done in spherical coordinates (i.e., that the geography type). This would also be an interesting answer for me too.] The date line and celestial poles may be included in an image in the dataset so I have been avoiding projecting to planar coordinates to the extent possible. My specific question is: What coordinate system ought I use for _celestial coordinates_ with PostGIS functions? I have looked at http://spatialreference.org/ but have not found anything so far. Google has turned up little. I am stumped. Basically, I want to ensure that if a function returns meters as a distance, it is meters along a great circle on a sphere. More generally, some advice for using celestial coordinates in a spatial database would also be appreciated. Have I erred by choosing PostGIS? Are there far superior commercial choices? FOSS choices? EDIT: I am using PostGIS 1.5.2. I have not yet tried PostGIS 2.0. I am curious if the ST_CoveredBy function works with a POLYGON and a MULTIPOLYGON of type geography. If anybody is running 2.0, could you tell me if you get the same error as this:               mydb=# select ST_CoveredBy(ST_GeographyFromText('MULTIPOLYGON(( (10.37795 -69.57926,8.9498 -69.54875,9.0178 -69.21643,10.4242 -69.24648,10.37795 -69.57926),(10.42436 -69.24618,9.01774 -69.2162,     9.08363 -68.88389,10.46914 -68.91344,10.42436 -69.24618)))'),ST_GeographyFromText('POLYGON((10.46915 -68.91315,9.08371 -68.88364,9.14755 -68.5513,10.5125 -68.58038,10.46915 -68.91315))'));     ERROR:  geography_covers: only POLYGON and POINT types are currently supported     CONTEXT:  SQL function "st_coveredby" statement 1      EDIT 2: I have tried PostGIS 2.0. This function still only works on points and polygons, not more general shapes. :-(


Does a Scanned Map have to be georeferenced in the projection of the original Source?

I have a historic paper map for the Indian Sub-continent which has been scanned. The Map is in Albers Equal Area Conical projection, and has the latitude and longitude grid on it. I was trying to georeference in the projection of the source, but I do not have all the required parameters for this projection. Only the two standard parallels are noted on the map. I don't know the Central Meridian or the Latitude of origin, or the datum for that matter. What should be done in this kind of situation? Since this is a map which spans 4000km by 4000km, I don't really think it is possible to get any kind of high accuracy output. I was thinking of georeferencing it in wgs84 Geographic coordinate system. Is this a good idea? Or is there something else which you would suggest?


What is relation- difference and/or similarities between PPP, SBAS, GNSS, RKT?

Recently i came across lot of terms such as IGS, GNSS, GPS,PPP, WAAS, EGNOS, GLONASS, CORS and many more ... I know some of them I can group them such as GPS, GLONASS, GALILEO . And then there is SBAS ...but can any one explain and provide useful links ? What is hierarchy can some draw it ?


Import GRD and count days with temperature below zero, using python

Minimum temperature of a year is given in GRD file. I have to read that file and then calculate the frost day (less than zero degrees celcius) from it in python.


Mapping latlng values to a point on a HRAP grid

I have a copy of some NWS rainfall data loaded into a PostGIS database. Given a lat lng point, I want to find the rainfall for that given day. > The original data are in XMRG format and projected in the Hydrologic > Rainfall Analysis Project (HRAP) grid coordinate system, a polar > stereographic projection true at 60°N / 105°W. Based on a description of the HRAP system I found from the NWS, the calculations for locating a point on the HRAP grid based on lat lng value are as follows: > RE = (EARTHR*(1+SIN(60)))/xmesh   >  R = (RE*COS(xlat))/(1+SIN(xlat))   >  WLONG = xlon+75   >  X = R*SIN(WLONG)+401   >  Y = R*COS(WLONG)+1601 > > EARTHR is the radius of the earth (6371.2 KM)   >  xmesh is the mesh length at 60° latitude (4.7625 KM)   >  xlat is the latitude of point to be converted (decimal degrees)   >  xlon is the longitude of point to be converted (decimal degrees) I wrote up a quick javascript implementation to test it:               var deg2rad = function (deg) { return deg * (Math.PI / 180); };          var hrap = function (xlon, xlat) {         var rxlon, rxlat, re, r, wlong, rwlong, x, y;         var earthr = 6371.2;         var xmesh = 4.7625;              rxlat = deg2rad(xlat);              with (Math) {             re = (earthr * (1 + sin(PI / 3))) / xmesh;             r = (re * cos(rxlat)) / (1 + sin(rxlat));                  wlong = xlon + 75;             rwlong = deg2rad(wlong);             x = round(r * sin(rwlong) + 401);             y = round(r * cos(rwlong) + 1601);         }              return [x, y];     };      I ran a couple data points from the 2013-05-17 data set through to test it, with the following results:               Lng        Lat      NWS X  NWS Y  Calc X  Calc Y      -76.5633  39.7478    958    571     369    2771     -124.6132  42.7528     34    572    -431    2308      Those numbers are nowhere close to correct, and I don't know why. Is the document wrong? Did I mess up the implementation? Is the test data bad? Am I missing a simpler solution? I'd appreciate it if someone could point out where this is going wrong.


How to use a .qpt made in another project?

I'm trying to make maps in print composer of several different projects. I would like the maps to look the same, just for different areas, so I tried to use the .qpt that I made in the first project in the second one, but GIS data doesn't display? I just get the legend, frame and scalebar from the first map to show? I read the manual, but the problem is that I still don't understand how to update the map with the information showing in the second project's map canvas? What am I missing?


How can I send a parameter with a RouteTask and get it back in RouteResult

I'd like to send a parameter with the Route Task and be able to get that same parameter in the RouteResult object. The goal is to be able to recognize the routes I receive from the server when I perform many solve operations on the same RouteTask.


Overlapping polygon outlines dashed at overlapping locations but solid elsewhere

In ArcMap 10.0, if one smaller polygon fits inside of another and shares a portion of the larger polygon's boundary, and they both are set to display thick outlines on the inside, is there a way to make them dashed where they overlap so that you can see where the outlines coincide? And then just have the outlines solid everywhere else?


ESRI Basemaps - World Imagery: Is it possible to bring certain imagery into foreground (change the viewing order)?

I have a basemap loaded in a map in which there are 4 overlapping images. I would like to either turn off 3 of the 4 images or bring the one i want (marked with X n the screen capture) into the foreground. Is this possible? Is there a workaround? I tried un-checking lower resolution layers in the TOC but a messages pops up saying that thisis not possible. ![enter image description here](http://i.stack.imgur.com/aZ0tZ.jpg)


gdalcontour output not aligned with the DEM

I use gdalcontour to generate the contour lines of a DEM in shapefile format. However the shapefile is not aligned with the DEM. Someone have a solution for this? GDAL version is 1.10 im using thins command:               gdal_contour -a height 012_merged.tif 012_contour.shp -i 25.0      ![enter image description here](http://i.stack.imgur.com/Y5TL4.png) gdalinfo:               Driver: GTiff/GeoTIFF     Files: 012_merged.tif            012_merged.tif.aux.xml     Size is 9601, 4801     Coordinate System is:     PROJCS["WGS 84 / Pseudo-Mercator",         GEOGCS["WGS 84",             DATUM["WGS_1984",                 SPHEROID["WGS 84",6378137,0,                     AUTHORITY["EPSG","7030"]],                 AUTHORITY["EPSG","6326"]],             PRIMEM["Greenwich",0],             UNIT["degree",0.0174532925199433],             AUTHORITY["EPSG","4326"]],         PROJECTION["Mercator_1SP"],         PARAMETER["central_meridian",0],         PARAMETER["scale_factor",1],         PARAMETER["false_easting",0],         PARAMETER["false_northing",0],         UNIT["metre",1,             AUTHORITY["EPSG","9001"]],         EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +     x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"],         AUTHORITY["EPSG","3857"]]     Origin = (-7124459.006549800700000,6446293.880868392100000)     Pixel Size = (23.191010033770905,-35.712191611463290)     Metadata:       AREA_OR_POINT=Area     Image Structure Metadata:       INTERLEAVE=BAND     Corner Coordinates:     Upper Left  (-7124459.007, 6446293.881) ( 64d 0' 0.37"W, 50d 0' 0.37"N)     Lower Left  (-7124459.007, 6274839.649) ( 64d 0' 0.37"W, 48d59'59.54"N)     Upper Right (-6901802.119, 6446293.881) ( 61d59'59.80"W, 50d 0' 0.37"N)     Lower Right (-6901802.119, 6274839.649) ( 61d59'59.80"W, 48d59'59.54"N)     Center      (-7013130.563, 6360566.765) ( 63d 0' 0.09"W, 49d30' 9.16"N)     Band 1 Block=9601x110 Type=Int32, ColorInterp=Gray       Description = Mosaicked Band       Min=1.000 Max=305.000       Minimum=1.000, Maximum=305.000, Mean=66.113, StdDev=78.056       NoData Value=-32767       Metadata:         STATISTICS_MAXIMUM=305         STATISTICS_MEAN=66.11288340405         STATISTICS_MINIMUM=1         STATISTICS_STDDEV=78.056016483986


Can't load pgrouting extension, could not load library librouting_dd.ddl error 998 windows

I have a windows 7 machine 64-bit, I installed Postgresql 9.3 via the opengeo suite 4.0.2 in the program files (x86) folder, so I guess I have to install the 32-bit version of the extension. I am trying to load the 2.0.0 version of pg routing and I always get the mentioned error message. Anyone has suggestions in order to get work?


Autoincrementing Python Script is over writing all fields versus just fields that are null

Using ArcMap and the Field Calculator I have a python script that should autoincrement the FacilityID field if it is null. It works the first time through but the second run causes it to overwrite all of the fields versus just retreiving the last value that was used and only inserting the id to only the null fields. Can this be done in the field calculator? Here is my Python Script:               import arcpy     nullvalues = ["", " ", None, 0]     fac_id_values = []     def autoIncrement():      # Loop through and get Max value      fc= "C://GIS//Nambe_Data//nambedatabase//Nambe_ExistingInfrastructureSurvey_v1x0.gdb//CommunicationInfrastructure//cTelcomLine"      with arcpy.da.SearchCursor(fc, ['FacilityID']) as cur:          fac_id_values = [int(row[0][-4:]) for row in cur if row[0] not in nullvalues]           try:          max_value = max(fac_id_values)      except:          # Make an allowance for fac_id_values to be empty          max_value = 0      # Loop through and Calculate new values      with arcpy.da.UpdateCursor(fc, ['FacilityID']) as ucur:          for row in ucur:           if row[0] in nullvalues:               max_value += 1               row[0] = "COMLI1" + str(format(max_value,'04d'))               print row               ucur.updateRow(row)      ![enter image description here](http://i.stack.imgur.com/mhuPb.png) If you look at the first entry for FacilityID it should be COMML11001 but its COMML110346. The script should not overwrite the FacilityID's that aren't null. EDIT:               import arcpy     #nullvalues = ["", " ", None, 0] #not sure about none in a list lookup     #The where clause to subset just the records to be calculated     WhereClause = "FacilityID IS NULL or FaclityID in (\"\",\" \",\"0\")"     NotWhereClause = "FacilityID IS NOT NULL or FaclityID not in (\"\",\" \",\"0\")"     fac_id_values = []     def autoIncrement():      # Loop through and get Max value      fc= "C://GIS//Nambe_Data//nambedatabase//Nambe_ExistingInfrastructureSurvey_v1x0.gdb//CommunicationInfrastructure//cTelcomLine"      with arcpy.da.SearchCursor(fc, ['FacilityID'],NotWhereClause) as cur:          fac_id_values = [int(row[0][-4:]) for row in cur if row[0] not in nullvalues]          #What's happening here? I can't tell.. is something missing??      try:              max_value = max(fac_id_values)      except:          # Make an allowance for fac_id_values to be empty          max_value = 0      # Loop through and Calculate new values      # Use the where clause to just get the rows you want      with arcpy.da.UpdateCursor(fc, ['FacilityID'], WhereClause) as ucur:          for row in ucur:           #if row[0] in nullvalues or row[0] == None: #That's how I'd do it, but it can be skipped               max_value += 1               row[0] = "COMLI1" + str(format(max_value,'04d'))               print row               ucur.updateRow(row)      Ok I ran the script again today and this is the error I got.               Messages     Executing: CalculateField "Communication\Telecommunications Line" FacilityID autoIncrement() PYTHON_9.3 "import arcpy\n#nullvalues = ["", " ", None, 0] #not sure about none in a list lookup\n#The where clause to subset just the records to be calculated\nWhereClause = "FacilityID IS NULL or FaclityID in (\"\",\" \",\"0\")"\nNotWhereClause = "FacilityID IS NOT NULL or FaclityID not in (\"\",\" \",\"0\")"\nfac_id_values = []\ndef autoIncrement():\n # Loop through and get Max value\n fc= "C://GIS//Nambe_Data//nambedatabase//Nambe_ExistingInfrastructureSurvey_v1x0.gdb//CommunicationInfrastructure//cTelcomLine"\n with arcpy.da.SearchCursor(fc, ['FacilityID'],NotWhereClause) as cur:\n     fac_id_values = [int(row[0][-4:]) for row in cur if row[0] not in nullvalues]\n     #What's happening here? I can't tell.. is something missing??\n try:\n     max_value = max(fac_id_values)\n except:\n     # Make an allowance for fac_id_values to be empty\n     max_value = 0\n # Loop through and Calculate new values\n # Use the where clause to just get the rows you want\n with arcpy.da.UpdateCursor(fc, ['FacilityID'], WhereClause) as ucur:\n     for row in ucur:\n      #if row[0] in nullvalues or row[0] == None: #That's how I'd do it, but it can be skipped\n          max_value += 1\n          print row[0] + " to COMLI1" + str(format(max_value,'04d')\n          "     Start Time: Tue May 20 09:44:24 2014     Failed to execute. Parameters are not valid.     ERROR 000989: Python syntax error: Parsing error SyntaxError: invalid syntax (line 25)     Failed to execute (CalculateField).     Failed at Tue May 20 09:44:24 2014 (Elapsed Time: 0.00 seconds)


How to perform a "mostly within" selection?

I'm looking for a way to determine if a polyline is "mostly within" a polygon. Since mostly within is arbitrary, I would need be able to enter a percentage at its execution. I thought there might have been an option in ArcMap using Select By Location, but there doesn't seem to be. There are similar methods, such as "completely within" but I don't see how I can use any of them to achieve what I'm looking for. I'm open to suggestions that use either built in ArcMap functionality or ArcPy. Does this functionality or a method exist to achieve this?


QGIS 2.2. raster color ramp

I have just upgraded from QGIS 1.8 to QGIS 2.2 and I am missing very much 1-band raster color ramp plugin that I had easily colorized my DEMs by using pre made color brewer such as DEM screen or DEM print or DEM poster. I have not found the solution yet in QGIS 2.2.. Is there something like 1-band raster color ramp for QGIS 2.2 or any other solution? Thanks Cengiz


How to get all selected features from a specific feature class in C#

I am looking for a way to get all selected features from a map which belongs to a specific feature class (shape file, geo database,…). To be more specific and to give you a real case for my question: I want check if the feature class of selected feature has a special field. If this is the case I want to get the value of this field from the selected feature and add this value into a combobox. This process should be repeated for all selected features. I tried the following but it crashed with an object reference error.               List<string> list = new List<string>();     IMap Pmap = doc.FocusMap;     IEnumFeature pEnumFeat = (IEnumFeature)Pmap.FeatureSelection;     pEnumFeat.Reset();     IFields fields;     try     {       IFeature pfeat = pEnumFeat.Next();       while (pfeat != null)       {         fields = pfeat.Fields;         int x = fields.FindField("ID_K");         if (!x.Equals(-1))         {           list.Add(pfeat.get_Value(x).ToString());         }         pfeat = pEnumFeat.Next();         }     }     catch (Exception e)     {       Console.WriteLine(e.Message);     }      Thanks a lot! **UPDATE:** I've found a solution. Here is the working code:               List<string> list = new List<string>();     IMap Pmap = doc.FocusMap;     IEnumFeature pEnumFeat = (IEnumFeature)Pmap.FeatureSelection;     IFields fields;     pEnumFeat.Reset();     IEnumFeatureSetup enumFeatSetup = (IEnumFeatureSetup)pEnumFeat;     enumFeatSetup.AllFields = true;     try     {        IFeature pfeat = pEnumFeat.Next();             while (pfeat != null)        {           fields = pfeat.Fields;           int x = fields.FindField("ID_K");           list.Add(pfeat.get_Value(x).ToString());                pfeat = pEnumFeat.Next();         }      }      catch (Exception e)      {         Console.WriteLine(e.Message);      }      These two line are especially important.               IEnumFeatureSetup enumFeatSetup = (IEnumFeatureSetup)pEnumFeat;     enumFeatSetup.AllFields = true;      If you dont use them you've only the shape file included (default) and not the other fields and values. Thank you all for your responses!


Not able to save edits to vector layer in QGIS

I have a vector layer with about 200 features. So far I have been able to add polygons to this layer just fine, now it is giving me trouble. When I draw the polygon and try to save edits, the polygon disappears. In a few cases the polygon is saved successfully though it is rare. Then occassionaly the polygon disappears but the attributes that are assigned do appear in the attribute table. Any suggestions how to get through this?


Limit Zooming Geometry Features in OpenLayers

I draw flag feature on my map as follows:               myVectorLayer = new OpenLayers.Layer.Vector("Flag Geometry", {     renderers: renderer,     isBaseLayer: true,     projection: new OpenLayers.Projection("EPSG:900913"),     styleMap: new OpenLayers.StyleMap({         "default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({             fillColor: "red",             strokeColor: "gray",             label: "${label}",             fontColor: "${favColor}",             fontSize: "12px",             fontFamily: "Courier New, monospace",             fontWeight: "bold",             labelYOffset: 2 //for flag         }, OpenLayers.Feature.Vector.style["default"])),             "select": new OpenLayers.Style(OpenLayers.Util.applyDefaults({         }, OpenLayers.Feature.Vector.style["select"]))     })     });          var pointList = [];     var xs = [0, 0, 240, 240, 8, 8, 0];     var ys = [0, 280, 280, 120, 120, 0, 0];          for(var p=0; p<6; ++p) {         var newPoint = new OpenLayers.Geometry.Point(camera.get('latitude') + xs[p],             camera.get('longitude') + ys[p]);              pointList.push(newPoint);     }     pointList.push(pointList[0]);     var linearRing = new OpenLayers.Geometry.LinearRing(pointList);     var flagVector = new OpenLayers.Feature.Vector(             new OpenLayers.Geometry.Polygon([linearRing]));          flagVector.attributes= {         label: 'label',         favColor: 'blue', //favorite color         align: "cm"     };     myVectorLayer.addFeatures([flagVector]);      This zooms by default when zooming the map but when zooming out the feature becomes so small that it disappears. Is there a way to limit this zooming effect for the feature so that it stops zooming out the feature after a certain level?


Arcpy does not execute "CopyFeatures_Management" to write a featureclass to an ArcSDE database

I have some problems with my Python script. The script gets an JSON with different information about images. The information includes general information about images and also the gps position of them. Wih this information a featureclass should be generated that shows the location of the pictures as point geometry. The other information should be stored in the attribute table. The script runs very well and is already deployed on ArcGIS Server 10.1. Now the problem is, that at the first start the featureclass has to be created. As the featureclass consists of about 92 attribute fields the process of creating the featureclass is done with the option "in memory" as this option guarentees a fast creation of the featureclass - it is at least faster then directly running `arcpy.addfield_management()` on a feature class that was created the other way. The disadvantage is that I want to store the featureclass permanently in a ArcSDE geodatabase. For this I have to run one of the tools `arcpy.featureclasstofeatureclass_conversion` or `arcpy.copyfeatures_management`. If the script is trying to run on of these lines I get the error message 000210 that is telling me that the output cannot be generated. The connection to the ArcSDE works fine, this cannot be the problem. I have full write and read access. Does anybody know what the error message is about and what could be one solution? The script works fine if I am not using the "in memory" option for the feature class. So this error must have his origin in the "in memory" option. The log file of the Database gives only an general error message: "Oracle : ORA-3137[3149]".


Coordinate extraction in a different projection in MapInfo

I have a .TAB file of polyline objects in British Grid Coordinate. I need to extract the end points/nodes of each polyline and find their latitude/longitude (WGS84). Would really appreciate some help. Thanks


Drawn figure looks stretched

I have written some code which offset a certain latitude and longitude with a distance in centimeters. What I am trying to do is based on a coordinate and a vector create two new points along the line described by the vector. I believe I have succeeded in doing this but the results I am getting are a bit odd. I am not very experienced with map coordinates and projections so I am posting here to see if my results 'look' right. The following link shows an image I have of two lines: ![https://dl.dropboxusercontent.com/u/4467680/LineCheck.png](http://i.stack.imgur.com/qo9Wv.png) One extends mostly along the longitude and the other mostly along the latitude. Both lines should have a length of 1 meter. However the red line is noticeably longer than the green line. The lines are located around longitude 6.080695759673799 and latitude 52.501029191616425 (The Netherlands). I know with the projection I am using (Web Mercator I believe) landmasses become stretched along the poles. Is this what I am seeing with the red line? Is the red line stretched because we are closer to the poles than we are at the equator? I use a combination of two functions to offset the latitude and longitude. I found the code in this forum post: https://sharpmap.codeplex.com/discussions/395118 I've then rewritten the code to Javascript like this:               function toMercator(latLong)     {         var x = latLong.y * 20037508.34 / 180;         var y = Math.log(Math.tan((90 + latLong.x) * Math.PI / 360)) / (Math.PI / 180);         y = y * 20037508.34 / 180;              return {x: x, y: y};     };          function toLatLong(mercator)      {         var lon = (mercator.x / 20037508.34) * 180;         var lat = (mercator.y / 20037508.34) * 180;              lat = 180/Math.PI * (2 * Math.atan(Math.exp(lat * Math.PI / 180)) - Math.PI / 2);              return {             x: lat,             y: lon         };     };      To offset the point I do this:               var lat = 2;     var long = 5;          var xOffsetCM = 50;     var yOffsetCM = 50;          var mercator = toMercator({x: lat, y: long});     // Add offset     mercator.x += normalizedVector.x * (50 / 100); // divide offset by 100 to get meters     mercator.y += normalizedVector.y * (50 / 100);          var latLong = toLatLong(mercator);      After the last function call latLong should contain the new coordinate.


What's the convention for "upside down" labels?

I have line features that are to be used for labels. These lines are correctly oriented(rotated) and positioned such that text placed on them should give a good cartographic output. Compare the below two images and their labels. In particular the word "Waverton" and its orientation in relation to "Avenue". !["Wrong" labelling](http://i.stack.imgur.com/Kaumi.jpg) !["Correct" Label](http://i.stack.imgur.com/HVMSd.jpg) The left is what all labelling engines seem to produce by default. The right is what it "should" look like according to the Ordnance Survey. So my main question is - Which one is correct and why? What is the cartographic convention here? I ask this because out of the 5 labelling engines split between: QGIS (has two), MapInfo and ArcGIS (has two), only Maplex has the option to allow the user to _insist_ the label follow the orientation of the line. The others all assume that upside down text is undesirable and automatically "correct" it. (Maps: © Crown Copyright and database right 2012. Ordnance Survey 100019520.)


Howto change OpenLayers BBOX request projection?

My map uses EPSG:900913 projection on the map. All coördinates in the database are stored in the 'normal' google format / GPS coordinates (WGS84). For instance, if you save a new location..Before I submit coordinates back to the server they get transformed like               mapPosition = OpenLayers.Projection.transform({             x: lon,             y: lat         }, new OpenLayers.Projection("EPSG:900913"), new OpenLayers.Projection("EPSG:4326"));      The OpenLayers BBOX strategy makes request like:               ?bbox=497590.72212427,6707253.6848049,748304.17486475,6814265.5243893,EPSG:900913      How do I change this so the server gets the bounding coordinates in ESPG:4326?? That would be much better then transforming the coordinates serverside. **EDIT** I tried to create a function that appends an extra set of bounds to the request URL:               this.layer = new OpenLayers.Layer.Vector("POI",{             strategies: [new OpenLayers.Strategy.BBOX({resFactor: 1})],             protocol: new OpenLayers.Protocol.Script({                 url: 'http://localhost/tests/poi', //this.get_poi_url,                 params: {                     bounds: this.get_poi_url()                 },                 callbackKey: 'jsoncallback',                 srsInBBOX: true             }),         });         tbMap.map.addLayers([this.layer]);      and the function:               get_poi_url: function(bounds) {         var bounds = tbMap.map.getExtent();         console.log(bounds);         bounds = bounds.clone().transform(             config.projection, config.displayProjection         );         console.log(bounds); // OK, it works, I want these coordinates         var url = ""             + bounds.top + ','             + bounds.left + ','             + bounds.bottom + ','             + bounds.right;         return url;     }      The problem is that this set of extra parameters (or if I would build the URL like this) doesn't get an update since it is set with the layer creation. So If you move the map, it would still transmit the original bounds.


How to embed ESRI maps on my website

I've got a website where I'd like to insert maps with some placemarks (restaurants, points of interest, ...). I'm tired of Google Maps and like to use ESRI basemaps. Is it possible to do this? I'd like to create these maps directly from my webpages (with JavaScript) and without embeding ArcGIS online maps (I suppose this would require to create the map in 'arcgis.com' before). Is it possible with any ESRI JavaScript API? Thank you very much.


How to Automate ArcGIS map production?

I am currently working with high volume ArcGIS (9.3.1 & 10) production of PDF files, part of the companies requirement is that a database (Access 2003) needs filling out with each map, this needs an automated (sequential) map number, the mxd location and the user (3 digit reference). This also needs to be filled on the map template in the specified fields of the map. I have seen some python script for exporting the layers of a map to a table, is there a way that I can automate my process so that I can fill the "username" field on the map and then have ArcGIS populate the "figure number" field with the next sequential number and then populate a table which I can link to the DB which my company uses? This would make my life a lot easier and I can see how it is possible though my python is letting me down :( Thanks for any advice :)


Code to calculate elevation profile along line from a DEM

Given a DEM (Digital Elevation Model) say in and a line (x1,y1) --> (x2,y2) (paired coordinates (x,y)), how can one calculate the elevation profile or cross-section projected on that line ? I am looking for open source code that i can use in my project or pseudo-code that I can use as a guide.


Calculate Percent coverage using another raster, with dif resolution and orientation

I have a 0.5 meter raster that defines presence or absence (cells are either 1 or 0). I have another 5 meter raster, which I created. I would like to calculate a percent coverage of the underlying 0.5 meter raster and pull that value into the corresponding cell in the 5-meter raster. The rasters don't line up and cannot be adjusted. * * * One thing I now realize is that the cells are slightly less than 0.5 meters, .46999 to be exact. I ran block statistics, using a 10.638298 X 10.638298 rectangle (5/.469999), with snap raster set to, the slightly offset, 5-meter raster. That's taking a while to run, but I'm guessing that it won't work quite right. I also have a 5-meter polygon fishnet and I could also convert the .46999 meter forest cover raster into a polygon feature. Then I could calculate the area within each 5-meter 'cell'.


Send Geometry to query using ArcGIS REST API

I am writing a windows console app in VS 2010 to perform an overlay using the ArcGIS Rest API. My first REST query returns information about the geometry for a specific feature. I then want to send that geometry to another feature class, to return data about the shared area. I am using the DeserializeObject method to convert the query results to a Dictionary. How do I take the geometry from that result set and post it to a new query? **Update:** What if I user the JavaScriptSerializer.Serialize method on the geometry string? Is there a way to pass the resulting JSON string to the REST service call? I already tried just assigning it to the "geometry" value in the querystring, but that failed.


arcpy "The table name is invalid"

I wrote a script that, ideally, loads raw .las (LiDAR data) files into a geodatabase, then creates a terrain from the multipoint files that are created. When I run the script though I get: > ExecuteError: ERROR 000210: Cannot create output > C:\Users\peter\Desktop\test.gdb\bare_earth\1las The table name is invalid. > Failed to execute (LASToMultipoint) So far the only thing I can figure out is that Windows 7 keeps changing my folder permissions to read-only, but I can still manually create, edit, and delete in the directories.               import os     import arcpy, math, glob     from arcpy import env          arcpy.CheckOutExtension("3D")     arcpy.env.overwriteOutput = True     #make workspace in memory     arcpy.env.workspace = "in_memory"          #define parameters using GetParameter in ArcMap     geodatabase = arcpy.GetParameter(0)         #0)input Geodatabase     outfeaturedataset = arcpy.GetParameter(1)   #1)Desired Name for the feature class     projection = arcpy.GetParameter(2)          #2)coordinate system     terrain_name = arcpy.GetParameter(3)        #3)Name of the Terrain     class_code = arcpy.GetParameter(4)          #4) the return class code to use     lasdirectory = arcpy.GetParameter(5)        #5) directory to get las data in          #designate directory where .las files are located     os.chdir (lasdirectory)          created_FC_tool = arcpy.CreateFeatureDataset_management(geodatabase, outfeaturedataset, projection)     created_FC = created_FC_tool.getOutput(0)     #Create a Terrain               arcpy.CreateTerrain_3d (created_FC, terrain_name, 1.24605815948, 50000, '', 'WINDOWSIZE', 'ZMIN', 'NONE', 1)          output_terrain = os.path.join (created_FC, terrain_name)     arcpy.AddTerrainPyramidLevel_3d (output_terrain, 'WINDOWSIZE', '2.5 1000; 5 2000; 10 4000; 20 8000; 40 16000')     #process the .las file and add to the feature dataset and terrain                    for LASfiles in glob.glob("*.las"):         print LASfiles         pointinfo = "point_file_information"         #Get Pointfile information         arcpy.PointFileInformation_3d(LASfiles, pointinfo, "LAS", "", projection)              #get average point spacing variable         pointspacing = arcpy.SearchCursor (pointinfo)         field = "Pt_Spacing"         for row in pointspacing:             avg_space = (row.getValue(field))         print avg_space              #convert las  to multipoint              #create lable for multipoint file         listlable = list(LASfiles)         del listlable[-4]         multipointlable = ''.join(listlable)         print multipointlable              print created_FC         outputPlable = os.path.join (created_FC, multipointlable)         arcpy.LASToMultipoint_3d(LASfiles, outputPlable, 1.5, class_code, "", "INTENSITY", projection, "las", 1)                        print outputPlable              outputPlable_parameters = outputPlable + ' Shape masspoints 1 0 40 true false R06305328las_embed <None> false'         print outputPlable_parameters         arcpy.AddFeatureClassToTerrain_3d (output_terrain, outputPlable_parameters)          #Build the terrain     arcpy.BuildTerrain_3d (output_terrain)      Any help is greatly appreciated, if it is a Windows 7 problem I don't know what I'm going to do as my work computer is locked down like Fort Knox by our help desk :( Thanks in advance, Pete


Shapefile to X3D

Does anyone know of an effective workflow to convert 3d-enabled shapefiles to X3D format? I have several projects containing anywhere from 10 to 5000 features (building sections) that I would like to convert into X3D format. The shapefiles in question have topheight and baseheight attribute fields. I have read these: How can a 3D model of a building be displayed in a web-browser? Georeferenced 3D Model Import I have browsed this list of applications and resources to see what is available for import/export/conversion. I have experimented with ArcGlobe, exporting my shapes to COLLADA using Layer 3D to Feature Class and Multipatch to Collada. This tool limited me to exporting building sections or contiguous building sections (whole buildings). I then used Meshlab to convert COLLADA to 3DX. The only downfall with this is that I would have to convert thousands of building files to 3DX. I would be interested in hearing of other workflows for similar situations. Thank you in advance for any input.


SLD encoding with GeoServer REST Configuration

I am using the GeoServer REST Configuration to add the following SLD file to GeoServer:               <?xml version="1.0" encoding="ISO-8859-1"?>     <StyledLayerDescriptor version="1.0.0" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld">       <NamedLayer>         <Name>MyWorkspace:MyLayer</Name>         <UserStyle>           <Name>MyLayer_default_style</Name>           <Title>MyLayer</Title>           <Abstract>Default style for Mylayer</Abstract>           <FeatureTypeStyle>             <Rule>               <Title>Polygon</Title>               <PolygonSymbolizer>                 <Fill>                   <CssParameter name="fill">#CBCCCC</CssParameter>                 </Fill>                 <Stroke>                   <CssParameter name="stroke">#CBCCCC</CssParameter>                   <CssParameter name="stroke-width">1</CssParameter>                 </Stroke>               </PolygonSymbolizer>             </Rule>           </FeatureTypeStyle>         </UserStyle>       </NamedLayer>     </StyledLayerDescriptor>      I have used the example from the GeoServer REST Docs and the sld file is added to GeoServer like expected. But the encoding of the sld file in GeoServer is now **"UTF-8"** instead of **"ISO-8859-1"** which I declared. See the SLD created by GeoServer below:               <?xml version="1.0" encoding="UTF-8"?>     <sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" version="1.0.0">       <sld:NamedLayer>         <sld:Name>MyWorkspace:MyLayer</sld:Name>         <sld:UserStyle>           <sld:Name>MyLayer_default_style</sld:Name>           <sld:Title>MyLayer</sld:Title>           <sld:Abstract>Default style for Mylayer</sld:Abstract>           <sld:FeatureTypeStyle>             <sld:Name>name</sld:Name>             <sld:Rule>               <sld:Title>Polygon</sld:Title>               <sld:PolygonSymbolizer>                 <sld:Fill>                   <sld:CssParameter name="fill">#CBCCCC</sld:CssParameter>                 </sld:Fill>                 <sld:Stroke>                   <sld:CssParameter name="stroke">#CBCCCC</sld:CssParameter>                 </sld:Stroke>               </sld:PolygonSymbolizer>             </sld:Rule>           </sld:FeatureTypeStyle>         </sld:UserStyle>       </sld:NamedLayer>     </sld:StyledLayerDescriptor>      I have tested this using GeoServer 2.1 (all RC and final release). How can I add the SLD by using the GeoServer REST Configuration with my declared encoding and not "UTF-8"?


Openlayers geometry: how to convert area from degrees to square kilometres?

I get a multypolygon from my web service and want to calculate the area of that polygon. I was trying to use this piece of code:               var poly = new OpenLayers.Geometry.MultiPolygon(poligon);     var area = geom.getArea();      But that returns the area in square degrees. The projection is EPSG:3243.   I then tried to use               OpenLayers. Layer. SphericalMercator      But that didn't help me a lot. Is there any other solution or some other hint? Cheers!


How to select all cities in Germany from city and country layer?

I have 2 layers: layer_1: countries of europe, layer_2: cities of europe I want to create (and then save) a layer_3 which would be all the cities of Germany. Is there any good tutorial of how can i write spatial queries?


Pasing multivalue parameter using arcpy

I am trying to get my head around how multivalues derived from the arcpy command `GetParameterAsText` gets looped through a script. Could some please provide a sample script that does the follow basic task so that I may study it for further insight? Get a set of shapefiles from `arcpy.GetParameterAsText(0)` (the number of shapefiles can vary from to 10 say) and then loop through each shapefile, displaying the following with `arcpy.AddMessage` saying something to the effect: > "This is shapefile " shapefile name When looped through all of the shapefiles, print the message "No more shapefiles"


Problem with Converting XY Coordinates to LatLon

Here is the function that I use to convert from pixel x,y to lat,lon coordinate:                   public static Coordinate imageToWorld(Dataset gds, int x, int y)         {             double[] adfGeoTransform = new double[6];             double[] p = new double[3];             gds.GetGeoTransform(adfGeoTransform);             p[0] = adfGeoTransform[0] + adfGeoTransform[1] * x + adfGeoTransform[2] * y;             p[1] = adfGeoTransform[3] + adfGeoTransform[4] * x + adfGeoTransform[5] * y;                  OSGeo.OSR.SpatialReference src = new OSGeo.OSR.SpatialReference("");             string s = gds.GetProjectionRef();             src.ImportFromWkt(ref s);             //src.SetUTM(41, 1);             OSGeo.OSR.SpatialReference wgs84 = new OSGeo.OSR.SpatialReference("");             wgs84.SetWellKnownGeogCS("WGS84");             OSGeo.OSR.CoordinateTransformation ct = new OSGeo.OSR.CoordinateTransformation(src, wgs84);             ct.TransformPoint(p);             return new Coordinate(p[0], p[1]);         }      but this function doesn't work for utm projection and gives incorrect longitude. for example for an image with the following WKT it gives 35.25,3.65 but it should be 35.29,61.17 @(x=0,y=0). if I uncomment line 12 it gives correct result only for this image. > PROJCS["WGS 84 / UTM zone 41N",GEOGCS["WGS > 84",DATUM["WGS_1984",SPHEROID["WGS > 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","32641"]] thanks and sorry for my poor english


Rhumb lines intersection

I looking for algorithm how to find out whether two rhumb lines given by point1 with azimuth1 and point2 with azimuth2 have intersecting point. Have anyone idea how to find intersection ? For example: _point1 = Latitude = 54.243694767757674, Longitude = -2.0064940902720076 bering1 = 36 degrees_ _point2 = Latitude =54.168824307242112, Longitude = -1.6983087834266664 bering2 = 301 degrees_ I know that rhumblines of these for 100 % have intersect (second is n the other hemisphere) Thanks in advance.


Shapefile and DEM: check rivers behaviour

I'm working with shapefiles representing rivers (rivers.shp), and DEM for the terrain elevation (terrain.tif). Basically, I want to check that my rivers (stored as polylines in my shapefile) behave like "natural" water flow, meaning that it mainly go downstream, can not go uphill first and downhill then, etc... I'm using GDAL/OGR in Python, and don't really see how to proceed. Should I extract the points of the polylines in the shp? Look for the elevation at those points in the DEM, and then compute my decision? Thanks,   eo


Masking/removing polygons from shapefile

I have a shapefile containing the road traffic noise of a city. The shapefile has 5 columns, where 'noise_in' (noise interval) ranging from 1-5 is included. I want to remove/mask the road noise from a specific area. My problem is that the noise intervals covers more than just this area, e.g. if I remove a polygon from the file, covering the area of interest, it will also remove the noise from an adjacent area, which I'm not interested in. The attribute table looks like this: ![enter image description here](http://i.stack.imgur.com/NTHso.png) The road noise for the area looks like this: ![enter image description here](http://i.stack.imgur.com/HULWv.png) I would like to remove all the road noise from this area, meaning all 5 noise intervals. Unfortunately, I have no available date for recalculating the road noise for the area. I don't have a polygon for each area. Here's an example of "Identify Features":![enter image description here](http://i.stack.imgur.com/NgUhD.png) ![enter image description here](http://i.stack.imgur.com/Fd7S9.png) The red highlighted areas are two different polygons covering large areas of road noise, and I'm only interested in the big blue "vein" in the middle. I'm using QGIS 1.8 Lisboa for MAC Thanks in advance


How to print selected features in QGIS?

I have a detailed map in qgis (vector, .shp) and I would like to split the map in four parts based on attributes to print each part of the map separately. Unfortunately, I didn't figure out how to do that, yet. I can select the desired values (for one printout) in the attributes table and the region of the map gets highlighted. I could now save the selection as a new layer, reopen it, and print it. however, that doesn't seem to be the smart way, because i would end up with too many files. I thought i could simply print only the selection. Is there a way to achieve this? Thanks


Minimum Information to be kept on importing OSM data to use it for creating random start and ent points

I want to only import the minimum of data from OpenStreetMap, to be able to distribute random start and end points for a simulation in administrative areas in germany. I found this file https://github.com/openstreetmap/osm2pgsql/blob/master/empty.style which will act as my starting point. Basically what I need are the bundaries of the districts, what type of distict it is and the streets. Nice to have would be if it is an area, where people life, office buildings or factories, since people commute between their home and work. What I came up with so far is this. My Question to you: Am I missing something? Did I put in too much? Generally I want to have a small database with the correct datatypes etc.               # osm2pgsql style file for simulation of commuter routes.     # The data is mainly used to determine random start and destination points     # for the route generation          # OsmType   Tag                     Type    Flags     # Insert your own columns here, or change phstore to polygon below     node,way    access                          text    linear     node,way    admin_level                     int4    linear     node,way    amenity                         text    polygon     node,way    area                            text    # hard coded support for area=1/yes => polygon is in osm2pgsql     way         boundary                        text    polygon     node,way    building                        text    polygon     way         de:amtlicher_gemeindeschluessel int4    polygon     way         de:regionalschluessel           int4    polygon     node,way    highway                         text    linear     node,way    landuse                         text    polygon     node,way    name                            text    linear     node,way    name:de                         text    phstore     node,way    office                          text    phstore     node,way    place                           text    polygon     node,way    population                      text    linear  # sadly text is used here as well     node,way    route                           text    linear     node,way    type                            text    linear     node,way    z_order                         int4    linear  # This is calculated during import     way         way_area                        real            # This is calculated during import          # Deleted tags     node,way    note                    text    delete     node,way    note:*                  text    delete     node,way    source                  text    delete     node,way    source_ref              text    delete     node,way    source:*                text    delete     node,way    attribution             text    delete     node,way    comment                 text    delete     node,way    fixme                   text    delete     node,way    created_by              text    delete     node,way    odbl                    text    delete     node,way    odbl:note               text    delete     node,way    SK53_bulk:load          text    delete     node,way    tiger:*                 text    delete     node,way    NHD:*                   text    delete     node,way    nhd:*                   text    delete     node,way    gnis:*                  text    delete     node,way    geobase:*               text    delete     node,way    accuracy:meters         text    delete     node,way    sub_sea:type            text    delete     node,way    waterway:type           text    delete     node,way    KSJ2:*                  text    delete     node,way    yh:*                    text    delete     node,way    osak:*                  text    delete     node,way    kms:*                   text    delete     node,way    ngbe:*                  text    delete     node,way    naptan:*                text    delete     node,way    CLC:*                   text    delete     node,way    3dshapes:ggmodelk       text    delete     node,way    AND_nosr_r              text    delete     node,way    import                  text    delete     node,way    it:fvg:*                text    delete      EDIT: Updated the style file


Sending Shapefile to SQL Server 2012?

How can I send a shapefile to an SQL Server table? I have searched and found a tool called ShapetoSQL but I am developing a c# Windows application so I am looking for an Open Source solution.


Need help in Print task in ArcGIS JSAPI 3.2/3.3

I am using print task in my code and using dynamic map service layer and graphics layer (not using feature service layer) and I am able to print the map but it’s not displaying info window and graphics in the print out. So any help will be great!! Complete code on JSFiddle (I removed my server name) What I am trying:   1. I am going though this example in which I found that they are using graphics layer + feature layer and graphics is coming while printing the map   2. Replaced with ESRI sample REST service for the print task still not getting the graphics and info-window   3. Researching on my side ## ![screenshot 1 : with graphics and info window](http://i.stack.imgur.com/XkBXt.png) ![screenshot 2: after performing print task](http://i.stack.imgur.com/9Pqg8.png) Software’s: ArcGIS for Server and Desktop version 10.1 and JSAPI version 3.2/3.3


File organization for sharing ArcGIS python code

What is the best organizational structure for sharing ArcGIS python code and geoprocessing tools? Or even, are sharing code and sharing tools separate questions? Esri has a Methods for distributing tools structure, published for Arcgis 9.3 and 10.0: ![distributing tool folder structure example](http://i.stack.imgur.com/Bdl8l.png) However in other places people are saying things like _`Also do avoid distributing your code the way its done in Arc Scripts or Code Galleries`_ in favour of the native python Distutils. Esri doesn't seem to have a corresponding distributing tools article for 10.1 (ref), lending some weight to the counter-argument. What says GIS.se? **Update:** though perhaps too late, but the nub of this question is more about best practices for file and folder structure before the tools-used-for- sharing (arcgis online, google drive, dropbox, github, bitbucket, etc.) come into play. **Update2:** and will no-one speak up for the apparently orphan distutils approach?


How does one modify selected geometry with a function in qgis python console?

My example use-case is that I want to redistribute vertices along lines as in:   * Redistribute linestring vertices to specified distance   * How to create points in a specified distance along the line in QGIS？   * How to automatically add vertices to lines every x meters?   * How to densify a polyline according to a specific length? I've written some functions to do some of the work:               import math          def redistribute_vertices_num(line,num):         return LineString([line.interpolate(i/float(num),normalized=True) for i in range(num+1)])           def redistribute_vertices_dist(line,dist):         return LineString([line.interpolate(i*float(dist)) for i in range(int(math.ceil(line.length/dist)))])      I would like to apply these functions (or other, modified functions) to the selected objects in the current layer to modify the layer. I'm looking for a general function like this:               edit_layer_selection_geometry(redistribute_vertices_dist,500)     # or      def my_function(line):         redistribute_vertices_dist(line,500)     edit_layer_selection_geometry(my_function)      ...that might do something like the processing in How can I create a line with three points with Python in QGIS? or How can I switch line direction in QGIS? on the active layer with the user-defined function.               def edit_layer_selection_geometry(myfun, extra_arguments...):         layer = qgis.utils.iface.mapCanvas().currentLayer()         # check for selected_layer, editability ?         for feature in layer.selectedFeatures():             newgeom=myfun(feature,extra_arguments)             # update feature with geometry             layer.changeGeometry(feature.id(),newgeom)         ...         # update layer stuff (extents?)      I'm looking for the edit_layer_selection_geometry() or an equivalent functionality, and I'm happy to modify the potential 'myfun' functions to fit requirements of the general function. I've put this in my .qgis2/mycode.py directory:               from qgis.core import (QgsFeature, QgsGeometry,                            QgsVectorLayer, QgsMapLayerRegistry,                            QgsField)     from PyQt4.QtCore import QVariant     from qgis.utils import iface     import math                    def redistribute_geometry_vertices(geom,dist):         mylen=geom.length()         line=geom.asPolyline()         return QgsGeometry.fromPolyline([geom.interpolate(i*float(dist)).asPoint() for i in range(int(math.ceil(mylen/dist)))])          def redistribute_selection(dist):         """Redistribute the vertices along a polyline """         layer = iface.mapCanvas().currentLayer()         for feature in layer.selectedFeatures():             geom = feature.geometry()             newgeom=redistribute_geometry_vertices(geom,dist)             layer.changeGeometry(feature.id(),newgeom)      Then I can solve the use-case by selecting the layer and feature, opening the python console and typing:               import mycode     mycode.redistribute_selection(0.1)


coordinates in dbf file wrong

I am new to ArcGis, so please bare with me :D . I converted a polygon in an mdx file I have to a shape file, then converted its vertices to points, then used "add X Y feature" and choosed coordinates "WSG 84", now when i open the dbf file I get coordinates like "3.17328051950, 3.07370669600" and they are really out of the country I am using (Egypt), so what is wrong here? Points to help: \- The mxd file I am using has Egypt and some neighboring countries around it not the whole world..   * I used the MID option when converting to point.


How to prepare road network for routing in QGIS or GRASS

I have been working on a road network and I want to run shortest path algorithms on it. One problem is that some lines come very close to each other, but are not connected.![disconnected road network ](http://i.stack.imgur.com/bgF0x.png) Is there a way to connect these lines when they are closer to each other than some threshold? Thanks


Gravity/Huff model tools

I am looking for a way to simulate a gravity model using a point-based layer. All my points are assigned a z-value and the higher this value, the larger is their "sphere of influence". This influence is inversely proportional to the distance to the center. It is a typical Huff model, each point is a local maximum and valleys between them indicate the limits of the zone of influence between them. I tried several algorithms from Arcgis (IDW, cost allocation, polynomial interpolation) and QGIS (heatmap plugin), but I found nothing that could help me. I also found this thread, but it isn't very helpful for me. As an alternative, I could also be satisfied by an way to generate Voronoi diagrams if there is a way to influence the size of each cell by the z-value of the corresponding point.


Is QGIS Supported on Windows 8?

Can QGIS be installed on Windows 8? I'm going to buy a laptop with Windows 8, but I have no idea if Windows 8 can run QGIS.


How do you format the legend in Geoserver when using GetLegendGraphic?

I'm new to the world of GIS and geoserver so sorry if I'm asking an obvious or simple question. I'm using GetLegendGraphic to create a legend for a raster layer on the server, as it stands it looks like this: ![legend](http://i.stack.imgur.com/qar3h.png) http://norsewind.eu:8080/geoserver/wms?REQUEST=GetLegendGraphic&FORMAT=image/png&WIDTH=20&HEIGHT=20&SCALE=160000000&LAYER=norse:norse_map_1 I'd like to know how to format the numbers to a specific number of decimal points. Also I don't need the '=x' part, can that be removed? Thanks


Insert XY table data into SQL Spatial column

ArcGIS Server 10.1.1 SQL Server Standard 2012 Current workflow is user submits a table (text file) containing lat-long data (same spatial reference each time); SQL Server Integration services pushes this data into an SQL table. Data is viewed as an XY Event Layer in ArcGIS Desktop and published to AGS. The ideal workflow is to to utilize a Query Layer instead of a XY Event Layer (according to ESRI). My question is what is the best to get these XY (Lat-Long) fields into the spatial column? At this point in the workflow, I think we would be limited to SQL commands (or something within SSIS); the table is a text file going into SSIS so I doubt we'd be able to add an appropriately formatted column/field which would could then be mapped/loaded into the spatial column of the target SQL table. [The question is much less about ArcGIS Server but I added that background for context.]


Why does QGIS raster calculator create a raster with band values=0?

I have a slope raster (value in %) created with the DEM (Terrain models) tool. I am trying to create a new raster showing the slopes > 15%. In the Raster calculator, I used : `(my_raster@1 > 15) * my_raster@1`. ![enter image description here](http://i.stack.imgur.com/DJTic.png) The calculator creates a new raster where every cells equal 0. I tried different codes, same result. ![enter image description here](http://i.stack.imgur.com/BO6ja.png) Any idea why I can't extract the values greater than 15%? I used QGIS Lisboa and have a Windows 7 OS. Thanks


QGIS, making a topo map from an excel file

I will appreciate your help. I am new to QGIS, this question might be common but trough me search I did not find the answer I needed hence my question here. How do I make a topo map ( raster) from the excel file (X,Y UTM), attached is an a image since I did not have a better idea how to upload some of the data. Thanks ![enter image description here](http://i.stack.imgur.com/i4s0W.png)


Problems running zonal statistics - not all zones represented

I have been working on a Python script to automate the steps illustrated by whuber here:Create points around the edge of viewshed results I am trying to create a horizon graph illustrating the maximum viewing angles from a single observer point in all directions. Here is the script:               import arcpy     from arcpy import env     from arcpy.sa import *          env.Workspace = "C:/Temp/Python"     env.overwriteOutput = True          inDEM = "C:/Temp/multiDEM.tif"     env.extent = inDEM          inPoints = "C:/Temp/Points_ALL.shp"     outPoints = "C:/Temp/Python/output/pts.shp"     outPath = "C:/Temp/Python/output/observers"     outputPath = "C:/Temp/Python/output"     outEuclidean = "C:/Temp/Python/output/euclidean"     fieldFID = 'FID'     Elevations = 'RASTERVALU'     arcpy.CheckOutExtension("Spatial")          ExtractValuesToPoints(inPoints, inDEM, outPoints)          arcpy.MakeFeatureLayer_management (outPoints, "pts")          with arcpy.da.SearchCursor('pts',[fieldFID, Elevations]) as cursor:         for row in cursor:             fid = str(row[0])             print fid             ### Select and export each feature             arcpy.SelectLayerByAttribute_management ("pts", "NEW_SELECTION", '"FID" = {}'.format(fid))             arcpy.FeatureClassToFeatureClass_conversion("pts", outPath, fid+".shp")             ### Create Viewsheds             outViewshed = Viewshed(inDEM,"pts",1,"CURVED_EARTH",0.15)             outViewshed.save("C:/Temp/Python/output/viewsheds/"+fid)             ### Euclidean Distance             outEucDistance = EucDistance(outPath+"/"+fid+".shp")             outEucDistance.save(outEuclidean+"/"+fid)             Euclid = outEuclidean+"/"+fid             ### Subtraction for Relative Elevations             elevation = row[1]             outMinus = Minus(inDEM, elevation)             ### Division for "viewing angle"             outDivide = Divide(outMinus, outEucDistance)             ### Tangent Angles             outTimes = Times(outViewshed, outDivide)             outSetNull = SetNull(outTimes, outTimes, "Value = 0")             tangentAngle = Tan(outSetNull)             tangentAngle.save(outputPath+"/angles/"+fid)             ### Aspect of Euclidean Distance             outAspect = Aspect(Euclid)             outInt = Int(outAspect)             outInt.save("C:/Temp/Python/output/int/"+fid)             ### Zonal Statistics             ZonalStatisticsAsTable(outInt, "VALUE", tangentAngle, outputPath+"/tables/"+fid, "DATA", "MAXIMUM")      So this script does the following:   1. Iterate through Points_ALL.shp to select one row at a time   2. Export each row to a feature class   3. Create a viewshed of each using inDEM   4. Find the Euclidean Distance   5. Find relative elevation through Subtraction   6. Find Viewing angle - Dividing relative elevation by the Euclidean Distance and taking its TANgent to find the viewing angle   7. Deriving the aspect of the Observer (then discretizing it using INT)   8. Running ZONAL Statistics on the Integer Zones and finding the MAXIMUM angles from step 6 in each aspect "zone." So what's the problem? Well... After investigating each table, I noticed that I receive two errors:   1. The maximum viewing angles in some areas are greater than 90 degrees (some as high as 600) so I think I am missing something in my calculations.    2. Not all zones end up in the resulting table. I'll have missing aspect values even though I check the data and there are obviously results in the directions that are missing. Can someone help me find what I am missing? Did I skip a step or misinterpret a step from the previous question?


Warping Rasters in QGIS

There seems to be a bug warping rasters in the new QGIS version 2.0 When you have to option of target and Source SRS, the Coordinate reference system does not get automatically writen into the box after you tick one option. i.e. EPSG: 4326 does not get automatically inputted into the box and stays bank. This leads to no warping taking place. Just reporting the bug.


calculate proportion of polygon greater then 40 degrees in grid cell QGIS

I would like to calculate the proportion of greater then 40 degree slope within my polygon grid cells. I have a Slope Raster layer for my given area and have a polygon that overlays this raster layer. I want to know what percentage of each polygon have above 40 degree slope within it. The only ways I could think was using the Raster caculator to make a new raster with only the greater then 40 degree slope. But then I still dont know how to create the proportion of this slope within my polygon.


shadow simulation from buildings

is it possible to use hillshade function in ArcMap to calculate shadow areas of buildings or simulate shadows of buildings, using DSM of the buildings and the sun angle and azimuth?


Arcpy CreateUniqueName usage: keep original input names

This is a continuation of the question I asked here: At this point I'm really just trying to get everything in one place and keep the original shapefile basename. I'll tackle merging like-named files later, which is why I'm using CopyFeatures for now. I'm confused about why the second sample below didn't have a result list similar to the first one. It looks like the first sample ran through the first folder and copied those shapefiles to the gdb, and when it got to the next folder with a 'Bank_Ero' name it failed. So now, I'd like to create a unique file name (keeping that original shp base name) if one already exists. As always, any hints, or direction will be greatly appreciated, and thanks for looking. Original sample:               for dirname, dirnames, filenames in os.walk ("C:\FOR MIKEK\GPS Files\GPS_ANDY"):         for subdirname in dirnames:             env.workspace = os.path.join(dirname, subdirname)             All_List = arcpy.ListFeatureClasses()             for shp in All_List:                 outFeatureClass = os.path.join("C:\FOR MIKEK\Python_Scratch.gdb", shp.strip(".shp"))                 arcpy.CopyFeatures_management(shp, outFeatureClass)               <Result 'C:\\FOR MIKEK\\Python_Scratch.gdb\\Bank_Ero'>     <Result 'C:\\FOR MIKEK\\Python_Scratch.gdb\\Fish_Bar'>     <Result 'C:\\FOR MIKEK\\Python_Scratch.gdb\\Flag'>     <Result 'C:\\FOR MIKEK\\Python_Scratch.gdb\\Outfall'>          Traceback (most recent call last):       File "<pyshell#82>", line 7, in <module>         arcpy.CopyFeatures_management(shp, outFeatureClass)       File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 1943, in CopyFeatures         raise e     ExecuteError: Failed to execute. Parameters are not valid.     ERROR 000725: Output Feature Class: Dataset C:\FOR MIKEK\Python_Scratch.gdb\Bank_Ero already exists.     Failed to execute (CopyFeatures).      and now attempting to use CreateUniqueName:               import arcpy, os     >>> from arcpy import env     >>> env.workspace = "C:\FOR MIKEK\GPS Files\GPS_ANDY"     >>> for dirname, dirnames, filesnames in os.walk ("C:\FOR MIKEK\GPS Files\GPS_ANDY"):         for subdirname in dirnames:             env.workspace = os.path.join(dirname, subdirname)             shpList = arcpy.ListFeatureClasses()             for shp in shpList:                 outFC = os.path.join("C:\FOR MIKEK\Python_Scratch.gdb", shp.strip (".shp"))                 if arcpy.Exists(outFC):                     arcpy.CreateUniqueName(os.path.join, "C:\FOR MIKEK\Python_Scratch.gdb")                     arcpy.CopyFeatures_management(shp, outFC)               >>> xferFiles = arcpy.ListFeatureClasses("C:\FOR MIKEK\Python_Scratch.gdb")     >>> print xferFiles     []


Where can I download Real time Traffic and weather data for the world?

Where can I download real time data for traffic and weather? I'd like to use it as an overlay on a mapping service of my choice (eg. Google maps, OpenLayers etc.)


How to auto fill or delete sliver polygons without losing precision?

I am developing some boundaries in which precision holds the key value. Using ArcGIS 9.3 I am converting lines to polygons using the "feature to polygon" tool. The lines are accurate but I find gaps in between polygons. Using GT [=ET?] wizard tools I made slivers and then eliminated them. However, the problem persists:   1. some gaps still remains   2. I lose precision.  As I have a huge number of polygons, solving them manually will take ages & I am running short of time. Can anyone help me resolving the 2 issues I mentioned, please? I have no knowledge of programming but I can work in either ArcGIS or Quantum GIS. Thanks in advance.


Delivering map tiles in real-time without caching?

I am wondering how useful would you find to have a way to deliver map tiles quickly over the web without worrying about caching or seeding them? With raster map engines we know that this is a problem. Rendering raster tiles is resource consuming therefore it is often required to cache them in advance. Every time map changes map tiles should be recreated and cached if you want to have them quick delivered. We focus to overcome this issue by rendering map tiles quickly in real-time as vector tiles. What do you think about this approach? Here is a benchmark that we did: http://www.giscloud.com/blog/realtime-map-tile-rendering-benchmark-rasters-vs- vectors/ Thanks!


OpenGeo-Suite SDK add Pan button

Ok, this may obvious but I can’t find the answer anywhere... I´m building an app using OpenGeo Suite SDK and I need to add a Pan tool. By default the pan option is activated, but, if I enable another tool like a ZoomBoxAction then I need to have a button to be able to go back to the pan tool... I can’t find the tool I have to put on the bar to be able to do that...


Failing to get wkt to reference for a multiline

I apologize, I'm quite new to WKT (and most everything else). I have a shape that I've exported to csv. & geoJson to be loaded into CartoDB. Unfortunately, the geoJson doesn't work so I am trying to upload the csv but don't quite understand how to get the array to reference, I am guessing I should convert it somewhere? Somehow? Ideally for free and with low bandwidth (I'm currently in Uganda). Here is the table for reference: https://alissarose.cartodb.com/tables/kcca_scrape_osm_linejoin4 Also, if the geoJson would just upload- that would be great. Here's a link to the file that won't load any data into CartoDB https://github.com/alissarose/test_spot/blob/master/kcca_OSMlinejoin.geojson Thanks for any help/advice/guidance!


How can I perform linear regression on a file geodatabase table in ArcGIS?

I'm trying to use the Ordinary Least Squares tool in ArcGIS 10.2 but it only accepts feature classes as input and I have a file geodatabase table. I realize that I can export the table to Excel or MATLAB and perform the linear regression there, but I am working in ModelBuilder and need to keep everything within the model. Are there any workarounds or conversions that anyone knows about?


Using get count with if statment

Pretty simple question though I am struggling with how to operationalize this, I want to rename a shapefile based on the number of features it contains. My initial thoughts are that I would need to create a list of the shapefiles contained in a folder, for those shapefiles use arcpy.GetCount and where count >= X rename the shapefile. I used an if statement followed by arcpy.rename and it managed to rename all the shapefiles. Thanks for your help with this one.