|
POST
|
HI Polash, I assume you added the TIFF to your TOC of a MXD and stored the mxd file. What kind of TIFF file is it? Is it a RGB (3 bands) TIFF or do you have a single band? In case of a single band, you can access the attribute table of the raster and see the number of cells a certain value has. Multiply the number of cells with the pixel resolution to obtain the area. Maybe you can include a screenshot of the situation. That would help to visualize what you're dealing with.
... View more
12-29-2014
09:30 PM
|
0
|
1
|
893
|
|
POST
|
Good question... you could post this question in the place corresponding the language of the app you developed. You can find a list of places here:Web Developers
... View more
12-29-2014
01:56 PM
|
0
|
4
|
3093
|
|
POST
|
Although I have no idea on what the Mann Kendall Test will get you, it seems that the code below works. import arcpy
import numpy
import os
def main():
ws_in = r"D:\PythonProject\Data"
ws_out = r"D:\PythonProject\Outputs"
arcpy.env.overwriteOutput = True
arcpy.env.workspace = ws_in
rasterlist = arcpy.ListRasters()
n = len(rasterlist)
pairs = (n * ( n - 1)) / 2
print "Pairs to be formed: {0}".format(pairs)
for i in rasterlist:
for j in rasterlist[rasterlist.index(i)+1:]:
print i, j
pairsRasters(i, j, ws_out)
def pairsRasters(raster1, raster2, ws):
desc1 = arcpy.Describe(raster1)
desc2 = arcpy.Describe(raster2)
nameRaster = "{0}_{1}.img".format(desc1.basename, desc2.basename)
print nameRaster
array1 = arcpy.RasterToNumPyArray(raster1,nodata_to_value=0)
array2 = arcpy.RasterToNumPyArray(raster2,nodata_to_value=0)
newRaster = numpy.sign(array2 - array1)
finalRaster = arcpy.NumPyArrayToRaster(newRaster)
outname = os.path.join(ws, nameRaster)
finalRaster.save(outname)
if __name__ == '__main__':
main() You may want to check the names of the input rasters. If they have extensions, you may want to strip them to create a valid output name.
... View more
12-29-2014
01:38 PM
|
1
|
4
|
5007
|
|
POST
|
Might have something to do with the time zone... If I enter "-71107200" (seconds, not milliseconds) in the epoch converter: Epoch Converter - Unix Timestamp Converter ... I get this result: GMT: Sun, 01 Oct 1967 00:00:00 GMT Your time zone: 30-9-1967 19:00:00 GMT-5:00
... View more
12-29-2014
12:51 PM
|
1
|
6
|
3093
|
|
POST
|
interesting, but annoying... If I look at the help of the da.InsertCursor at 10.3: http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-data-access/insertcursor-class.htm#C_GUID-DA74F0E0-2D67-472A-84B3-CB594A43750B ... I see that they use (as Richard Fairhurst suggests) a list for the fields and insert the row as list. So maybe if you make some minor changes it will work in 10.3 (I can't verify this until next week): import arcpy
fc = r"C:\Forum\DistLinePol\test.gdb\Polyline2"
xys = [[225351, 1858897, 889223, 1883031, 882436],
[225396, 1908393, 871758, 1908090, 871791],
[225405, 1899127, 884235, 1885213, 861191],
[225423, 1891186, 878961, 1885811, 881262],
[225435, 1887101, 888042, 1894165, 884325],
[225438, 1888139, 885803, 1888050, 885319],
[225438, 1888139, 885803, 1888081, 884837],
[225441, 1885023, 888542, 1884356, 888364],
[225351, 1858897, 889223, 1883031, 882436]]
with arcpy.da.InsertCursor(fc, ["SHAPE@"]) as cursor:
for j in xys:
array = arcpy.Array()
array.add(arcpy.Point(j[1], j[2]))
array.add(arcpy.Point(j[3], j[4]))
polyline = arcpy.Polyline(array)
cursor.insertRow([polyline])
... View more
12-29-2014
12:23 PM
|
0
|
0
|
1519
|
|
POST
|
If I run this code in ArcGIS 10.2.2, it runs just fine and creates the polylines. import arcpy
fc = r"C:\Forum\DistLinePol\test.gdb\Polyline2"
xys = [[225351, 1858897, 889223, 1883031, 882436],
[225396, 1908393, 871758, 1908090, 871791],
[225405, 1899127, 884235, 1885213, 861191],
[225423, 1891186, 878961, 1885811, 881262],
[225435, 1887101, 888042, 1894165, 884325],
[225438, 1888139, 885803, 1888050, 885319],
[225438, 1888139, 885803, 1888081, 884837],
[225441, 1885023, 888542, 1884356, 888364],
[225351, 1858897, 889223, 1883031, 882436]]
with arcpy.da.InsertCursor(fc, ("SHAPE@")) as cursor:
for j in xys:
array = arcpy.Array()
array.add(arcpy.Point(j[1], j[2]))
array.add(arcpy.Point(j[3], j[4]))
polyline = arcpy.Polyline(array)
cursor.insertRow((polyline, )) Richard Fairhurst; there are many examples where the list of fields is handled as tuple and the comma in "(polyline, )" is to create the tuple.
... View more
12-29-2014
12:01 PM
|
2
|
6
|
3207
|
|
DOC
|
You're welcome! If you have suggestions to enhance the content or things that may be missing, please let me know...
... View more
12-29-2014
11:45 AM
|
0
|
0
|
18689
|
|
POST
|
Thanx! Alexander Nohe, hope it can be resolved soon...
... View more
12-29-2014
11:41 AM
|
0
|
0
|
5209
|
|
POST
|
Or the link to the German Help page would be: ArcGIS-Hilfe (10.2, 10.2.1 und 10.2.2)
... View more
12-29-2014
07:41 AM
|
0
|
0
|
2149
|
|
POST
|
To create points on the outline of a polygon with a defined interval, you could use some Python code: import arcpy
fc_in = r"C:\Forum\test.gdb\Polygon"
fc_out = r"C:\Forum\test.gdb\Points"
interval = 50
pnts = []
with arcpy.da.SearchCursor(fc_in, ("SHAPE@")) as curs:
for row in curs:
polygon = row[0]
outline = polygon.boundary()
d = 0
while d < outline.length:
pnt = outline.positionAlongLine(d, False)
pnts.append(pnt)
d += interval
arcpy.CopyFeatures_management(pnts, fc_out) Change the path to input (polygon) and output (points) featureclass on line 3 and 4. Specify the interval of locating points on the outline on line 5 and run the code...
... View more
12-28-2014
06:47 PM
|
1
|
3
|
5058
|
|
POST
|
I do like the table of content at the top of each page to jump to the section I'm interested in... For the rest it will take some time to get used to, but that's OK, as long as each release doesn't mean a complete restyle of the Help...
... View more
12-28-2014
04:44 PM
|
0
|
0
|
1509
|
|
POST
|
Hi Ivan, Are you sure pyodbc is available and accessible to the server? I do have a few comments about the code itself. There are so many int-str conversions, it makes my head spin... When reading the rows, if "Input_Sct", "Input_Ruta" and "Input_Secu" are values (integers), use this: Input_Sct = "%03d" % (Input_Sct,)
Input_Ruta = "%04d" % (Input_Ruta,)
Input_Secu = "%05d" % (Input_Secu,) If they are strings (or numbers), do this to format them: Input_Sct ="{0}".format(Input_Sct).zfill(3)
Input_Ruta ="{0}".format(Input_Ruta).zfill(4)
Input_Secu ="{0}".format(Input_Secu).zfill(5) Read more on formating, here: Some Python Snippets To concatenate a string, it is better to use the format method on a string. It makes it a lot more easy to read. To get the number if items in a list, just use: contlist = len(lista_Ubica) To create the where clause you could use something like this: fldname = "clave2"
fc = "Clientes"
where = "{0} IN ('{1}')".format(arcpy.AddFieldDelimiters(fc, fldname), "','".join(lista_Ubica)) This will create a where clause with the following syntax: clave2 IN ('123','abc','kjsjhadas') At the end of your script you use arcpy.da.SearchCursor to get a count. Why? I think the result is the same as the arcpy.GetCount_management you perform just before...
... View more
12-28-2014
04:37 PM
|
0
|
4
|
4061
|
|
POST
|
Are you looking for a local difference or determining those extreme cells with highest and lowest values? For local differences you could use the Focal Statistics tool with the range statistic type In case of the determining the highest and lowest you could use some simple python code: import arcpy
from arcpy.sa import *
dem = r"path\and\name\to\your\dem"
ras = arcpy.Raster(dem)
dem_min = ras.minimum
dem_max = ras.maximum
result = Con((ras - dem_min) >= 1000, 1, Con((dem_max - ras) >= 1000), 1, 0)
result.saveas(r"path\and\name\to\your\output raster")
... View more
12-28-2014
01:56 PM
|
0
|
0
|
2149
|
|
POST
|
Sounds like an accessibility analysis. If you know where the cattle is initially you could do a cost distance analysis in raster format (Spatial Analyst required), assigning inaccessible to those areas with high slopes. This way you will end up with a raster showing those part accessible for grazing.
... View more
12-28-2014
01:40 PM
|
1
|
0
|
3183
|
|
POST
|
According to the Help: The input field type determines the type of output raster. If the field is integer, the output raster will be integer; if it is floating point, the output will be floating point. Are you sure the field you assign during the conversion is a double field? Another thing is that you may want to reconsider working with LiDAR data as points. It is better to use the LAS Dataset format and for conversion use the LAS Dataset to Raster tool.
... View more
12-25-2014
03:07 PM
|
1
|
0
|
1099
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-09-2020 09:26 AM | |
| 6 | 12-20-2019 08:41 AM | |
| 1 | 01-21-2020 07:21 AM | |
| 2 | 01-30-2020 12:46 PM | |
| 1 | 05-30-2019 08:24 AM |
| Online Status |
Offline
|
| Date Last Visited |
Friday
|