|
POST
|
Solved: Re: Dispersing geocoded points within a Polygon - Esri Community Hope the following script works for you (Courtesy @XanderBakker and ArcPy Team) #-------------------------------------------------------------------------------
# Name: Disperse3.py
# Purpose: Disperse points in multiple polygons
# Author: arcpy Team
# http://arcpy.wordpress.com/2013/06/07/disperse-overlapping-points/
# Created: 02-dec-2013
#-------------------------------------------------------------------------------
import arcpy
import random
def main():
fcPoints = r"C:\Project\_Forums\Disperse\test.gdb\points3"
fcPolygon = r"C:\Project\_Forums\Disperse\test.gdb\Polygons"
arcpy.env.overwriteOutput = True
with arcpy.da.SearchCursor(fcPolygon, ("SHAPE@")) as cursor:
for row in cursor:
polygon = row[0]
disperse_points(fcPoints, polygon)
del row
print "ready..."
def point_in_poly(poly, x, y):
pg = arcpy.PointGeometry(arcpy.Point(x, y), poly.spatialReference)
return poly.contains(pg)
def disperse_points(in_points, polygon):
lenx = polygon.extent.width
leny = polygon.extent.height
with arcpy.da.UpdateCursor(in_points, "SHAPE@XY") as points:
for p in points:
if point_in_poly(polygon, p[0][0], p[0][1]):
# I changed code here!
x = (random.random() * lenx) + polygon.extent.XMin
y = (random.random() * leny) + polygon.extent.YMin
inside = point_in_poly(polygon, x, y)
while not inside:
x = (random.random() * lenx) + polygon.extent.XMin
y = (random.random() * leny) + polygon.extent.YMin
inside = point_in_poly(polygon, x, y)
points.updateRow([(x, y)])
else:
pass # don't update location if point doesn't originally falls inside current polygon
if __name__ == '__main__':
main() *Change the path of the point and polygon feature classes in Line No. 13/14.
... View more
01-21-2022
06:03 PM
|
4
|
1
|
1594
|
|
POST
|
What have you tried so far? You could check the tutorial Import an ArcMap document—ArcGIS Pro | Documentation. If you receive any error or get stuck at any particular step, please share relevant error message or screenshot, if possible.
... View more
01-20-2022
11:23 PM
|
0
|
0
|
18507
|
|
POST
|
GCS_WGS_1984 is not the correct coordinate system for the shapefile. It should be a Projected Coordinate System. Use Define Projection to define the projection of shapefile as WGS_1984_UTM_Zone_34N (Assuming Hungary is your area of interest). For the Raster files, GCS_WGS_1984 looks just fine.
... View more
01-20-2022
12:58 PM
|
1
|
1
|
8799
|
|
POST
|
Could you share the screenshots of the extent (Layer properties > Source tab) of the Raster and the vector layer? Where (on Earth) should the layers fall?
... View more
01-20-2022
09:41 AM
|
0
|
3
|
8816
|
|
POST
|
Are you referring to an ArcGIS tool? If not, maybe you could put the question to a more relevant forum like Geographic Information Systems Stack Exchange.
... View more
01-20-2022
02:18 AM
|
0
|
0
|
1931
|
|
POST
|
Looks like a Typo error to me. You may just have to hover over the bookmark, and click "Zoom To" icon.
... View more
01-19-2022
08:29 PM
|
0
|
0
|
4284
|
|
POST
|
Just try $datapoint["sum_number_of_citations_issued"] For No Data value, just change the Default Label to 0.
... View more
01-19-2022
01:11 PM
|
3
|
2
|
3160
|
|
POST
|
Check if the following expression works. var s = $datapoint["sum_number_of_citations_issued"]
IIF(s < 1, 0, s)
... View more
01-19-2022
09:36 AM
|
0
|
4
|
3183
|
|
POST
|
Getting disconnected from My Esri organization doesn't disconnect you from your AGOL organization. Ensure you are logging in to My Esri, using the same Esri account mentioned in the Order Fulfillment Confirmation email?
... View more
01-18-2022
12:05 PM
|
0
|
1
|
3062
|
|
POST
|
The minimum version of SQL Server supported by ArcGIS 10.8.2 is Microsoft SQL Server 2016 (64-bit) . Please upgrade to a supported version of database/client. Microsoft SQL Server database requirements for ArcGIS 10.8.x and ArcGIS Pro 2.5, 2.6, and 2.7—System Requirements | Documentation
... View more
01-18-2022
11:43 AM
|
0
|
3
|
4574
|
|
POST
|
Could you explain what issues you are facing with Zoom Level? Are you publishing to a standalone GIS server or a federated Server (ArcGIS Enterprise)? Have you checked - Share imagery as a tiled map service—ArcGIS Server | Documentation for ArcGIS Enterprise - Share a web tile layer—ArcGIS Pro | Documentation
... View more
01-18-2022
11:00 AM
|
0
|
0
|
885
|
|
POST
|
Have you recently purchased ArcGIS License? If yes, did you receive any email from Esri with "Order Fulfillment Confirmation"? Do you have a Personal Use License or a business license (currently under maintenance)? In case you were a member of the organizational account in My Esri, and accidentally got disconnected from the organization, please contact Esri Support for further assistance.
... View more
01-18-2022
10:51 AM
|
0
|
3
|
3075
|
|
POST
|
What version is your ArcGIS Pro? Please upgrade to ver. 2.9 or later (Enhancement implemented as per the link shared by Dan), if not already done.
... View more
01-18-2022
12:01 AM
|
1
|
1
|
11250
|
|
POST
|
Does the following image layer (from ArcGIS Living Atlas) provide the same information? https://arcgis.com/home/item.html?id=21b6b8cf5ce642f0841085aea1db51a4 Here is the REST URL https://earthobs3.arcgis.com/arcgis/rest/services/Chlorophyll/ImageServer I can add it to new Map Viewer as well (It's a Subscriber content). Ensure you are logged in to ArcGIS Online with an organizational account while adding the layer to Map Viewer.
... View more
01-17-2022
06:52 AM
|
0
|
1
|
1966
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-25-2021 09:10 AM | |
| 1 | 07-08-2021 11:09 PM | |
| 1 | 01-09-2022 06:54 PM | |
| 1 | 07-01-2021 09:35 PM | |
| 1 | 07-14-2021 11:54 AM |