Tag Info

Hot answers tagged

5

Yesterday I had no time to create it in details... See my solution in 4 steps: CREATE OR REPLACE VIEW bd_segment AS SELECT ST_PointN(geom, generate_series(1, ST_NPoints(geom)-1)) AS sp, ST_PointN(geom, generate_series(2, ST_NPoints(geom) )) AS ep FROM -- extract the individual linestrings (SELECT ...


5

This is definitely possible. I just did a test, and I was able to get it to work by using float() around the Acres variable. So, this worked fine for me: def FindLabel([PARCEL_NUM], [PROP_ADDRE], [Acres]): if float([Acres]) >= 10.0: return [PARCEL_NUM][-8:] + '\n' + [PROP_ADDRE] else: return [PARCEL_NUM][-8:]


5

Use Python as the parser, and check the Advanced box. Then just replace yourFieldName with the name of the field you want to label. def FindLabel([yourFieldName]): value = [yourFieldName] first = False third = False if value[0] == "0": first = True if value[2] == "0": third = True if first == True and third == ...


4

To resolve the issue I did the following: Deleted extra installs/instances of Python outside of my ArcGIS10.3 folder. Reset my environment by following the steps in "Learn Python The Hard Way" by telling it to look in "Python27\ArcGIS10.3" Used "Repair Program" from the Setup application within the main folder for ArcGIS\Desktop Things seem to be ...


3

As the tool Sort_management creates an output table with the fields sorted this should be ok to do.. just remember that as a shapefile it wont stay sorted if you edit it; the edited row moves to the end of the table. From the description the tool expects a list of lists (or tuples I think), so to sort on multiple rows you need to create a list of lists.. in ...


3

Here's a little more concise way of doing it. Basically convert it to a list and replace list[0] and list[2] with '' if the value is 0 def FindLabel([field]): value = [field] l_value = [x for x in value] # turns string to list no_zero_positions = [0,2] # where you don't want zeros for p in no_zero_positions: if l_value[p] ...


3

For brevity's sake: def FindLabel ([field]): val = [field] return ''.join([j for i, j in enumerate(val) if j != '0' or i == 1]) Step through the string and toss away all 0's unless it's in the middle position (index of 1), then join what's left.


2

Just for good measure, here's a way to use python string methods. This would work with strings of variable length, though I know that wasn't a consideration in this case: def FindLabel(value): if value.endswith("0"): value = value[:-1] # slice all but the last character if it's a 0 return value.lstrip("0") # take off any leading zeros


2

The Correct form of your code is : def FindLabel ( [amenity], [osm_english_32_name], [osm_name_58_en] ): if not ([osm_name_58_en] is None): return [osm_name_58_en] elif not([osm_english_32_name] is None): return [osm_english_32_name] + '\n' + [amenity] else: return [amenity] The semicolon in the last line is removed. ...


2

potentially a multi-part question - 1) plotting grids with legends, 2) including shape files on grid, and 3) animate output images. each with multiple opportunities to accomplish the task. here's a quick run-down of at least 2-methods: using gdal, one should be able to read in the raster - perhaps something like (in a loop to get all rasters). raster = ...


1

In R: library(raster) library(animation) files <- list.files("path/to/asc", pattern = "asc$") saveHTML({ for (i in seq_along(files)) { r <- raster(files[i]) r <- plot(r) ## include additions like counties here } }) The animation package has other options for different output formats rather than HTML. The raster package has ...


1

To solve this bad behaviour of arcgis folder parameter processing, you need to string escaped the string that comes from the tool parameter. For this, simply add this line: dest_root = parameters[0].value #ouputs C:\Users\678910\Documents dest_root = unicode(dest_root).encode('unicode-escape') #outputs C:\\Users\\678910\\Documents And one problem with ...


1

You need to read the help file of the Mosaic to new raster tool. If you look at the Syntax section it lists the parameters of the tool and what they are. You need to be following the same order. Looking at your code you have a mysterious 1 after output name and before coordinate system. This is not the order of parameters as dictated in the syntax section. ...


1

The code presented in your question doesn't match what is asked for in the question. "I'm trying to label certain features using a specific field (osm_name_58_en). However, when this field is null, I want to label the feature with (som_english_32_name). If both are null then I want to label with the (amenity) field." This sentence implies that you only ...


1

write 'D:\ne_10m_airports' as 'D:/ne_10m_airports' (change with uri formalism) or 'D:\ne_10m_airports' (escaping) or r'D:\ne_10m_airports' (r means raw string) regards


1

The tool "Symmetrical Difference" can also do this: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00080000000r000000 This tool is available in QGIS, a free GIS you can download here: http://www.qgis.org/en/site/forusers/download.html


1

The exact tool you are looking for is called "Erase". Unfortunately, it is only included in the Advanced/ArcInfo license level. You might be out of luck unless you can write your own version of this tool. ArcGIS Erase


1

Took me a few tries and some digging to realize but, as per the ArcGIS Help: Note: To label a subset of features based on a field value, create the SQL query in the label class instead of through the label expression. So try creating a label class for those features greater than or equal to 10 acres(SQL) then use the expression to format the label. ...


1

Change variables indir and outdir according to your need. The code will find each file with extension 'txt' in indir and every subdirectory of indir. If you need another coordinate system than EPSG 4326, please change the EPSG number in line 9. The converted files will be written to directory outdir. import os indir = 'G:/LANUV' outdir = 'G:/LANUV' for ...


1

I just experienced the same problem. It looks like ArcGIS is caching the tools/scripts. If I refresh (F5) the toolbox, after a few seconds the toolsets and tools would show-up and work, but next time I open ArcCatalog it shows the red crosses again. If you rename the folder where the PYT is stored, it won't show the red crosses the first time, only after ...



Only top voted, non community-wiki answers of a minimum length are eligible