POST
|
Thank you for answers I checked and pyodbc is not installed. Alternative way is to export MS Access table to .dbf, use arcpy.SearchCursor and get certain row value.
... View more
05-12-2018
05:00 AM
|
0
|
2
|
2543
|
POST
|
I am writing a python script. In certain part of the script I would like to create a connection to MS Access database. Based on argument the script would read ID of the municipality and use it for other operations. Below is the part of JS script which connects and reads data from MS Access Database and I would like to use it in python script. appDB = WScript.CreateObject("ADODB.Connection");
appDB.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + Database);//path to database is already defined at the begining of code
str = "SELECT mun.id, mun.alias FROM mun WHERE (mun.alias)='" + municipality + "';";
appRS = appDB.Execute(str);
midOb = appRS("id").Value;
appRS.close;
appDB.close;
#WScript.Echo(alias);
#WScript.Echo(idMun);
#WScript.Echo(mun_code); ArcGIS version: 9.1-9.3. I hope you remember old times
... View more
05-09-2018
09:55 AM
|
0
|
6
|
14005
|
POST
|
What can you say about book Programming ArcGIS with Python Cookbook (second edition) By Eric Pimpler?
... View more
02-23-2017
10:57 AM
|
0
|
3
|
726
|
POST
|
Thanks for help Really need to learn python for ArcGIS. Can you suggest any of books?
... View more
02-22-2017
12:47 PM
|
0
|
6
|
2550
|
POST
|
Field "PARCELA" exits in all tables. The workflow is: select by attributes write query "PARCELA LIKE '%/%'" Count selected features But doing this workflow manually on more than 100 feature classes is time consuming.
... View more
02-22-2017
10:23 AM
|
0
|
0
|
2550
|
POST
|
I am new to python and I would to like to count the number of features in each feature class that meet certain criteria. In geodatabase I have many feature classes. One of the attribute field has values "number/number" --> 50/2, 99/6 I would to like to loop each feature class, select layer by attribute and count selected features, which contain sign "/" and print the result. Below is python code: import arcpy
#Set the input workspace
arcpy.env.workspace = "d:/TMP/miha_k/zirovnica/novo/test.gdb"
fcs = arcpy.ListFeatureClasses()
cursor = arcpy.SearchCursor(fcs)
for row in fcs:
arcpy.SelectLayerByAttribute_management(fcs, "NEW_SELECTION", "PARCELA LIKE '%/%'")
arcpy.GetCount_management(fcs)
print row I would appreciate your help
... View more
02-22-2017
08:44 AM
|
1
|
18
|
8132
|
POST
|
Thank you for your work We will try to figure out how to obtain RGB values from unique values, many fields, if it possible. This script requires to define one field that symbology is driving off. If we figure out to how obtain RGB values from many fields, which parameter should be choosen for Symbology field instead of String?
... View more
02-07-2017
10:42 AM
|
0
|
1
|
1058
|
POST
|
It seems strange if I choose LYR file as Symbology layer, I have no option to choose Symbology field. I prepared map package that includes data and script. Blake, can you check what is wrong?
... View more
02-06-2017
10:58 AM
|
0
|
3
|
1058
|
POST
|
I would like write RGB values of each polygon in attribute table and then convert to excel/CSV/txt file. I found this script that writes RGB values for each polygon into attribute table. I created new script as it shows on this page. However when I run the tool, I get a message: Executing: rgbValues D:\temp\GIS\eGeologija\KRANJ\SIMBOLOGIJA krpoly_opis_polygon # Start Time: Mon Feb 06 18:15:25 2017 Running script rgbValues... STARTED ====================================================================== D:\temp\GIS\eGeologija\KRANJ\SIMBOLOGIJA\TempGDB.gdb Path: D:\temp\GIS\eGeologija\KRANJ\SHP\krpoly.shp Spatial Reference: D48_Slovenia_TM TEMPS SET _R field exists _G field exists _B field exists ====================================================================== * FREQUENCIES & TEMP CARTO TILES Failed script rgbValues... Traceback (most recent call last): File "D:\temp\GIS\eGeologija\RGB_values.py", line 107, in <module> arcpy.Frequency_analysis(LayerPath, TempFrequency, FieldName, "") File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\analysis.py", line 1276, in Frequency raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000735: Frequency Field(s): Value is required Failed to execute (Frequency). Failed to execute (rgbValues). Failed at Mon Feb 06 18:15:26 2017 (Elapsed Time: 0.45 seconds) Line 107 represents this line of code: arcpy.Frequency_analysis(LayerPath, TempFrequency, FieldName, ""). Here I do not know how to reapir script so I would appreciate your help!
... View more
02-06-2017
09:29 AM
|
0
|
5
|
1984
|
POST
|
Sort (Data management) solves the problem You have to add new column (i.e. Rang). Polygons that I want to be on top, were given value 1, other were given value 2. In Sort tool you choose Rang as field and descending sort method.
... View more
11-09-2016
10:45 AM
|
0
|
0
|
480
|
POST
|
I am looking for tool to spatial sort polygons in shapefile. Sorting should be done on certain attribute which is more important than others: Polygons with atribute values Ced must be spatially sorted on top, then Bud, Gog and so on. Polygons with values Bid must be spatially sorted on the bottom. I need this shapefile structure for symbolizing layer in gis software (developed inside company)which does not support symbol levels in cartography as ArcGIS does. I found 4 tools: Sort (Data management): this tool has 5 predefined algorithms but does not allow spatially sort by attributes and two other tools: http://www.arcgis.com/home/item.html?id=b28e04f7d4e846229a2580f0cbdd29e1 and http://www.arcgis.com/home/item.html?id=d2ce3b7b11314d9cbc3f588f4d01c0a8. I assume that these 2 tools also do not allow polygons to be spatially sorted by attributes. what about qgis plugin? Any other solution?
... View more
11-07-2016
12:17 PM
|
0
|
3
|
1744
|
POST
|
This is kind of similar approach that I am looking for. I have many pairs (2000+) of orthophotos from years 2011 and 2014. They are stored in 2 separate folders. I would also like to find differences between them, but first of all I need to reclassify only one band from orthophoto; orthophotos are composited of red, green and blue band. I need to reclassify only blue band in 2 classes, then subtract them and export result as polygon. Orthophotos that overlapping each other have same name, except the 8th character is different. I am attaching picture of model builder process for one set of orthophoto. Orthophotos with name E063462.tif and E063462A.tif are overlapping each other. I need to import/load only blue band from orthophotos that have first 7 characters the same. Then blue bands should be reclassified into 2 classes (threshold values is 130). The reclassified raster should be subtracted (newer minus older). The result should be exported as polygons. I am not familiar with python so I need help to write a code to automate this process with 2000+ orthophoto pairs.
... View more
01-18-2016
12:36 AM
|
0
|
0
|
822
|
POST
|
Model works. Instead of manually adding bands to TOC and linking them in model builder there should be some code to do it automatically and perform further steps.
... View more
01-17-2016
08:59 AM
|
0
|
1
|
346
|
POST
|
Hi! I'm looking for solution to create a script for importing only one band from orthphotos, then reclassifying into 2 classes, subtracting them and export as polygons. Orthophotos are from 2011 and 2014 and are stored in 2 directories (for example D:\2011\ and D:\2014\). Overlapping orthophotos have same name except the new ones have letter "A" at the end - the old one has name E063462.tif - Band_3 and the new one E063462A.tif - Band_3. The script should find identical orthophotos, load only one band and then run processes as it is shown in picture below.
... View more
01-17-2016
08:12 AM
|
0
|
3
|
2827
|
Title | Kudos | Posted |
---|---|---|
1 | 07-01-2015 09:48 AM | |
1 | 02-22-2017 08:44 AM | |
1 | 06-30-2015 02:00 PM | |
1 | 11-23-2014 12:36 AM | |
1 | 11-23-2014 10:03 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|