Giter Club home page Giter Club logo

Comments (7)

nanaeaubry avatar nanaeaubry commented on August 26, 2024

@PleaseStopAsking
Can you update to the latest version of the API and try again?
A lot of effort was put into cloning in the past versions and this might have already been fixed. Let us know if you still see this occurring

from arcgis-python-api.

PleaseStopAsking avatar PleaseStopAsking commented on August 26, 2024

@nanaeaubry I can attempt to get v2.3.0 running but when I initially attempted to spin up the docker image, it threw errors that I never resolved. This led to using v2.2.0. I will report back once I get v2.3.0 running.

Below is the error from v2.3.0
Run command: docker run -it --rm -p 8888:8888 ghcr.io/esri/arcgis-python-api-notebook:2.3.0

Running hooks in: /usr/local/bin/start-notebook.d as uid: 1000 gid: 100
Done running hooks in: /usr/local/bin/start-notebook.d
Running hooks in: /usr/local/bin/before-notebook.d as uid: 1000 gid: 100
Done running hooks in: /usr/local/bin/before-notebook.d
Executing the command: jupyter notebook
Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/notebook/traittypes.py", line 235, in _resolve_classes
    klass = self._resolve_string(klass)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/traitlets/traitlets.py", line 2025, in _resolve_string
    return import_item(string)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/traitlets/utils/importstring.py", line 31, in import_item
    module = __import__(package, fromlist=[obj])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'jupyter_server.contents'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/bin/jupyter-notebook", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/jupyter_core/application.py", line 280, in launch_instance
    super().launch_instance(argv=argv, **kwargs)
  File "/opt/conda/lib/python3.11/site-packages/traitlets/config/application.py", line 1051, in launch_instance
    app = cls.instance(**kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/traitlets/config/configurable.py", line 575, in instance
    inst = cls(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/traitlets/traitlets.py", line 1311, in __new__
    inst.setup_instance(*args, **kwargs)
  File "/opt/conda/lib/python3.11/site-packages/traitlets/traitlets.py", line 1354, in setup_instance
    super(HasTraits, self).setup_instance(*args, **kwargs)
  File "/opt/conda/lib/python3.11/site-packages/traitlets/traitlets.py", line 1330, in setup_instance
    init(self)
  File "/opt/conda/lib/python3.11/site-packages/notebook/traittypes.py", line 226, in instance_init
    self._resolve_classes()
  File "/opt/conda/lib/python3.11/site-packages/notebook/traittypes.py", line 238, in _resolve_classes
    warn(f"{klass} is not importable. Is it installed?", ImportWarning)
TypeError: warn() missing 1 required keyword-only argument: 'stacklevel'

from arcgis-python-api.

nanaeaubry avatar nanaeaubry commented on August 26, 2024

@PleaseStopAsking
After re-reading your issue it seems you are trying to clone a single layer rather than an item. This is not possible through the API and you have to clone the whole item

from arcgis-python-api.

PleaseStopAsking avatar PleaseStopAsking commented on August 26, 2024

@nanaeaubry

That is correct. The use-case here is that I need a specific layer from a 3rd party service that is publicly available and instead of adding the entire service as an item in my portal, I point to the individual layer. I can then add this item to any number of web maps or dashboards without having to selectively hide/disable all the other layers that may come with the 3rd party service thus making its usage much easier.

As for it not currently being supported, I can open a feature request to add this in a future release because this would likely benefit others as well.

from arcgis-python-api.

nanaeaubry avatar nanaeaubry commented on August 26, 2024

@PleaseStopAsking
You can log an enhancement and we will take it under consideration, however this is complicated since you have to read the terms of use of items, even if they are public to make sure they can be cloned/copied. Cloning is already very limited as you have to be the owner of the item you are cloning or an administrator of the org where the item is held (living atlas being an exception).

A better way to do this is to add the layer by url to the apps and maps you want to use it in.

If you really want to copy then you need to check the metadata for the terms and conditions of this. (this is in general for any and all layers you think of using in the future)

You can either download it from the site using the download button: https://hifld-geoplatform.hub.arcgis.com/datasets/75079bdea94743bcaca7b6e833692639_0/explore

Or with the python api you can query into a SeDF and then import it into your portal.

Hope that helps!

from arcgis-python-api.

PleaseStopAsking avatar PleaseStopAsking commented on August 26, 2024

@nanaeaubry I am not sure I am following you with regard to the terms of use. If I have created a new feature layer item (non-hosted) in my portal that is simply referencing an external 3rd party feature service, how does cloning/copying that 3rd party service come into play?

The only thing that I would control would be the cloning/copying of the portal item, not the underlying referenced service data. As I would be the admin for both the source and target portals, I have full control to copy/clone the portal items. I just want to ensure I am understanding the issue at play.

Case in point, the Hospital feature service at https://services1.arcgis.com/Hp6G80Pky0om7QvQ/arcgis/rest/services/Hospital/FeatureServer.

If I use that feature service as the basis for a new item in Portal, it does not clone that service into my Portal, but simply references the data when I load it into a web map, etc. Even the description of this type of Portal item states, Link to an ArcGIS Server web service...

image image

from arcgis-python-api.

nanaeaubry avatar nanaeaubry commented on August 26, 2024

@PleaseStopAsking
Some services have privacy terms set up where you are only allowed to reference and not copy so I would just be wary of that.

But to copy I would go the SeDF route described in my previous comment.

from arcgis-python-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.