<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alexander Daniel Pratama on Medium]]></title>
        <description><![CDATA[Stories by Alexander Daniel Pratama on Medium]]></description>
        <link>https://medium.com/@alexanderdan-pratama?source=rss-4fc2ae13f564------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sCajEn5YaGE0DCBxCw2NYA.jpeg</url>
            <title>Stories by Alexander Daniel Pratama on Medium</title>
            <link>https://medium.com/@alexanderdan-pratama?source=rss-4fc2ae13f564------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:01:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alexanderdan-pratama/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Don’t use attribute rule in the huge Geospatial Data, check your topology with Data Interop (FME…]]></title>
            <link>https://alexanderdan-pratama.medium.com/dont-use-attribute-rule-in-the-huge-geospatial-data-check-your-topology-with-data-interop-fme-a116313cfeb1?source=rss-4fc2ae13f564------2</link>
            <guid isPermaLink="false">https://medium.com/p/a116313cfeb1</guid>
            <category><![CDATA[esri]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[data-quality]]></category>
            <category><![CDATA[fme]]></category>
            <dc:creator><![CDATA[Alexander Daniel Pratama]]></dc:creator>
            <pubDate>Thu, 19 Nov 2026 23:07:19 GMT</pubDate>
            <atom:updated>2026-11-19T23:07:19.559Z</atom:updated>
            <content:encoded><![CDATA[<h3>Don’t use attribute rule in the huge Geospatial Data, check your topology with Data Interop (FME Workbench)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J2lFFJsV9EP1mlmm" /><figcaption>Photo by <a href="https://unsplash.com/@markuswinkler?utm_source=medium&amp;utm_medium=referral">Markus Winkler</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>Introduction</strong></h3><p>When I worked in a Proof of Concept for Utility Network ArcGIS, before migration the first thing to do is checking the geometry hygiene for a huge area, literally 75% of an island. To do geometry quality control in ArcGIS most of the time, I used either topology datasets or attribute rule, knows as data reviewer extension.</p><p>In the project, I choose the attribute rule since it has greater flexibility to validate the geometry cleanliness in the workspace. However, it was nightmare. Running million features require me to create parallel batch job and multiple grids as smaller AOI suitable to “accelerate” the process.</p><p>I cannot work with a technology that cannot processed such a big data in indefinite timeline. Therefore, I hold my work and turn to ArcGIS Data Interopability extensions, supported by FME Workbench. Using FME Workbench, the quality control process greatly reduces from days to two hours.</p><p>Therefore, I want to share my topology checking workflow in this article.</p><p>Before I start, this workflows best on two requirements,</p><ol><li>Geometry must inside a geodatabase, either file geodatabase or enterprise geodatabase</li><li>Activate the GlobalID before doing the FME Workspace</li></ol><h3>Chapter 1 Point Checking</h3><p><strong>1.1 Over stacked Points</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*1VfuGKymWRLoPGTi8Gmvzw.png" /></figure><p>Over stacked points is one of the simplest topology checking. All you need to do is to do rounding the coordinate number before extracting the coordinate value. After that, you need to find duplicate value in the coordinate X Y Z which eventually the duplicate value is the <strong>Overstacked errors.</strong></p><p><strong>1.2. A Point does not connect with a line</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*K-SH5IGUrOJJi4qkivf9xA.png" /></figure><p>If you need a point must <strong>intersect </strong>with a line or specifically verify the point must snap in the start or last of line vertices, you only to put <strong>Spatial Filter Transformer</strong> in the workspace. Remember, since you want to know which point is error, you must assign it as candidate while the line as a filter. In the spatial filter transformer properties, please change the <strong>Spatial Predict to Test</strong> as Intersect, if you want a general intersect rule, or Touch, if you want a snapped point feature on a line.</p><p><strong>1.3. Point must within a polygon</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*Yfj6a_BY3zFxb842fRwXkw.png" /></figure><p>This is also a simple model to verify whether the point must inside a polygon. Applying Spatial Filter Transformer where <strong>Spatial Predict to Test </strong>is contain.</p><h3>Chapter 2 Line Checking</h3><p><strong>2.1. Line not connect with point in the start or its vertex</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8BqyW3avuBUl_HVBKf5jkw.png" /></figure><p>This process is the beginning of the complex process in one of topology checking. The key is you need to extract the start and last vertices (X and Y for 2D, use Z for 3D) of the line by Coordinate Extractor. After that, create points from those vertices. Then, you may want to delete identical XY to increase performance. The last three steps in order is buffer, spatial filter with point(s), and join with previous line input with GlobalID. You will get the error lines which do not have point either in start or last line’s vertices.</p><p><strong>2.2. Line is closed</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LNEa-dG9BWxGSY3ffI9Nbw.png" /></figure><p>Closed line is a line feature that shapes as a polygon. Some GIS works do not need it. However, if you want to apply this geometry quality control, the main idea is you need to know that the start vertices share the same coordinate with last vertices. You need to join by applying <strong>Feature Joiner </strong>the feature from <strong>Coordinate Extractor transformer of the start vertex </strong>with feature from You need to join the feature from Coordinate Extractor transformer of the start vertex. Then, do the <strong>Tester Transformer</strong> to test the coordinate of start vertices is equal to coordinate of last vertices. If it is true, the you will get the error from line is closed.</p><p><strong>2.3. Multipart Line</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*sdwZgp6JnREwovDxaWlB2A.png" /></figure><p>Another simple topology check, finding the multipart line feature is by applying <strong>Multigeometry Filter </strong>transformer. If it is true, you only need the <strong>Contain </strong>output port.</p><p><strong>2.4. Line intersect at Z value</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4HUz-Y-9XXMPSxqv7jqbRg.png" /></figure><p>Finding a line that its vertices intersect with other lines’ vertices is another level for me. After doing some trial-error, I find the Chopper transformer is a game changer. This transformer exports a line to a group of points. As the workspace now focuses on point, I can heavily rely on Feature Joiner. On the illustration above, there are three Feature Joiner in respective.</p><p>First I try to join points of Line A with points of Line B. The used output is Joined Feature which later will join with start or last Coordinate of line to eliminate the start or last vertices. The output port for this part is the Unjoined Left Feature that will finally join with the line feature to highlight the error.</p><h3>Chapter 3 Polygon Checking</h3><p><strong>3.1. Overlap Polygon</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*RTGXeDOuJ-cMcrYrO_vP5A.png" /></figure><p>All you need to do is applying Spatial Filter Transformer where <strong>Spatial Predict to Test </strong>is <strong>Overlap</strong></p><p><strong>3.2. Multipart Polygon</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*jnvhwSYyfz2HnyRQhV2dfA.png" /></figure><p>It is same with the multipart line, only this time polygon is an input.</p><h3><strong>Chapter 4 Conclusion</strong></h3><p>Topology checking does not have to take days. With a handful of FME transformers, you can validate millions of features in hours, and arrive at your Utility Network migration with clean geometry. I hope this workflow saves you the same pain it saved me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a116313cfeb1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Orchestrate your Arcpy in Airflow]]></title>
            <link>https://alexanderdan-pratama.medium.com/orchestrate-your-arcpy-in-airflow-d671f1351068?source=rss-4fc2ae13f564------2</link>
            <guid isPermaLink="false">https://medium.com/p/d671f1351068</guid>
            <category><![CDATA[arcpy]]></category>
            <category><![CDATA[data-orchestration]]></category>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[esri]]></category>
            <category><![CDATA[airflow]]></category>
            <dc:creator><![CDATA[Alexander Daniel Pratama]]></dc:creator>
            <pubDate>Thu, 05 Nov 2026 01:10:38 GMT</pubDate>
            <atom:updated>2026-11-15T23:11:23.860Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9qrAomjMKnCnZX62" /><figcaption>Photo by <a href="https://unsplash.com/@rsimmons_broadcast?utm_source=medium&amp;utm_medium=referral">Rob Simmons</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>For years, all my ETL scripts did its job well. Then one day a colleague asked me to explain how it worked, and I froze because it will take much time to explain to him. I knew how to run it, but everything was tangled together in a script that dependent to each other. To make it worse, I was the only person who understood it.</p><p>I wanted a way to show the whole process step by step, so I found Airflow. For the first time, I could see my pipeline as simple boxes with arrows between them, green when it worked and red when it failed. I was excited, until I tried to bring the ArcPy step into it. Airflow could not work with ArcPy’s Python because Arcpy integrates only in windows and it is a proprietary license.</p><p>Then I stopped asking how to make Airflow run ArcPy natively, and asked why it had to. Airflow could stay in Docker as the conductor, and ArcPy could stay on the machine where ArcGIS Pro lived. All Airflow needed to do was send the command over SSH. That small idea turned my frustration into a pipeline I could finally explain.</p><p>To begin the integration, you must fulfil these requirement first</p><ol><li>Windows host machine with Administration access</li><li>ArcGIS Pro</li><li>Docker</li><li>PostgreSQL in Docker</li><li>Internet Connection</li></ol><h3>Chapter 1. Set up SSH Server in the host machine</h3><ol><li>Open windows powershell as an Administrator</li><li>Type Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0, then press Enter. It will download a window feature for SSH Server, please wait about 20–30 minutes depend on your internet speed</li></ol><pre>Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0</pre><p>3. After it is finished, the final process is to type Start-Service sshd, follow by Set-Service -Name sshd -StartupType Automatic. You may change StartupType to manual if you do not want to start on the boot</p><pre>Start-Service sshd</pre><pre>Set-Service -Name sshd -StartupType Automatic</pre><p>If you want to change ssh configuration, you can edit the config file in C:\ProgramData\ssh\sshd_config</p><h3>Chapter 2. Set Up Docker Internal Network</h3><p>Open windows powershell as an adminstrator, then create docker network</p><pre>docker network create gis_network</pre><h3>Chapter 3. Set up docker</h3><ol><li>Create a new folder in your disk, then create three new files; .env, docker-compose.yaml, and dockerfile. So the configuration, should like this</li></ol><pre>airflow<br>|<br>|-- .env<br>|-- docker-compose.yaml<br>|-- dockerfile</pre><ol><li>In the .env, please configure these parameters</li></ol><pre>AIRFLOW_UID=50000<br>POSTGIS_PASSWORD=your_postgreql_password<br>AIRFLOW_JWT_SECRET=your_airflow_jwt_secret<br>AIRFLOW_API_SECRET_KEY= your_airflow_api_secret_key<br>AIRFLOW_DB_PASSWORD=your_airflow_db_passowrd</pre><p>3. The docker-configure.yaml</p><pre>x-airflow-common: &amp;airflow-common<br>  build: .<br>  image: airflow:3.3.2<br>  extra_hosts:<br>    - &quot;host.docker.internal:host-gateway&quot;<br>  environment:<br>    - AIRFLOW__CORE__FERNET_KEY=VFVyQ2lXQjFqWGVfR1p3Z3o1bnpJdG1XcU9kVG5oQnM=<br>    - AIRFLOW__CORE__EXECUTOR=LocalExecutor<br>    - AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:${AIRFLOW_DB_PASSWORD}@postgis_db:5432/airflow<br>    - AIRFLOW__CORE__LOAD_EXAMPLES=false<br>    - AIRFLOW__CORE__AUTH_MANAGER=airflow.providers.fab.auth_manager.fab_auth_manager.FabAuthManager<br>    - AIRFLOW__CORE__EXECUTION_API_SERVER_URL=http://airflow-api-server:8080/execution/<br>    - AIRFLOW__API_AUTH__JWT_SECRET=${AIRFLOW_JWT_SECRET}<br>    - AIRFLOW__API__SECRET_KEY=${AIRFLOW_API_SECRET_KEY}<br>  volumes:<br>    - ./dags:/opt/airflow/dags<br>    - ./logs:/opt/airflow/logs<br>    - ./plugins:/opt/airflow/plugins<br>    - ./config:/opt/airflow/config<br>  user: &quot;${AIRFLOW_UID:-50000}:0&quot;<br>  networks:<br>    - gis_network<br><br>services:<br>  airflow-init:<br>    &lt;&lt;: *airflow-common<br>    entrypoint: /bin/bash<br>    command:<br>      - -c<br>      - |<br>        airflow db migrate<br>        airflow users create --username admin --password admin --firstname Admin --lastname User --role Admin --email admin@example.com<br><br>  airflow-scheduler:<br>    &lt;&lt;: *airflow-common<br>    command: scheduler<br>    restart: always<br>    depends_on:<br>      airflow-init:<br>        condition: service_completed_successfully<br><br>  airflow-api-server:<br>    &lt;&lt;: *airflow-common<br>    command: api-server<br>    ports:<br>      - &quot;8080:8080&quot;<br>    restart: always<br>    depends_on:<br>      airflow-init:<br>        condition: service_completed_successfully<br><br>  airflow-dag-processor:<br>    &lt;&lt;: *airflow-common<br>    command: dag-processor<br>    restart: always<br>    depends_on:<br>      airflow-init:<br>        condition: service_completed_successfully<br>        <br>networks:<br>  gis_network:<br>    external: true</pre><p>4. The dockerfile</p><pre>FROM apache/airflow:3.3.2<br>USER root<br>RUN apt-get update<br>ENV QT_QPA_PLATFORM=offscreen<br>USER airflow<br>RUN pip install --no-cache-dir psycopg2-binary pandas requests sqlalchemy apache-airflow-providers-ssh</pre><p>5. Then, build the image</p><pre>docker compose build</pre><p>6. After that run the airflow container</p><pre>docker compose up -d</pre><p>7. Please check in the web browser localhost:8080. If there is airflow login page, the airflow set up is completed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NQpp6IMcm4-JntvV95B8uQ.png" /></figure><p>Please note, you can change your airflow port in the docker-compose.yaml if there is an application uses the default port 8080. Just change to XXXX:8080, the XXXX is your host port number</p><p>If you success, your work folder should have new airflow related folders</p><pre>airflow<br>|-- config<br>|-- dags<br>|-- logs<br>|-- plugins<br>|-- script<br>|-- .env<br>|-- docker-compose.yaml<br>|-- dockerfile</pre><h3>Chapter 4. Config the SSH Connection</h3><ol><li>Go to Admin menu in the left pane, click and choose the Connections</li><li>Create new connection with these parameters</li></ol><pre>Connection Id = windows_host_ssh<br>Connection Type = SSH<br>Host = host.docker.internal<br>Username = your Windows username<br>Password = your Windows password<br>Port = 22</pre><h3>If your windows has 2FA, then it won’t work, you need find a work around on this authentication.</h3><h3>Chapter 5. Design your Arcpy DAG</h3><ol><li>In the script folder, create a python file test_arcpy.py</li></ol><pre>import sys<br>import arcpy<br><br>def main(input:str):<br><br>    print(&quot;Starting the ArcPy script...&quot;)<br><br>    arcpy.AddMessage(f&quot;Input parameter received: {input}&quot;)<br><br>    print(&quot;Done&quot;)<br><br>if __name__ == &quot;__main__&quot;:<br>    input_param = sys.argv[1]<br>    main(input_param)</pre><p>2. In the dags folder, create a python file dag_arcpy.py</p><pre>from airflow import DAG<br>from airflow.operators.bash import BashOperator<br>from airflow.providers.ssh.operators.ssh import SSHOperator<br><br>from datetime import datetime<br><br>with DAG(&#39;run_ssh_script_for_arcpy&#39;, <br>start_date=datetime(2026, 11, 1), <br>catchup=False) as dag:<br><br>    python_exe_file = &quot;path/to/esri_conda/envs/arcgispro-py3-un/python.exe&quot;<br><br>    run_script_1 = SSHOperator(<br>        task_id=&#39;execute_script_on_host1&#39;,<br>        ssh_conn_id=&#39;windows_host_ssh&#39;,<br>        command=f&quot;{python_exe_file} path/to/arcgis/test_arcpy.py HelloWorld&quot;<br>    )<br><br>    run_script_2 = SSHOperator(<br>            task_id=&#39;execute_script_on_host2&#39;,<br>            ssh_conn_id=&#39;windows_host_ssh&#39;,<br>            command=f&quot;{python_exe_file} path/to/arcgis/test_arcpy.py MyNameIsAlex&quot;<br>        )<br><br>    run_script_3 = SSHOperator(<br>                task_id=&#39;execute_script_on_host3&#39;,<br>                ssh_conn_id=&#39;windows_host_ssh&#39;,<br>                command=f&quot;{python_exe_file} path/to/arcgis/test_arcpy.py IAmLearningAirflow&quot;,<br>                cmd_timeout=3600,<br>                conn_timeout=30,<br>                banner_timeout=60,<br>            )<br><br>    run_script_4 = SSHOperator(<br>                task_id=&#39;execute_script_on_host4&#39;,<br>                ssh_conn_id=&#39;windows_host_ssh&#39;,<br>                command=f&quot;{python_exe_file} path/to/arcgis/test_arcpy.py WithArcpy&quot;,<br>                cmd_timeout=3600,<br>                conn_timeout=30,<br>                banner_timeout=60,<br>            )<br><br>    run_script_1 &gt;&gt; run_script_2 &gt;&gt; [run_script_3, run_script_4]</pre><p>You just need to change the variables on the python_exe_file and python_script_file</p><p>3. Refresh your opened airflow page (after you login), then go to the Dags page by clicking the Dags on the left pane. Then, open the your latest created dag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2IjfTT3_I-zTKPUf0iMILg.png" /></figure><p>4. Now, click Trigger button on the upper-right corner page until there is a window-box prompt to run this airflow. Do need to change anything, just click Trigger button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*kdbv_XO71fGW66_U8ZRAOw.png" /></figure><p>5. Wait until the process is finished.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d3Nm9GEbjgNErZDC13WaNA.png" /></figure><p>As your DAG successfully run, there are some notes I need you to aware</p><ol><li>I use timeout in the task 3rd and 4th because somehow SSHOperator only run one time for the same esri conda python. I will try to explore why the parallelism failed in this section</li><li>Since it does semi-parallelism*, I add three timeout parameters</li></ol><p>*Update = it run parallelism, however there are seconds different, depend on the script complexity</p><pre>SSHOperator(<br>            cmd_timeout=3600,<br>            conn_timeout=30,<br>            banner_timeout=60,)</pre><h3>Closing</h3><p>Airflow gives me more than monitoring for my automation. Every step of the pipeline is now a visible box, so when something fails, I and the operators can see exactly where, read the log, and retry only that step. It also makes knowledge transfer much easier. Instead of explaining a long script line by line, I can show the graph and walk through it from extract to transform to load, and the operators can follow it without needing to read the code. The pipeline is no longer something that lives only in my head.</p><p>You may ask why I did not use ModelBuilder. ModelBuilder is limited to the prebuilt tools, and although you can define new ones, in my experience that still means writing a script inside a toolbox. My processing already lived in Python and ArcPy, and I did not want to rebuild it just to fit a different tool. By keeping Airflow in Docker and sending the ArcPy step over SSH, I kept my existing scripts exactly as they were and still gained scheduling, retries, and clear visibility. In other words, I found a way to reach two islands in one sail.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d671f1351068" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get started with Machine Learning Part 1]]></title>
            <link>https://alexanderdan-pratama.medium.com/get-started-with-machine-learning-part-1-6e615f395e04?source=rss-4fc2ae13f564------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e615f395e04</guid>
            <category><![CDATA[introduction]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Alexander Daniel Pratama]]></dc:creator>
            <pubDate>Wed, 13 Oct 2021 03:47:28 GMT</pubDate>
            <atom:updated>2021-10-13T03:48:25.439Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Su_mvdgCR--M1gV5" /><figcaption>Photo by <a href="https://unsplash.com/@ikukevk?utm_source=medium&amp;utm_medium=referral">Kevin Ku</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I have been working for many months to understand machine learning. It is the most agonizing experience but on the other hand, is a thrilled one. I don’t have any experience related to IT or Advanced Calculus. Indeed, I learn calculus in my previous study in college but sometimes memory can fade if it does not use every day, am I correct?</p><p>Therefore, I have to study the basics of machine learning. I did not join any paid training courses. So I learn from wherever I can get free. Frankly, it is not a best practice for me because sometimes I need guidance. Then, I ask my manager to approve Machine Learning paid training for better understanding. After approval, join the training program, in short, I get a better understanding, still lack any experience in processing the data.</p><p>Fast forward, I incidentally watch MIT sources about machine learning, <a href="http://introtodeeplearning.com/">MIT Deep Learning 6.S191 (introtodeeplearning.com)</a>. The lecturer is Alexander Amini and Ava Soleimany. The lecture is excellent as expected from MIT. I learn a few fundamental calculus but also in the appliance of machine learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FhlLDO6UWmTQOLHwlBerYA.jpeg" /></figure><p>Then, I watch TensorFlow which is also a great channel for beginners. The title is Intro to Machine Learning (ML Zero to Hero). There are 4 parts and you can easily understand what he said.</p><p><a href="https://www.youtube.com/watch?v=KNAWp2S3w94&amp;t=266s">https://www.youtube.com/watch?v=KNAWp2S3w94</a></p><p>After watching and learning from other sources as well, I try my first analysis in Irish Dataset which you can download here <a href="https://www.kaggle.com/arshid/iris-flower-dataset/version/1">https://www.kaggle.com/arshid/iris-flower-dataset/version/1</a>. Actually, it is the best data to begin machine learning outside of TensorFlow prebuild data.</p><p>What you need to know in machine learning the flow, begins with</p><ol><li>What do you want from the data? Classification? Prediction? or others?</li><li>Understanding the data? What type of data it has? <br>If tabular, what are the fields it has and is there null data? If images, is it black and white or RGB? Are there any corrupt files?</li><li>For tabular data, if you find null, do you want to delete or do the interpolation by yourself? Is it important or not? Is your data contain time series? Because time-series data has a different approach so be careful</li><li>Do some cleansing or preprocessing data</li><li>Split the data for testing and training</li><li>Create a proven model, you can google it</li><li>Create your own model, this is a hassle part because it is trial-errors</li><li>Plot your loss and var_loss</li><li>Do the prediction from testing data</li><li>Plot your prediction data and training data in the same graphic. The purpose is to find the data is already meet our requirement or not.</li><li>Save the model if you are confident with the model. If not, repeat step-7</li></ol><p>This is the summary based on my experiences after 3 months of studying. Of course, there is still a lot of room for improvement. Feel free to message me at alexanderdan.pratama@gmail.com for this article needs to be edited or updated. The next part of is how to process the Irish dataset using TensorFlow. Happy learning all.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e615f395e04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make your arcpy script faster and minimal writing intermediate-data to geodatabase]]></title>
            <link>https://alexanderdan-pratama.medium.com/make-your-arcpy-script-faster-and-minimal-writing-intermediate-data-to-geodatabase-b7c0e033cafd?source=rss-4fc2ae13f564------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7c0e033cafd</guid>
            <category><![CDATA[arcgis]]></category>
            <category><![CDATA[arcpy]]></category>
            <category><![CDATA[faste]]></category>
            <category><![CDATA[in-memory]]></category>
            <dc:creator><![CDATA[Alexander Daniel Pratama]]></dc:creator>
            <pubDate>Sun, 07 Feb 2021 15:54:52 GMT</pubDate>
            <atom:updated>2021-02-07T15:54:52.483Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HDk2SZByIHQrU8oR" /><figcaption>Faster and Faster, Photo by <a href="https://unsplash.com/@chanderr?utm_source=medium&amp;utm_medium=referral">Chander R</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As a GIS specialist, I was wondering how to save an output of geoprocessing tools as a memory not as a feature class or object that hard-coded in a harddisk i.e. file geodatabase. This is an interesting topic, since some of my collegues still thinking about it.</p><p>So, I found in Esri documentation about saving data to the memory instead of shapefile or feature class. Actually it is very simple. It uses only os library. The full syntax is <strong>os.path.join(“in_memory”, “name_of_the_feature”)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2BE09xzPeAzwO8HoH9_NCg.png" /></figure><p>As you can see in the picture above, the output of the feature will be saved as a memory in during the process.</p><p>You may wonder why is this matter. This method is very effective when we create a geoprocessing services. We do not need all the intermediate data to be stored either in the enterprise geodatabase or file-geodatabase. This intermediate data is only be used if there is a process that required them to do next analyses.</p><h3><strong>However, there are also some drawbacks using this method.</strong></h3><p>This method are not likely to cover all spatial analyses. I have tried some spatial analyses with the output in_memory method. The drawbacks are</p><ol><li>It cannot do selection spatial analyses tool. Select by attribute or select by location. If you want to select attribute or select by location, you must create the feature class first.</li><li>In_memory method cannot save feature dataset such as Network Dataset, Topology, Geometric Network, etc. It also applies to the spatial analyses depend on the dataset. You must create the feature class first.</li></ol><p>Overall, this method is very usefull. In the normal script of a project where I always saved intermediate table, it takes about 5–10 minutes. However, when I used in_memory, the process cuts to 80–95% which is about 1–3 minutes. Now that is how you make your script simple and minimalist output.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7c0e033cafd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Arcpy Powerful Python in ArcGIS]]></title>
            <link>https://alexanderdan-pratama.medium.com/arcpy-powerful-python-in-arcgis-b0cd3dfa7071?source=rss-4fc2ae13f564------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0cd3dfa7071</guid>
            <category><![CDATA[esri]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[management]]></category>
            <category><![CDATA[crud]]></category>
            <dc:creator><![CDATA[Alexander Daniel Pratama]]></dc:creator>
            <pubDate>Fri, 01 Jan 2021 16:24:13 GMT</pubDate>
            <atom:updated>2026-11-19T23:29:25.240Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to CRUD in ArcGIS using GIS Data (Feature class or Shapefile)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xkATyVF_MUvBeeAHOZ56MQ.jpeg" /><figcaption>source: esri.com</figcaption></figure><p>It has been almost 5 years, I work with ArcGIS Desktop one of Esri Products. From editing to design data in enterprise geodatabase, and geoprocessing toolbox to model builder. Esri cares their customers by creating an end-end solution without have to worry of how the process. However there is a time we as GIS Engineer or Specialist have to go back to the fundamental of how to do a CRUD (Create, Read, Update, and Delete)</p><p>GIS cannot be separated with the data. I always told my clients, GIS Data is special. It is different than the other data you have seen before. The data has <strong><em>image </em></strong>(Geometry) and <strong>information </strong>(tabular). The geometry classified into three main classes: Point, Polyline or Line in short, and Polygon (Area). This geometry is populated in Shapes&#39;<strong> </strong>attribute field of a shapefile.</p><p>If the data is a point shaped, it cannot be populated with polyline. This also applies to the other geometries as well. Point for point, Polyline for polyline, and Polygon for polygon, alongside with their information or attributes.</p><h3>Fundamentals of GIS Data</h3><p>The create a shape’s attribute field it has to do a fixated process. The simplest is point where the coordinates (x,y) value is converted to a point.class. However Polyline and Polygon has a different approach. The list of of coordinates in the polyline and polygon must be converted to a list of point.class. Next the point.class converts to an array. In the final move, the array converts to a geometry object either it is Polyline where the first coordinate not equal to last coordinate or Polygon where the first coordinate equal to last coordinate</p><p>In this article, it will show you how to do CRUD, create, read, update and delete the data in the table of feature class or shapefile</p><h3><strong>arcpy.da.InsertCursor (Create)</strong></h3><p>To create a data, first we must create a tuple. GIS data uses tuple-data sequence because shape’s attribute field is immutable. To insert a data, first we need a feature class or a shapefile. At the minimum, the attribute fields are <strong>OID</strong> and <strong>SHAPE. </strong>There are going to be shown two examples: point, and polyline.</p><p>First we need to set up the feature class or shapefile address path, and create a dummy list of tuple. Then we set up the connection to the geodatabase table using <strong><em>arcpy.da.InsertCursor</em></strong>.<strong><em> </em></strong>The next line is using for-iteration to insert the data per index of the list</p><pre>import arcpy<br><br># set up geodatabase path and attribute fields<br>gdb_path = &#39;E:/AlexProject/medium_stories/medium.gdb/sample_arcpypoint&#39;<br>fields = [&#39;Name&#39;, &#39;Address&#39;, &#39;SHAPE@&#39;]<br><br># set up sample data, PLEASE BE WARNED, ...<br># ... the data have to base same sequnce in the fields variable before<br>list_tuple = [(&#39;Alex&#39;, &#39;Address Sample 1&#39;, arcpy.Point(1,1)),<br>              (&#39;Daniel&#39;, &#39;Address Sample 2&#39;, arcpy.Point(2,1))]<br><br># set up the connection the gdb or shapefile to insert data ...<br># ... to the table of feature class or shapefile<br>cursor_point = arcpy.da.InsertCursor(gdb_path, fields)<br>for i in range(len(list_tuple)):<br>    # get the data by index of the list<br>    data = list_tuple[i]<br>    # input the data to the table<br>    cursor_point.insertRow(data)<br><br># DO THIS DEL to delete the connection<br>del cursor_point</pre><p>For polyline the fundamental is same, <strong>but </strong>to create a polyline from a coordinate they need to be created as an array first with <strong>arcpy.Array</strong>. Then, the array is converted to a line with <strong>arcpy.Polyline</strong></p><pre># set up geodatabase path and attribute fields<br>gdb_path = &#39;E:/AlexProject/medium_stories/medium.gdb/sample_arcpypolyline&#39;<br>fields = [&#39;streetname&#39;, &#39;SHAPE@&#39;]<br><br># set up sample data, PLEASE BE WARNED, ...<br># ... the data have to base same sequnce in the fields variable before<br>list_tuple = [(&#39;Apple street&#39;, arcpy.Polyline(arcpy.Array(arcpy.Point(1,1), arcpy.point(2,1)))),<br>              (&#39;Orange street&#39;, arcpy.Polyline(arcpy.Array(arcpy.Point(2,1), arcpy.Point(2,1))))]<br><br># set up the connection the gdb or shapefile to insert data ...<br># ... to the table of feature class or shapefile<br>cursor_line = arcpy.da.InsertCursor(gdb_path, fields)<br>for i in range(len(list_tuple)):<br>    # get the data by index of the list<br>    data = list_tuple[i]<br>    # input the data to the table<br>    cursor_line.insertRow(data)<br><br># DO THIS DEL to delete the connection<br>del cursor_line</pre><p>In case of polygon data is also similar to polyline. However there is a tight rule in polygon. Polygon first coordinate must close the last coordinate which means the first coordinate and last coordinate have to be exact 100%. The last one is after using arcpy.Array, they must be converted to polygon using <strong>arcpy.Polygon</strong></p><h3>arcpy.da.SearchCursor (Read)</h3><p>This command is very powerful when it combines with itteration command i.e. for-. Note, since OID is not a ‘true’ index of the table, it need to define the very first index as variable equal as zero. Then, to open up the connection to the feature class or shapefile use arcpy.da.SearchCursor</p><p>When accesing with the iteration command, <strong>the row in the table is defined as geometry object</strong>. Thus, it has to be <strong>parsed</strong> by accessing the attribute field column index that has the same sequences as the list of fields</p><pre>import arcpy<br><br># set up geodatabase path and attribute fields<br>gdb_path = &#39;E:/AlexProject/medium_stories/medium.gdb/sample_arcpypoint&#39;<br>fields = [&#39;Name&#39;, &#39;Address&#39;, &#39;SHAPE@&#39;]<br><br># set up the index as zero since the fc or shp is a list of tuple<br>list_tuple = []<br>i = 0<br>with arcpy.da.SearchCursor(fc_source, fields) as cursor_point:<br>    for row_source in cursor_source:<br>        # access the row by the index<br>        i = i+1<br>        # access the geometry object class<br>        point_source = cursor_source<br>        # create a tupple from the geometry object class. Note the sequence ...<br>        # ... must be similar to the fields respectively<br>        row_value = (point_source[0], point_source[1], point_source[2])<br>        list_tuple.append(row_value)<br>        print (row_value)</pre><p>You may wonder why in the script do not use del cursor_source. It is because in the script there is <strong>with — as </strong>command. Outside the command, the connection will be deleted automatically</p><h3>arcpy.da.UpdateCursor (Update)</h3><p>Update the data is almost no different than read the data. The only different is there is a write activity in the select row. To update the data there must be a conditional statement (if-else). The if-else must accessing the field index which has similar sequence in the fields variable. After that, return the value by writing the data using <strong>.updateRow(data)</strong></p><pre>import arcpy<br><br># set up geodatabase path and attribute fields<br>gdb_path = &#39;E:/AlexProject/medium_stories/medium.gdb/sample_arcpypoint&#39;<br>fields = [&#39;point_id&#39;, &#39;type&#39;]<br><br># set up the connection the feature class or shapefile<br>with arcpy.da.UpdateCursor(fc, fields_alert) as cursor_point:<br>    for row in cursor_point:<br>        if row[0] is None:<br>            pass<br>        elif row[0] == &#39;1&#39; :<br>            row[1] = &#39;House&#39;<br>        elif row[0] == &#39;2&#39; :<br>            row[1] = &#39;Local shop&#39;<br><br>        # return update the column of type<br>        cursor_point.updateRow(row)</pre><h3>Delete</h3><p>Deleting a row is very simple. You need to reuse update cursor which will select based on some conditions first.</p><pre>import arcpy<br><br># set up geodatabase path and attribute fields<br>gdb_path = &#39;E:/AlexProject/medium_stories/medium.gdb/sample_arcpypoint&#39;<br>fields = [&#39;point_id&#39;, &#39;type&#39;]<br><br># set up the connection the feature class or shapefile<br>with arcpy.da.UpdateCursor(fc, fields_alert) as cursor_point:<br>    for row in cursor_point:<br>        if row[0] is None:<br>            pass<br>        elif row[0] == &#39;1&#39; :<br>            cursor_point.deleteRow(row)<br>        <br>        </pre><p>That is all how to a CRUD. This article aims to simplify the explanation from Esri documentation. With the fundamentals of CRUD, it will bring you further to do an advanced spatial analysis. You can also elaborate it with pandas dataframe.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0cd3dfa7071" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Converting XML Coordinate Polygon to GIS Coordinate Polygon with Python]]></title>
            <link>https://alexanderdan-pratama.medium.com/converting-xml-coordinate-polygon-to-gis-coordinate-polygon-with-python-7247048ea5f6?source=rss-4fc2ae13f564------2</link>
            <guid isPermaLink="false">https://medium.com/p/7247048ea5f6</guid>
            <category><![CDATA[conversion]]></category>
            <category><![CDATA[coordinate-systems]]></category>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[xml]]></category>
            <dc:creator><![CDATA[Alexander Daniel Pratama]]></dc:creator>
            <pubDate>Thu, 29 Oct 2020 09:14:15 GMT</pubDate>
            <atom:updated>2021-01-01T14:43:46.241Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BSA9-y4tPEcY48i3tDizww.jpeg" /><figcaption>source: <a href="https://www.freepik.com/vectors/background&#39;">https://www.freepik.com/vectors/background</a>, by rawpixel.com</figcaption></figure><p>First of all, have you ever wondered how exactly coordinate works in GIS? How is it different than XML format? Why do I have to do it? The first question was answered when I was a 3rd year college student, but the last two were just answered recently when I finished a project.</p><p>The project I did before, there were a lot of improvisation. I learn a lot about python and how to make a backend-program full with python. No JS, C, C++, just Python. That was a great experience anyway.</p><p>So, back to the the question how is it related to my experience. It starts on the base concept of GIS in the coordinate format. GIS uses a ring of pair coordinate system which is widely known are xy (projected system) or lat-long (global system).</p><p>The coordinate format for each type GIS data <br>1. Point (X1Y1)<br>2. Polyline/ Line [[X1,Y1],[X2,Y2],…,[Xn,Yn])<br>3. Polygon/Area ([[[X1,Y1],[X2,Y2],[X3,Y3],…,[Xn,Yn],[X1,Y1]]])</p><p>As you can see from the concept, the polygon no matter how many points or vertexes created it will go back to the first coordinate.</p><p>This format is somehow different in the XML system. If you carefully look in the sample below, you will see the different in the first element and the last element:</p><p>-6.236125,106.872253 -6.252507,106.931992 -6.242951,106.952591 -6.231347,106.953964 -6.214965,106.940918 -6.208821,106.920319 -6.221108,106.87912 -6.236125,106.872253.</p><p>I actually need a month to understand the sample since I don’t know what is the format XML used. In short, it is start with Y1,X2 Y2,X3 Y3,…,Xn Yn,X1 Y1, X1. You see the different actually not really much only in the start-end of the list. AND! You must notice in the comma part it is not separated by space. The space is only inside the pair system.</p><p>Thus we are going to do is to change the XML Format to GIS Format.</p><p><strong>First, we are going to make a variable from the STRING coordinate above,</strong><br><strong><em>coordinate_xml</em></strong> = -6.236125,106.872253 -6.252507,106.931992 -6.242951,106.952591 -6.231347,106.953964 -6.214965,106.940918 -6.208821,106.920319 -6.221108,106.87912 -6.236125,106.872253</p><p><strong>Then, we divide each element in the string using string split function.</strong><br><strong><em>split_coordinate = coordinate_xml.split(‘,’)</em></strong>. This function will create a list like this [[-6.236125],[106.872253 -6.252507],[106.931992 -6.242951],…,[106.872253]]</p><p><strong>Next, we extract the first element and last element of the list and merge them into one variable</strong><br><strong><em>splitCoordinate_y = split_coordinate[0]</em></strong><br><strong><em>splitCoordinate_x = split_coordinate[-1]</em></strong><br><strong><em>firstCoordinate = ‘%s %s’%(splitCoordinate_x, splitCoordinate_y)</em></strong></p><p><strong>Finally, we replace the first and last element with the merged variable <br></strong>split_coordinate[0] = firstCoordinate<br>split_coordinate[-1] = firstCoordinate</p><p>The pre-final data you will get should be like this</p><p>[[106.872253 -6.236125],[106.872253 -6.252507],[106.931992 -6.242951],…,[106.872253 -6.236125]]</p><p>The last thing you need to do is replace the the space between XY with comma. Since it is a list we need to extract per element and convert to string to simplify the process</p><p>for i in range(len(split_coordinate)): <br>pair_coordinate = str(split_coordinate[i])<br>replaceCoordinate = pair_coordinate.replace(‘ ‘, ‘, ‘) <br>create_list_element = [replaceCoordinate] listCoordinate.append(create_list_element)</p><p>Pardon me, since the medium cannot do the indent. I will show you the whole script should be like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VYixBGLT-e9B_aX4cXCPlQ.png" /><figcaption>convertion script xml coordinate to gis coordinate</figcaption></figure><p>So that is how I create a GIS coordinate system from the XML coordinate system format.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7247048ea5f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>