|
POST
|
Hi. I'm trying to use ArcGIS API for Python to run a simple query on two layers from the same service. https://arcgisv11.sea.gob.cl/server/rest/services/WEBServices/ProyectosSEIA/MapServer Using this sample code I try to create a dataframe from the layer data and it works the EIA layer (1) but not in DIA layer (2) even if the layers are almost identical import pandas as pand
from arcgis.gis import GIS
from arcgis.features import GeoAccessor, GeoSeriesAccessor, FeatureLayerCollection
gis = GIS()
fs_url=r"https://arcgisv11.sea.gob.cl/server/rest/services/WEBServices/ProyectosSEIA/MapServer"
coleccioncapas = FeatureLayerCollection(fs_url)
Capas=coleccioncapas.layers
#for capa in Capas:
# print(capa.properties.name)
capa_data=Capas[1]
df_data = pand.DataFrame.spatial.from_layer(capa_data)
print(df_data.head(5)) That's the error. C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\urllib3\connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host 'arcgisv11.sea.gob.cl'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
warnings.warn(
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\urllib3\connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host 'arcgisv11.sea.gob.cl'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
warnings.warn(
Traceback (most recent call last):
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\requests\models.py", line 974, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\features\geo\_accessor.py", line 2683, in from_layer
return from_layer(layer=layer)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\features\geo\_io\serviceops.py", line 186, in from_layer
sdf = layer.query(where=query, as_df=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\features\layer.py", line 2257, in query
).execute()
^^^^^^^^^
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\_impl\common\_query.py", line 658, in execute
return self._query(raw)
^^^^^^^^^^^^^^^^
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\_impl\common\_query.py", line 679, in _query
return self._handle_query_exception(query_exception)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\_impl\common\_query.py", line 843, in _handle_query_exception
raise query_exception
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\_impl\common\_query.py", line 677, in _query
return self._process_query_result(result, raw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\_impl\common\_query.py", line 711, in _process_query_result
features = self._fetch_all_features_by_chunk()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\_impl\common\_query.py", line 829, in _fetch_all_features_by_chunk
result = future.result().json()
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\requests\models.py", line 978, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\Code\core-python-jupiter\pruebas\testing.py", line 12, in <module>
df_data = pand.DataFrame.spatial.from_layer(capa_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\features\geo\_accessor.py", line 2687, in from_layer
raise Exception(
Exception: Malformed response from server, could not load the dataset: Expecting value: line 1 column 1 (char 0)
... View more
11-25-2025
05:48 AM
|
0
|
1
|
273
|
|
POST
|
Hi. I'm trying to get a list of fields from all the services inside a folder in ArcGIS Server using Python API. But when I want to list my services, all the MapServer gives Could not load service: <serviceURL>/MapServer This is the code I'm using with a ServicesDirectory Object. server_url = "https://<webadaptorserver>"
portal_url = "https://<webadaptorportal>"
usuario = "admin"
contraseña = "password"
gis = GIS(portal_url, usuario, contraseña)
gisSD= server.catalog.ServicesDirectory(url=server_url,tokenurl=gis._con.token)
servfolder="MYFOLDER"
servicios=gisSD.list(folder=servfolder)
for s in servicios:
print (s)
... View more
12-18-2024
12:25 PM
|
0
|
1
|
579
|
|
POST
|
Hi Markus. Recently I worked with a cloud storage connection on Azure and it works for me with the following data: Access Key ID: it should be the storage account name in Azure. Secret Access Key: The account key that you can get on Azure Panel (Keys). The Bucket Name: It's only the container name, not the URL The Service EndPoint is also needed and is fixed to blob.core.windows.net (it's not necessary to add the account name before that) Use the New Cloud Storage Connection in the Insert Tab. Hope it helps you. Greetings Leandro.
... View more
05-28-2024
08:59 PM
|
0
|
0
|
1359
|
|
BLOG
|
Hi @Bing_AnChen I tried to isolate the issue but I don't know if this is correct... In the documentation it talks about log files but ArcGIS Earth it's not even generating logs, here's my Roaming ArcGIS Earth folder. Where i can find them. It seems that my config is missing some parameters This is all i have <?xml version="1.0" encoding="utf-8"?>
<configuration version="2.0">
<general>
<workspace autoSave="True">
<directory>C:\Users\lzamudio\Documents\ArcGISEarth\workspace\</directory>
</workspace>
<startupView>
<type>Custom</type>
<camera>
<mapPoint>
<x>-92</x>
<y>41</y>
<z>11000000</z>
<wkid>4326</wkid>
</mapPoint>
<heading>0</heading>
<pitch>0</pitch>
<roll>0</roll>
</camera>
</startupView>
<spatialReference>WebMercator</spatialReference>
<isShowInExternalBrowser>False</isShowInExternalBrowser>
<isShowStartupTips>True</isShowStartupTips>
<language>System</language>
</general>
<navigation>
<flyto>
<speed>50</speed>
<autoZoomToNewLayer>True</autoZoomToNewLayer>
</flyto>
<mouseWheel>
<speed>50</speed>
<zoomDirection>Forward</zoomDirection>
</mouseWheel>
<continuousPanning>True</continuousPanning>
<nonMouseController enable="False" reverse="False" />
<navigator>
<enableNavigatorControl />
</navigator>
</navigation>
<units>
<location>DMS</location>
<distance>Meters</distance>
<area>SquareMeters</area>
<isLongitudeFront>False</isLongitudeFront>
<elevation>Meters</elevation>
</units>
<advanced>
<proxy use="False">
<address>
<value>
</value>
</address>
<username>
<value>
</value>
</username>
<password>
<value>kQobIpb8JGh6BdmZVesPMg==</value>
</password>
</proxy>
</advanced>
<portals signInUsingBrowser="False" />
<environments>
<atmosphere>Horizon</atmosphere>
<elevationExaggeration>1</elevationExaggeration>
</environments>
<favorTools />
<enableCheckForUpdates>True</enableCheckForUpdates>
</configuration>
... View more
08-28-2023
12:36 PM
|
0
|
0
|
1541
|
|
BLOG
|
It looks smooth but when I exported a movie (No layers, only a panning shot) it gives me a 0 bytes .mp4 file
... View more
07-20-2023
01:32 PM
|
0
|
0
|
1691
|
|
POST
|
Update: I built the apk now with 5.5.180 (for some reason i could make it installing the software on another pc) successfully. I upload it to Play Console and the problem persists (same message). In app studio I just: 1. Set up the settings (certificates and stuff) the update i did in the apk was change a featureservice parameter (nothing changed in the code). Just in case i deleted the minimumsdkversion and targetsdkversion for android 2. Upload it 3. Select Make and choose cloud option. 4. Set the password for android and iOS keys. 5. and request build, download from OTA and upload it into play console This is the play console result of the releases (it's a wider range than before).
... View more
03-28-2023
05:12 AM
|
0
|
0
|
1264
|
|
POST
|
Hi. After updating AppStudio to 5.5.180 now i can't even make the build. I have been waiting like an hour to build the app via cloud make.
... View more
03-27-2023
01:25 PM
|
1
|
1
|
1283
|
|
POST
|
Hi. I've made an app with Appstudio 5.4 and Runtime 100.14. It works fine but when i make the apk and upload it into Google Play to internal testing it shows the following message as a tester: Translated: This app is not available for your device because it was built for an older version of Android Note: I'm trying to test it in Android 11. I setup the target sdk version in appinfo.json like this: "deployment": {
"android": {
"minimumSdkVersion": 31,
"packageName": "<app bundleid that cannot reveal>",
"targetSdkVersion": 33
}, This is following the Google Play API Levels | Android versions, SDK/API levels, version codes, codenames, and cumulative usage Is there anything that i'm doing wrong?, because my current release works fine in production But my updated version don't Thank you in advance Leandro
... View more
03-24-2023
01:51 PM
|
0
|
4
|
1331
|
|
POST
|
Hi @GreteSoosalu I watched the codepen but it doesn't show the custom coordinate format but reading the code and re-thinking it I could solve it breaking the coordinates as you suggested. For further reference I share the solution of the same code but corrected: const newFormat = new Format({
name: "XYZ",
conversionInfo: {
convert: function (point) {
const returnPoint = point.spatialReference.isWGS84
? point
: webMercatorUtils.webMercatorToGeographic(point);
const x = Math.trunc(returnPoint.x);
const a = Math.trunc(-(returnPoint.x-x)*60);
const b = (-(returnPoint.x-x-(a/-60))*3600).toFixed(2);
const y = Math.trunc(returnPoint.y);
const c = Math.trunc(-(returnPoint.y-y)*60);
const d = (-(returnPoint.y-y-(c/-60))*3600).toFixed(2);
const z = returnPoint.z.toFixed(2)/2;
//console.log(b)
return {
location: returnPoint,
coordinate: `${x}, ${a}, ${b}, ${y}, ${c}, ${d}, ${z}`
};
},
//For now i'm not using the reverseConvert function so I left it as is
reverseConvert: function (string) {
const parts = string.split(",");
return new Point({
x: parseFloat(parts[0]),
y: parseFloat(parts[1]),
z: parseFloat(parts[2]),
spatialReference: { wkid: 4326 }
});
}
},
coordinateSegments: [
{alias: "X", description: "Longitud Grados", searchPattern: numberSearchPattern},
{alias: "A", description: "Longitud Minutos", searchPattern: numberSearchPattern},
{alias: "B", description: "Longitud Segundos", searchPattern: numberSearchPattern},
{alias: "Y", description: "Latitud Grados", searchPattern: numberSearchPattern},
{alias: "C", description: "Latitud Minutos", searchPattern: numberSearchPattern},
{alias: "D", description: "Latitud Segundos", searchPattern: numberSearchPattern},
{alias: "Z", description: "Elevación", searchPattern: numberSearchPattern}
],
defaultPattern: "X° A\' B\", Y° C\' D\", Zm"
}); I'd like to know more about the Regular expressions that you used to find a number, is there any reference to read about it? // Regular expressions to find a number
const numberSearchPattern = /-?\d+[\.]?\d*/;
const number2Digit = /\d{1,2}[\.|\.]?\d*/i; // Same as CoordinateConversion widget's DMS format uses
const number3Digit = /\d{1,3}[\.|\.]?\d*/i; // Same as CoordinateConversion widget's DMS format uses Thanks for your help
... View more
01-11-2023
09:15 AM
|
0
|
2
|
1247
|
|
POST
|
Hi, following the CoordinateConversion custom format in the documentation I've implemented the widget correctly in my 4.24 app. But now i need to show the lat/long in DMS, it's like combining these two This is my format code const numberSearchPattern = /-?\d+[\.]?\d*/;
const newFormat = new Format({
// Nombre único e información del Formato
name: "XYZ",
conversionInfo: {
convert: function (point) {
const returnPoint = point.spatialReference.isWGS84
? point
: webMercatorUtils.webMercatorToGeographic(point);
const x = returnPoint.x.toFixed(2);
const y = returnPoint.y.toFixed(2);
const z = returnPoint.z.toFixed(2)/2;
return {
location: returnPoint,
coordinate: `${x}, ${y}, ${z}`
};
},
reverseConvert: function (string) {
const parts = string.split(",");
return new Point({
x: parseFloat(parts[0]),
y: parseFloat(parts[1]),
z: parseFloat(parts[2]),
spatialReference: { wkid: 4326 }
});
}
},
coordinateSegments: [
{
alias: "X",
description: "Longitud",
searchPattern: numberSearchPattern
},
{
alias: "Y",
description: "Latitud",
searchPattern: numberSearchPattern
},
{
alias: "Z",
description: "Elevación",
searchPattern: numberSearchPattern
}
],
defaultPattern: "X°, Y°, Zm"
}); Note: The Z value is divided by 2 because the WebScene has a 2x exaggeration. Thanks in advance
... View more
12-27-2022
06:42 AM
|
0
|
4
|
1346
|
|
POST
|
Hi. It seems to work for me using latest version (2.8.1 Patch 1)
... View more
06-30-2021
02:55 PM
|
0
|
0
|
2413
|
|
POST
|
Hi. Checking out the roadmap for ArcMap I have a question about the Data Extraction Toolset and the famous Clip and Ship tutorial to create a GP Service o extract data. Geoprocessing service example: Clip And Ship—ArcGIS Server | Documentation for ArcGIS Enterprise Currently we're using this GP Service and it's very useful but we want to start using ArcGIS Pro to manage this GP Service as a Web Tool. The problem is that I can't found a useful way to publish correctly the GP Service in ArcGIS Pro (specially because I can't copy the Extract Data Task Tool in ArcGIS Pro and it has some details that cannot manage. Specially with the Area of interest (that creates a new FC) and the scratchWorkspace parameter. Any suggestions and/or workaround? Thank you
... View more
06-30-2021
02:03 PM
|
0
|
4
|
2425
|
|
POST
|
Hi! I'd like to ask if when I add data from ArcGIS Online to my PowerBI Dashboard as reference layers it supports labeling. Thanks in advance
... View more
02-16-2021
12:30 PM
|
2
|
3
|
2144
|
|
POST
|
Hi! Working with ArcGIS Pro 2.7 I've noticed something when I was using Annotation Layers and Point Layers with Labels. I have a map in Pro like this The ocean letters are from an Annotation Layer (Text Map Notes) and it has a Point FC with standard labeling. I wanted to use Layer Blend effects applying a Hard Light Blend to the Annotation Layer and this happened. The Point Feature Layer dissapeared. It gets weirder because the point FC is above the Annotation Layer in the Table of contents. If I switch the layers order it shows the point but not the labeling. Is there a limitation using blend effects in Annotation Layers or is a bug? Greetings
... View more
02-16-2021
12:18 PM
|
3
|
8
|
2731
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-07-2019 12:52 PM | |
| 1 | 03-27-2023 01:25 PM | |
| 1 | 01-14-2015 07:38 AM | |
| 1 | 01-14-2021 03:00 PM | |
| 3 | 02-16-2021 12:18 PM |
| Online Status |
Offline
|
| Date Last Visited |
4 weeks ago
|