|
POST
|
I am working on a little task, where I create some points, based on coordinates. Every point is then used to create a couple of polylines, where each point is supposed to be the start point for a set of polylines. The endpoints for the polylines are determined by angle and distance. So, the outcome should be a point, in the center of some polylines, looking like sunrays. I create the points and use the created points thereafter as point of origin for my polylines. Only problem, the created point is not where the polylines 'meet' and the polylines do not meet at the same point either. I wonder how that can be, if the point of origin does not change! import arcpy
import arcgis
from arcgis.gis import GIS
from arcgis.geometry import Point, Polyline, Geometry
bearing_list = [(345,165),(315,135),(285,105),(255,75),(225,45),(195,15)]
distance_2 = 2000
in_sr = 4326
out_sr = 3006
# create featureclass and populate with points from coordinates
points_fc = arcpy.CreateFeatureclass_management(out_name='Sites', geometry_type='POINT', spatial_reference=out_sr)
arcpy.AddField_management(points_fc, 'SiteName', 'TEXT')
point_insert_cursor = arcpy.da.InsertCursor(points_fc, ('SiteName', 'SHAPE@XY'))
pnt_list = []
for item in point_dict:
y, x = point_dict[item]
pnt = Point({
'x': x,
'y': y,
'spatialReference':{
'wkid': in_sr,
'latestWkid': in_sr
}
})
out_pnt = pnt.project_as(out_sr)
pnt_list.append([item, out_pnt])
row_point = (item, out_pnt.centroid)
point_insert_cursor.insertRow(row_point)
del point_insert_cursor
# iterate over points, create temporary line featureclass,
temp_lines = arcpy.CreateFeatureclass_management(out_name='temp_lines', geometry_type='POLYLINE', spatial_reference=out_sr)
arcpy.AddField_management(temp_lines, 'SiteName', 'TEXT')
line_insert_cursor = arcpy.InsertCursor(temp_lines)
line_length = distance_2 + 5
for pnt in pnt_list:
for bearing_set in bearing_list:
pnt_array = arcpy.Array()
x = pnt[1].first_point.x
y = pnt[1].first_point.y
pg = arcpy.PointGeometry(arcpy.Point(x, y), arcpy.SpatialReference(out_sr))
start = pg.pointFromAngleAndDistance(bearing_set[0], line_length)
start_pnt = arcpy.Point(start.firstPoint.X, start.firstPoint.Y)
end = pg.pointFromAngleAndDistance(bearing_set[1], line_length)
end_pnt = arcpy.Point(end.firstPoint.X, end.firstPoint.Y)
pnt_array.append(start_pnt)
pnt_array.append(end_pnt)
line_feature = line_insert_cursor.newRow()
line_feature.shape = arcpy.Polyline(pnt_array)
line_feature.setValue("SiteName", pnt[0])
line_insert_cursor.insertRow(line_feature)
del line_insert_cursor The result for one of the points: the point is 10 centimeters away from where the lines 'meet'. And it looks like this at the 'center' of the polylines
... View more
11-10-2022
06:28 AM
|
0
|
5
|
2202
|
|
POST
|
I have a point, and based on this point, a certain distance and a bearing I want to calculate the resulting coordinates. And I was wondering how to do this in arcpy, while the spatial reference system is honored. Lets say I am in EPSG 3006, have an arbitrary point (57.6222951N,18.8333582E), a distance of 2000 meter, and a bearing of 345 degree... How can I achieve that with arcpy?
... View more
11-08-2022
05:25 AM
|
0
|
1
|
2595
|
|
POST
|
I would like to raise this issue again, since fall/winter 2021 is a while ago now, but i currently face the same issue with WMTS and the Map Viewer in a 10.9 portal.
... View more
10-24-2022
01:23 AM
|
1
|
0
|
1250
|
|
POST
|
As far as I can see you do not select any features from the newly created feature class, thereby I would aim for the feature layers extend to create the bounding box from it. Setting the extend of your WMTS layer will mostly require to look into the CIM, although I was lately looking into something similar and couldn’t find a possibility in the api to set an extent for service layers.
... View more
10-21-2022
01:28 AM
|
0
|
0
|
1880
|
|
POST
|
I was creating a web map app, adding a web map that I styled just to realize that the app is interpreting the colors and apparently also the blending settings in a different way than the map is set to. To illustrate... this is my map with some bathymetry data styled and in blending mode 'Multiply', showing OpenStreetMap information in the waters. This is the app, showing its interpretation of the map above... You can clearly tell, the blending option is disregarded, and I assume thereby the colors for the bathymetry are changed as well! I created the app with the Web AppBuilder on a 10.9.1 portal, where the map was created in the Map Viewer (not the classic). Did I miss a setting enabling blending, or is this a bug? On another note... one of the layers I show in the map has labels turned on and shows them nicely in the map. When I visualize the layer in the app, the labels are not shown by default, but instead the user has to manually enable them through some settings menu of the layer. Again, that is altering the Web Map when used in the App
... View more
09-28-2022
12:42 AM
|
1
|
1
|
704
|
|
POST
|
Yes, I tried that, but it's still causing an exception right after Item curItem = ItemFactory.Instance.Create(curService);
if(LayerFactory.Instance.CanCreateLayerFrom(curItem))
{
Layer newLayer = LayerFactory.Instance.CreateLayer(new Uri(curService, UriKind.Absolute), activeMapView.Map, 0);
} Also when trying to show the service as a layer in the Map Viewer at the portal, the error message returned by the viewer is: The layer cannot be added to the map.
... View more
09-23-2022
07:51 AM
|
0
|
1
|
938
|
|
POST
|
I recently experienced that while trying to create a layer from one of our portal services my AGP crashed. Turned out that the service I requested to create the layer from was stopped on the server. To avoid that, I would like to check on the PortalItem (Item) status, but I do not seem to have the possibility to do so (Item Class Members). Fingers crossed I am only looking at the wrong place. Can I check the PortalItem status?
... View more
09-23-2022
05:49 AM
|
0
|
3
|
965
|
|
POST
|
Thanks for the Idea link and your explanation. I ended up in sharing the layer as 'Map Image', selecting 'Map Image under 'Copy all data', and that is good enough for my purpose. 🙂
... View more
09-22-2022
02:00 AM
|
0
|
0
|
921
|
|
POST
|
To symbolize cliffs in a traditional way I created a png to be used for line features and the outer line of polygons. Within AGP everything works fine and the symbology is actually showing what I had in mind. However, sharing the feature layer as a web layer on our portal does end in a standard polygon with random filling... I wanted a custom outer line with a picture stroke and no filling at all. I am sharing it as a hosted layer: After sharing the layer I also cannot adjust the symbology and point to the image, because I would not know where the png was stored on the portal + I cannot select a picture for the outer line of a polygon in the first place. How do I get my symbology shown in the portal?
... View more
09-21-2022
03:43 AM
|
0
|
2
|
1038
|
|
POST
|
@LarsElmkær_Chwastek, I believe there is no way for the document containing the Iframe to change that behaviour. It seems those links are overriding the default behaviour, to open in the same iframe, and security restrictions prevent interactions with the DOM of other origins. Those links are so to say from another origin. That is, except if you can change the target of those links to something like target=‘_self’ in their a tag.
... View more
09-20-2022
12:09 PM
|
0
|
2
|
1449
|
|
IDEA
|
I was wondering if something like that could be solved with an add-in.
... View more
09-20-2022
10:17 AM
|
0
|
0
|
397
|
|
POST
|
I know the GUIDs. However, that does not sound like this is something I can build into to installation routine of the new Add-In. I am looking for some functionality similar to dependencies of one Add-In to another Add-In, or using the DAML to remove buttons in the UI... just to delete a whole Add-In.
... View more
09-15-2022
08:10 AM
|
0
|
1
|
2895
|
|
POST
|
I would like to know if I can use DAML to check if a specific Add-In exists in AGP if it does exist, if there is the possibility to delete it I wrote an Add-In that is replacing two earlier Add-Ins I wrote and I would like to delete the two earlier Add-Ins on a customers AGP if they are installed. Is that possible during the installation process of the new Add-In?
... View more
09-15-2022
05:27 AM
|
0
|
6
|
2926
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-24-2022 01:23 AM | |
| 1 | 09-15-2021 01:21 AM | |
| 1 | 08-30-2022 04:31 AM | |
| 2 | 04-24-2024 04:23 AM | |
| 3 | 12-12-2023 07:49 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-08-2025
10:36 PM
|