Jump to content
Developer Wiki and Function Reference Links ×

Set the feature service of a layer with Vectorscript?


Recommended Posts

  • 3 weeks later...
  • Vectorworks, Inc Employee
On 6/19/2022 at 3:16 PM, MarcelP102 said:

I'm planning to make a script that sets the feature service of a layer. Get's the geometry and than changes to another feature service and repeat the process. Unfortunately I can't find a function to set feature service of a layer. It's a relative new function, available since 2022 so perhaps that's why it's not available at the Wiki?

 

Hi @MarcelP102

 

Could you give more details about the algorithm you want to follow when setting a feature service to a layer?

 

I assume everything should be hidden with no popup dialogs? If this is desired, you will have to provide at least the URL address, Layer ID, Service Type(ESRI Feature or WFS), boolean for Request View Region features, and maybe more like that. Thanks.

 

Link to comment

Hi @iborisov

 

I want to automatically download the 'BGT', the Dutch public map service. Right now it's available within ArcGIS online, see screenshot from VW below. As you can see it is build up with a lot of different layers. So a script than can download each BGT map in the same VW layer can speed up the process. So no pop-up and hardcode the URL, Layer ID etc is OK. 

 

(even better would be if we can assign multiple feature services to the same VW layer. And we can map each feature service to a class. Than there would be no need for this script) 

 

BGT.thumb.JPG.f2e465852e81e272f88aaebe075633f2.JPG

Edited by MarcelP102
Link to comment
  • 2 weeks later...
  • Vectorworks, Inc Employee

Hi @MarcelP102

 

My plans are to add four vector script functions and it would be great to hear your opinion.

 

The vector script functions are as follows:

 

PROCEDURE BindLayerToArcGISFS(
            hLayer              :HANDLE;
            strURL              :STRING;
            strFeatureID     :STRING;
            bRequestAll     :BOOLEAN);
            
PROCEDURE BindLayerToWFSFS(
            hLayer                  :HANDLE;
            strURL                  :STRING;
            strFeatureName  :STRING;
            bRequestAll         :BOOLEAN);

 

PROCEDURE UpdateLayerFromFS(
            hLayer                 :HANDLE;
            bRequestAll        :BOOLEAN);


PROCEDURE UpdateFeatureLayer(
            hLayer                 :HANDLE);
            

You can use the "FOR" cycle and BindLayerToArcGISFS() to achieve your goal:

 

PROCEDURE ArcGISFeatureService; 
VAR
    id                         : INTEGER;
    url                        : STRING;
    featureId             : STRING;
    requestAll           : BOOLEAN;

BEGIN
    url                        := 'https://basisregistraties.arcgisonline.nl/arcgis/rest/services/BGT/BGT_objecttypen/FeatureServer';
    requestAll           := TRUE;
    
    FOR id := 0 TO 50 DO
    BEGIN
        featureId         := Num2Str(0, id);
        BindLayerToArcGISFS( ActLayer, url, featureId, requestAll );
    END;
END;

RUN (ArcGISFeatureService);

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...