Thursday, July 11, 2024

Plotting Proportional Symbol/Points Size Map in QGIS - Case study of African Teams With The Highest AFCON Medals In History

 Let look at the top 10 African countries with the highest AFCON medals and use Proportional Symbol Map to visualize them.

For this mapping task, we need the map of African and the medals table as seen below.



The updated table as the time of writing (i.e. after the 2023 AFCON) is as follow;-




Steps

(1) Get the vector map of Africa and link it to the medals table. The newer versions QGIS comes with the world map as seen above, you can extract the map of Africa from there. Use the join attribute to link the map attribute to the medal table.


(2) Create a point layer using the Centroids algorithm function. This algorithm creates a new point layer, with points representing the centroid of the geometries in an input layer. The attributes associated to each point in the output layer are the same ones associated to the original features.














Saturday, June 29, 2024

Extracting EXIF data from HEIC or HEIF image format

 According to Wikipedia, HEIC/HEIF stands for "High Efficiency Image File Format" and it is a container format for storing individual digital images and image sequences. The standard covers multimedia files that can also include other media streams, such as timed text, audio and video. 

In other words, HEIC is Apple's file extension for the HEIF file format. It is basically a replacement for JPEG (Joint Photographic Experts Group) image format. JPEG is pretty aged and lacks new advances in compression, so there is need for better option. This lead Apple to adopt a standard for HEIC in 2015 to replace JPEG. So in iOS 11, HEIC was introduced and in High Sierra on the Mac.


The HEIC image file format can contains series of images and it also contains good number of textual information (EXIF metadata - Exchangeable Image File Format) embedded in it such the GPS information when the picture was taken.

In this post, I will share how we can extract the GPS information from HEIC image using a python script. The script was adopted from this stackoverflow question "How to extract GPS location from HEIC files" and it is as follow:-

import pandas as pd
from PIL import Image
from pillow_heif import register_heif_opener

def get_exif(filename):
    image = Image.open(filename)
    image.verify()
    return image.getexif().get_ifd(0x8825)


def get_geotagging(exif):
    geo_tagging_info = {}
    if not exif:
        raise ValueError("No EXIF metadata found")
    else:
        gps_keys = ['GPSVersionID', 'GPSLatitudeRef', 'GPSLatitude', 'GPSLongitudeRef', 'GPSLongitude',
                    'GPSAltitudeRef', 'GPSAltitude', 'GPSTimeStamp', 'GPSSatellites', 'GPSStatus', 'GPSMeasureMode',
                    'GPSDOP', 'GPSSpeedRef', 'GPSSpeed', 'GPSTrackRef', 'GPSTrack', 'GPSImgDirectionRef',
                    'GPSImgDirection', 'GPSMapDatum', 'GPSDestLatitudeRef', 'GPSDestLatitude', 'GPSDestLongitudeRef',
                    'GPSDestLongitude', 'GPSDestBearingRef', 'GPSDestBearing', 'GPSDestDistanceRef', 'GPSDestDistance',
                    'GPSProcessingMethod', 'GPSAreaInformation', 'GPSDateStamp', 'GPSDifferential']

        for k, v in exif.items():
            try:
                geo_tagging_info[gps_keys[k]] = str(v)
            except IndexError:
                pass
        return geo_tagging_info


register_heif_opener()

my_image = 'IMG_8362.heic'
image_info = get_exif(my_image)
results = get_geotagging(image_info)

print(results)


To run the functions above on multiple images and save the result into a pandas dataframe, the resulting code will look like below:-

dataList = []
fname = []
for heic_img in folder_loc:
    print('Processing...', heic_img)
    fname.append(heic_img.split('\\')[-1])
    
    image_info = get_exif(heic_img)
    results = get_geotagging(image_info)
    
    dataList.append(results)
    
print('Done...')

df_heic = pd.DataFrame(dataList)

df_heic['File Name'] = fname
df_heic.to_excel('DataList.xlsx', index=False)
.
You should now have table that contain the GPS information as seen above.

If you look closely at the Latitude and Longitude columns, the values are not really in a familiar formats of either decimal degrees or degree munities and seconds, so we have to do some extra data cleaning to get into the right format.

For example, the first latitude is "(24.0, 50.0, 28.13)", but that isn't useful to most GIS software. It should either be in Decimal Degrees like this "24.841147222" or in Degree Munities and Seconds like this "24° 50' 28.13" ". The cleaning code should look like this:- 

heic_lat = '(24.0, 50.0, 28.13)'
new_lat = heic_lat.replace('(', '').replace(')', '').split(', ')

# Convert to DMS
new_lat_DMS = new_lat[0].replace('.0', '') +'° '+ new_lat[1].replace('.0', '') +"' "+ new_lat[2] +'" '
print(new_lat_DMS)

# Convert to DD
new_lat_DD = int(float(new_lat[0])) + int(float(new_lat[1]))/60 + float(new_lat[2])/3600
print(new_lat_DD)

That is it!

Monday, June 24, 2024

Smoothing Contour Line/Polyline in QGIS and AutoCAD

 Often we work with datasets that needs to be represented by continuous lines/polylines such as contour lines. If there is no smoothing between a the line nodes (vertices), the visual appearance looks questionable. Let see how we can smooth lines/polylines in both QGIS and AutoCAD.


QGIS

In QGIS, you need to set the 'Symbol Layer Type' >> 'Geometry Generator' to: smooth($geometry, 5).

This will smooth the line/polyline  nodes (vertices).





See before and after applying the 'smooth($geometry, 5)' function below:-


See after applying the 'smooth($geometry, 5)' function below:-




AutoCAD

There are a couple of factors that could cause a lines/polylines to have angular or pointed nodes (vertices). One could be due to the resolution of the drawing, if that is the case then we can adjust the smoothing option to the highest (20000) from the OPTION dialog window.


Another way to smooth the lines is by using the PEDIT command and select FIT.


That is it!

Friday, May 10, 2024

How install QGIS on Anaconda Python Distribution

  There are some QGIS plugins that require special python setup dependencies before they can be installed. One of such plugin is the PCRaster tools.

In this post we will create a new virtual python environment using conda (conda allows you to create separate environments, each containing their own files, packages, and package dependencies. The contents of each environment do not interact with each other. conda is an open source tool that comes with Anaconda, and it functions as both a package manager and an environment manager).

Then we will install QGIS on the new environment, after which we shall install the PCRaster plugin from the plugin manager.

If you don't know what Anaconda and PCRaster are, here is a short note on them.

  • Anaconda is a distribution of the Python and R programming languages for scientific computing, that aims to simplify package management and deployment.
  • PCRaster is a collection of software targeted at the development and deployment of spatio-temporal environmental models.
Here are the steps to follow:-

Step 1: Install anaconda and run the anaconda prompt.

Step 2: Enter the following line.

conda create --name pcrasterENV -c conda-forge qgis pcraster

This will install qgis and pcraster in the created environment named pcrasterENV


Step 3: To launch qgis, activate the environment by entering this;-

conda activate pcrasterENV


Step 4: Now type qgis this will launch a new instance of QGIS with all the required packages installed.


Note: This process usually takes some time, so don't panic when you see packages that looks like below been installed.

(base) C:\Users\`HYJ7>conda create --name pcrasterENV -c conda-forge qgis pcraster
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 22.9.0
  latest version: 24.4.0

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: C:\Users\`HYJ7\.conda\envs\pcrasterENV

  added / updated specs:
    - pcraster
    - qgis


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    aws-c-auth-0.7.18          |       h4813612_3          98 KB  conda-forge
    aws-c-cal-0.6.12           |       hc83774a_0          45 KB  conda-forge
    aws-c-common-0.9.17        |       h2466b09_0         219 KB  conda-forge
    aws-c-compression-0.2.18   |       hc83774a_4          22 KB  conda-forge
    aws-c-event-stream-0.4.2   |       h99f05a9_9          53 KB  conda-forge
    aws-c-http-0.8.1           |      h23b3c28_12         177 KB  conda-forge
    aws-c-io-0.14.7            |       hebaacdb_9         156 KB  conda-forge
    aws-c-mqtt-0.10.4          |       h503f92b_1         155 KB  conda-forge
    aws-c-s3-0.5.7             |       h7ba16a0_4         102 KB  conda-forge
    aws-c-sdkutils-0.1.16      |       hc83774a_0          52 KB  conda-forge
    aws-checksums-0.1.18       |       hc83774a_4          51 KB  conda-forge
    aws-crt-cpp-0.26.8         |       hf33e8a9_6         243 KB  conda-forge
    aws-sdk-cpp-1.11.267       |       h12f3f85_8         3.3 MB  conda-forge
    azure-core-cpp-1.11.1      |       h249a519_1         474 KB  conda-forge
    azure-identity-cpp-1.6.0   |       h91493d7_1         353 KB  conda-forge
    azure-storage-blobs-cpp-12.10.0|       h91493d7_1         939 KB  conda-forge
    azure-storage-common-cpp-12.5.0|       h91493d7_4         219 KB  conda-forge
    blas-2.122                 |              mkl          17 KB  conda-forge
    blas-devel-3.9.0           |     22_win64_mkl          16 KB  conda-forge
    blosc-1.21.5               |       hbd69f2e_1          49 KB  conda-forge
    brotli-python-1.1.0        |  py312h53d5487_1         315 KB  conda-forge
    bzip2-1.0.8                |       hcfcfb64_5         122 KB  conda-forge
    c-ares-1.28.1              |       hcfcfb64_0         155 KB  conda-forge
    ca-certificates-2024.2.2   |       h56e8100_0         152 KB  conda-forge
    cairo-1.18.0               |       h1fef639_0         1.4 MB  conda-forge
    ceres-solver-2.2.0         |       h0d88682_3         879 KB  conda-forge
    certifi-2024.2.2           |     pyhd8ed1ab_0         157 KB  conda-forge
    cfitsio-4.4.0              |       h9b0cee5_1         591 KB  conda-forge
    charset-normalizer-3.3.2   |     pyhd8ed1ab_0          46 KB  conda-forge
    coverage-7.5.1             |  py312h4389bb4_0         367 KB  conda-forge
    curl-8.7.1                 |       hd5e4a3a_0         150 KB  conda-forge
    dataclasses-0.8            |     pyhc8e2a94_3          10 KB  conda-forge
    draco-1.5.7                |       h181d51b_0         2.3 MB  conda-forge
    eigen-3.4.0                |       h91493d7_0         1.0 MB  conda-forge
    exiv2-0.28.2               |       hadc2d18_0         892 KB  conda-forge
    expat-2.6.2                |       h63175ca_0         224 KB  conda-forge
    fmt-10.2.1                 |       h181d51b_0         181 KB  conda-forge
    font-ttf-ubuntu-0.83       |       h77eed37_2         1.5 MB  conda-forge
    fontconfig-2.14.2          |       hbde0cde_0         186 KB  conda-forge
    freetype-2.12.1            |       hdaf720e_2         498 KB  conda-forge
    freexl-2.0.0               |       h8276f4a_0          76 KB  conda-forge
    future-1.0.0               |     pyhd8ed1ab_0         356 KB  conda-forge
    gdal-3.8.5                 |  py312hea5013e_2         1.5 MB  conda-forge
    geos-3.12.1                |       h1537add_0         1.5 MB  conda-forge
    geotiff-1.7.1              |      hed9d743_16         123 KB  conda-forge
    gflags-2.2.2               |    ha925a31_1004          80 KB  conda-forge
    glib-2.80.1                |       h0df6a38_0         559 KB  conda-forge
    glib-tools-2.80.1          |       h2f9d560_0          93 KB  conda-forge
    glog-0.7.0                 |       h9cd36e5_0         111 KB  conda-forge
    gsl-2.7                    |       hdfb1a43_0         1.7 MB  conda-forge
    gst-plugins-base-1.24.3    |       hba88be7_0         2.0 MB  conda-forge
    gstreamer-1.24.3           |       h5006eae_0         1.9 MB  conda-forge
    hdf4-4.2.15                |       h5557f11_7         761 KB  conda-forge
    hdf5-1.14.3                |nompi_h73e8ff5_101         1.9 MB  conda-forge
    httplib2-0.22.0            |     pyhd8ed1ab_0          93 KB  conda-forge
    icu-73.2                   |       h63175ca_0        12.8 MB  conda-forge
    idna-3.7                   |     pyhd8ed1ab_0          51 KB  conda-forge
    intel-openmp-2024.1.0      |     h57928b3_965         1.5 MB  conda-forge
    jinja2-3.1.4               |     pyhd8ed1ab_0         109 KB  conda-forge
    kealib-1.5.3               |       hd248416_0         130 KB  conda-forge
    khronos-opencl-icd-loader-2023.04.17|       h64bf75a_0          84 KB  conda-forge
    krb5-1.21.2                |       heb0366b_0         694 KB  conda-forge
    laz-perf-3.4.0             |       h91493d7_0         102 KB  conda-forge
    lcms2-2.16                 |       h67d730c_0         496 KB  conda-forge
    lerc-4.0.0                 |       h63175ca_0         190 KB  conda-forge
    libabseil-20240116.2       | cxx17_h63175ca_0         1.7 MB  conda-forge
    libaec-1.1.3               |       h63175ca_0          32 KB  conda-forge
    libarchive-3.7.2           |       h313118b_1         942 KB  conda-forge
    libblas-3.9.0              |     22_win64_mkl         4.9 MB  conda-forge
    libboost-1.84.0            |       hcc118f5_2         2.3 MB  conda-forge
    libboost-headers-1.84.0    |       h57928b3_2        13.2 MB  conda-forge
    libbrotlicommon-1.1.0      |       hcfcfb64_1          69 KB  conda-forge
    libbrotlidec-1.1.0         |       hcfcfb64_1          32 KB  conda-forge
    libbrotlienc-1.1.0         |       hcfcfb64_1         241 KB  conda-forge
    libcblas-3.9.0             |     22_win64_mkl         5.0 MB  conda-forge
    libclang13-18.1.5          |default_hf64faad_0        24.2 MB  conda-forge
    libcrc32c-1.1.2            |       h0e60522_0          25 KB  conda-forge
    libcurl-8.7.1              |       hd5e4a3a_0         323 KB  conda-forge
    libdeflate-1.20            |       hcfcfb64_0         152 KB  conda-forge
    libexpat-2.6.2             |       h63175ca_0         136 KB  conda-forge
    libgdal-3.8.5              |       hfb9f81c_2         8.2 MB  conda-forge
    libglib-2.80.1             |       h0df6a38_0         3.6 MB  conda-forge
    libgoogle-cloud-2.23.0     |       h68df31e_1          14 KB  conda-forge
    libgoogle-cloud-storage-2.23.0|       hb581fae_1          14 KB  conda-forge
    libgrpc-1.62.2             |       h5273850_0        15.4 MB  conda-forge
    libhwloc-2.10.0            |default_h2fffb23_1000         2.3 MB  conda-forge
    libiconv-1.17              |       hcfcfb64_2         621 KB  conda-forge
    libintl-0.22.5             |       h5728263_2          94 KB  conda-forge
    libintl-devel-0.22.5       |       h5728263_2          40 KB  conda-forge
    libjpeg-turbo-3.0.0        |       hcfcfb64_1         804 KB  conda-forge
    libkml-1.3.0               |    haf3e7a6_1018         1.7 MB  conda-forge
    liblapack-3.9.0            |     22_win64_mkl         4.9 MB  conda-forge
    liblapacke-3.9.0           |     22_win64_mkl         4.9 MB  conda-forge
    libnetcdf-4.9.2            |nompi_h07c049d_113         610 KB  conda-forge
    libogg-1.3.4               |       h8ffe710_1          34 KB  conda-forge
    libpng-1.6.43              |       h19919ed_0         339 KB  conda-forge
    libpq-16.2                 |       hdb24f17_1         3.5 MB  conda-forge
    libprotobuf-4.25.3         |       h503648d_0         5.4 MB  conda-forge
    libre2-11-2023.09.01       |       hf8d8778_2         251 KB  conda-forge
    librttopo-1.1.0            |      h94c4f80_15         393 KB  conda-forge
    libspatialindex-1.9.3      |       h39d44d4_4         437 KB  conda-forge
    libspatialite-5.1.0        |       hf13de1f_5         8.0 MB  conda-forge
    libsqlite-3.45.3           |       hcfcfb64_0         850 KB  conda-forge
    libssh2-1.11.0             |       h7dfc565_0         261 KB  conda-forge
    libtiff-4.6.0              |       hddb2be6_3         769 KB  conda-forge
    libvorbis-1.3.7            |       h0e60522_0         267 KB  conda-forge
    libwebp-1.4.0              |       h2466b09_0          69 KB  conda-forge
    libwebp-base-1.4.0         |       hcfcfb64_0         268 KB  conda-forge
    libxml2-2.12.6             |       hc3477c8_2         1.5 MB  conda-forge
    libxslt-1.1.39             |       h3df6e99_0         409 KB  conda-forge
    libzip-1.10.1              |       h1d365fa_3         143 KB  conda-forge
    libzlib-1.2.13             |       hcfcfb64_5          54 KB  conda-forge
    lxml-5.2.1                 |  py312h56c7e3b_0         1.0 MB  conda-forge
    lz4-c-1.9.4                |       hcfcfb64_0         131 KB  conda-forge
    lzo-2.10                   |    hcfcfb64_1001         139 KB  conda-forge
    m2w64-gcc-libgfortran-5.3.0|                6         342 KB  conda-forge
    m2w64-gcc-libs-5.3.0       |                7         520 KB  conda-forge
    m2w64-gcc-libs-core-5.3.0  |                7         214 KB  conda-forge
    m2w64-gmp-6.1.0            |                2         726 KB  conda-forge
    m2w64-libwinpthread-git-5.0.0.4634.697f757|                2          31 KB  conda-forge
    markupsafe-2.1.5           |  py312he70551f_0          28 KB  conda-forge
    minizip-4.0.5              |       h5bed578_0          83 KB  conda-forge
    mkl-2024.1.0               |     h66d3029_692       104.4 MB  conda-forge
    mkl-devel-2024.1.0         |     h57928b3_692         5.0 MB  conda-forge
    mkl-include-2024.1.0       |     h66d3029_692         768 KB  conda-forge
    mock-5.1.0                 |     pyhd8ed1ab_0          33 KB  conda-forge
    msys2-conda-epoch-20160418 |                1           3 KB  conda-forge
    nitro-2.7.dev8             |       h1537add_0         524 KB  conda-forge
    nose2-0.9.2                |             py_0          91 KB  conda-forge
    numpy-1.26.4               |  py312h8753938_0         6.2 MB  conda-forge
    openjpeg-2.5.2             |       h3d672ee_0         232 KB  conda-forge
    openssl-3.3.0              |       hcfcfb64_0         8.0 MB  conda-forge
    owslib-0.30.0              |     pyhd8ed1ab_0         136 KB  conda-forge
    packaging-24.0             |     pyhd8ed1ab_0          49 KB  conda-forge
    pcraster-4.4.1             |  py312hc016867_4         5.0 MB  conda-forge
    pcre2-10.43                |       h17e33f8_0         799 KB  conda-forge
    pdal-2.7.1                 |       h78909d1_6         2.8 MB  conda-forge
    pip-24.0                   |     pyhd8ed1ab_0         1.3 MB  conda-forge
    pixman-0.43.4              |       h63175ca_0         451 KB  conda-forge
    plotly-5.22.0              |     pyhd8ed1ab_0         5.1 MB  conda-forge
    ply-3.11                   |     pyhd8ed1ab_2          48 KB  conda-forge
    poppler-24.04.0            |       h747fd5a_0         2.2 MB  conda-forge
    postgresql-16.2            |       h94c9ec1_1        17.8 MB  conda-forge
    proj-9.4.0                 |       he13c7e8_1         2.6 MB  conda-forge
    psycopg2-2.9.9             |  py312hf50bb3c_0         167 KB  conda-forge
    pthreads-win32-2.9.1       |       hfa6e2cd_3         141 KB  conda-forge
    pygments-2.18.0            |     pyhd8ed1ab_0         859 KB  conda-forge
    pyparsing-3.1.2            |     pyhd8ed1ab_0          87 KB  conda-forge
    pyproj-3.6.1               |  py312h616b599_6         708 KB  conda-forge
    pyqt-5.15.9                |  py312he09f080_5         3.7 MB  conda-forge
    pyqt5-sip-12.12.2          |  py312h53d5487_5          78 KB  conda-forge
    pyqtwebkit-5.15.9          |  py312hca0710b_2         121 KB  conda-forge
    pysocks-1.7.1              |     pyh0701188_6          19 KB  conda-forge
    python-3.12.3              |h2628c8c_0_cpython        15.4 MB  conda-forge
    python-dateutil-2.9.0      |     pyhd8ed1ab_0         218 KB  conda-forge
    python_abi-3.12            |          4_cp312           7 KB  conda-forge
    pytz-2024.1                |     pyhd8ed1ab_0         184 KB  conda-forge
    pyyaml-6.0.1               |  py312he70551f_1         164 KB  conda-forge
    qca-2.3.8                  |       h2624d1c_0         723 KB  conda-forge
    qgis-3.36.2                |  py312hdab107f_0        69.4 MB  conda-forge
    qjson-0.9.0                |    h04a78d6_1009          54 KB  conda-forge
    qscintilla2-2.14.1         |  py312hca0710b_0         1.2 MB  conda-forge
    qt-main-5.15.8             |      hcef0176_21        57.0 MB  conda-forge
    qtkeychain-0.14.3          |       hf9d22a5_0          33 KB  conda-forge
    qtwebkit-5.212             |      h4d8ddc9_16        10.5 MB  conda-forge
    qwt-6.2.0                  |       h07be427_6         3.4 MB  conda-forge
    re2-2023.09.01             |       hd3b24a8_2         202 KB  conda-forge
    requests-2.31.0            |     pyhd8ed1ab_0          55 KB  conda-forge
    setuptools-69.5.1          |     pyhd8ed1ab_0         490 KB  conda-forge
    sip-6.7.12                 |  py312h53d5487_0         576 KB  conda-forge
    six-1.16.0                 |     pyh6c4a22f_0          14 KB  conda-forge
    snappy-1.2.0               |       hfb803bf_1          58 KB  conda-forge
    spdlog-1.13.0              |       h64d2f7d_0         157 KB  conda-forge
    sqlite-3.45.3              |       hcfcfb64_0         852 KB  conda-forge
    tbb-2021.12.0              |       h91493d7_0         158 KB  conda-forge
    tenacity-8.3.0             |     pyhd8ed1ab_0          23 KB  conda-forge
    tiledb-2.22.0              |       h5657395_3         3.0 MB  conda-forge
    tk-8.6.13                  |       h5226925_1         3.3 MB  conda-forge
    toml-0.10.2                |     pyhd8ed1ab_0          18 KB  conda-forge
    tomli-2.0.1                |     pyhd8ed1ab_0          16 KB  conda-forge
    tzdata-2024a               |       h0c530f3_0         117 KB  conda-forge
    ucrt-10.0.22621.0          |       h57928b3_0         1.2 MB  conda-forge
    uriparser-0.9.8            |       h5a68840_0          48 KB  conda-forge
    urllib3-2.2.1              |     pyhd8ed1ab_0          92 KB  conda-forge
    vc-14.3                    |      hcf57466_18          17 KB  conda-forge
    vc14_runtime-14.38.33130   |      h82b7239_18         732 KB  conda-forge
    vs2015_runtime-14.38.33130 |      hcb4865c_18          17 KB  conda-forge
    wheel-0.43.0               |     pyhd8ed1ab_1          57 KB  conda-forge
    win_inet_pton-1.1.0        |     pyhd8ed1ab_6           8 KB  conda-forge
    xerces-c-3.2.5             |       h63175ca_0         3.4 MB  conda-forge
    xz-5.2.6                   |       h8d14728_0         213 KB  conda-forge
    yaml-0.2.5                 |       h8ffe710_2          62 KB  conda-forge
    zlib-1.2.13                |       hcfcfb64_5         105 KB  conda-forge
    zstd-1.5.6                 |       h0ea2cb4_0         341 KB  conda-forge
    ------------------------------------------------------------
                                           Total:       511.8 MB

The following NEW packages will be INSTALLED:

  aws-c-auth         conda-forge/win-64::aws-c-auth-0.7.18-h4813612_3 None
  aws-c-cal          conda-forge/win-64::aws-c-cal-0.6.12-hc83774a_0 None
  aws-c-common       conda-forge/win-64::aws-c-common-0.9.17-h2466b09_0 None
  aws-c-compression  conda-forge/win-64::aws-c-compression-0.2.18-hc83774a_4 None
  aws-c-event-stream conda-forge/win-64::aws-c-event-stream-0.4.2-h99f05a9_9 None
  aws-c-http         conda-forge/win-64::aws-c-http-0.8.1-h23b3c28_12 None
  aws-c-io           conda-forge/win-64::aws-c-io-0.14.7-hebaacdb_9 None
  aws-c-mqtt         conda-forge/win-64::aws-c-mqtt-0.10.4-h503f92b_1 None
  aws-c-s3           conda-forge/win-64::aws-c-s3-0.5.7-h7ba16a0_4 None
  aws-c-sdkutils     conda-forge/win-64::aws-c-sdkutils-0.1.16-hc83774a_0 None
  aws-checksums      conda-forge/win-64::aws-checksums-0.1.18-hc83774a_4 None
  aws-crt-cpp        conda-forge/win-64::aws-crt-cpp-0.26.8-hf33e8a9_6 None
  aws-sdk-cpp        conda-forge/win-64::aws-sdk-cpp-1.11.267-h12f3f85_8 None
  azure-core-cpp     conda-forge/win-64::azure-core-cpp-1.11.1-h249a519_1 None
  azure-identity-cpp conda-forge/win-64::azure-identity-cpp-1.6.0-h91493d7_1 None
  azure-storage-blo~ conda-forge/win-64::azure-storage-blobs-cpp-12.10.0-h91493d7_1 None
  azure-storage-com~ conda-forge/win-64::azure-storage-common-cpp-12.5.0-h91493d7_4 None
  blas               conda-forge/win-64::blas-2.122-mkl None
  blas-devel         conda-forge/win-64::blas-devel-3.9.0-22_win64_mkl None
  blosc              conda-forge/win-64::blosc-1.21.5-hbd69f2e_1 None
  brotli-python      conda-forge/win-64::brotli-python-1.1.0-py312h53d5487_1 None
  bzip2              conda-forge/win-64::bzip2-1.0.8-hcfcfb64_5 None
  c-ares             conda-forge/win-64::c-ares-1.28.1-hcfcfb64_0 None
  ca-certificates    conda-forge/win-64::ca-certificates-2024.2.2-h56e8100_0 None
  cairo              conda-forge/win-64::cairo-1.18.0-h1fef639_0 None
  ceres-solver       conda-forge/win-64::ceres-solver-2.2.0-h0d88682_3 None
  certifi            conda-forge/noarch::certifi-2024.2.2-pyhd8ed1ab_0 None
  cfitsio            conda-forge/win-64::cfitsio-4.4.0-h9b0cee5_1 None
  charset-normalizer conda-forge/noarch::charset-normalizer-3.3.2-pyhd8ed1ab_0 None
  coverage           conda-forge/win-64::coverage-7.5.1-py312h4389bb4_0 None
  curl               conda-forge/win-64::curl-8.7.1-hd5e4a3a_0 None
  dataclasses        conda-forge/noarch::dataclasses-0.8-pyhc8e2a94_3 None
  draco              conda-forge/win-64::draco-1.5.7-h181d51b_0 None
  eigen              conda-forge/win-64::eigen-3.4.0-h91493d7_0 None
  exiv2              conda-forge/win-64::exiv2-0.28.2-hadc2d18_0 None
  expat              conda-forge/win-64::expat-2.6.2-h63175ca_0 None
  fmt                conda-forge/win-64::fmt-10.2.1-h181d51b_0 None
  font-ttf-dejavu-s~ conda-forge/noarch::font-ttf-dejavu-sans-mono-2.37-hab24e00_0 None
  font-ttf-inconsol~ conda-forge/noarch::font-ttf-inconsolata-3.000-h77eed37_0 None
  font-ttf-source-c~ conda-forge/noarch::font-ttf-source-code-pro-2.038-h77eed37_0 None
  font-ttf-ubuntu    conda-forge/noarch::font-ttf-ubuntu-0.83-h77eed37_2 None
  fontconfig         conda-forge/win-64::fontconfig-2.14.2-hbde0cde_0 None
  fonts-conda-ecosy~ conda-forge/noarch::fonts-conda-ecosystem-1-0 None
  fonts-conda-forge  conda-forge/noarch::fonts-conda-forge-1-0 None
  freetype           conda-forge/win-64::freetype-2.12.1-hdaf720e_2 None
  freexl             conda-forge/win-64::freexl-2.0.0-h8276f4a_0 None
  future             conda-forge/noarch::future-1.0.0-pyhd8ed1ab_0 None
  gdal               conda-forge/win-64::gdal-3.8.5-py312hea5013e_2 None
  geos               conda-forge/win-64::geos-3.12.1-h1537add_0 None
  geotiff            conda-forge/win-64::geotiff-1.7.1-hed9d743_16 None
  gflags             conda-forge/win-64::gflags-2.2.2-ha925a31_1004 None
  glib               conda-forge/win-64::glib-2.80.1-h0df6a38_0 None
  glib-tools         conda-forge/win-64::glib-tools-2.80.1-h2f9d560_0 None
  glog               conda-forge/win-64::glog-0.7.0-h9cd36e5_0 None
  gsl                conda-forge/win-64::gsl-2.7-hdfb1a43_0 None
  gst-plugins-base   conda-forge/win-64::gst-plugins-base-1.24.3-hba88be7_0 None
  gstreamer          conda-forge/win-64::gstreamer-1.24.3-h5006eae_0 None
  hdf4               conda-forge/win-64::hdf4-4.2.15-h5557f11_7 None
  hdf5               conda-forge/win-64::hdf5-1.14.3-nompi_h73e8ff5_101 None
  httplib2           conda-forge/noarch::httplib2-0.22.0-pyhd8ed1ab_0 None
  icu                conda-forge/win-64::icu-73.2-h63175ca_0 None
  idna               conda-forge/noarch::idna-3.7-pyhd8ed1ab_0 None
  intel-openmp       conda-forge/win-64::intel-openmp-2024.1.0-h57928b3_965 None
  jinja2             conda-forge/noarch::jinja2-3.1.4-pyhd8ed1ab_0 None
  kealib             conda-forge/win-64::kealib-1.5.3-hd248416_0 None
  khronos-opencl-ic~ conda-forge/win-64::khronos-opencl-icd-loader-2023.04.17-h64bf75a_0 None
  krb5               conda-forge/win-64::krb5-1.21.2-heb0366b_0 None
  laz-perf           conda-forge/win-64::laz-perf-3.4.0-h91493d7_0 None
  lcms2              conda-forge/win-64::lcms2-2.16-h67d730c_0 None
  lerc               conda-forge/win-64::lerc-4.0.0-h63175ca_0 None
  libabseil          conda-forge/win-64::libabseil-20240116.2-cxx17_h63175ca_0 None
  libaec             conda-forge/win-64::libaec-1.1.3-h63175ca_0 None
  libarchive         conda-forge/win-64::libarchive-3.7.2-h313118b_1 None
  libblas            conda-forge/win-64::libblas-3.9.0-22_win64_mkl None
  libboost           conda-forge/win-64::libboost-1.84.0-hcc118f5_2 None
  libboost-headers   conda-forge/win-64::libboost-headers-1.84.0-h57928b3_2 None
  libbrotlicommon    conda-forge/win-64::libbrotlicommon-1.1.0-hcfcfb64_1 None
  libbrotlidec       conda-forge/win-64::libbrotlidec-1.1.0-hcfcfb64_1 None
  libbrotlienc       conda-forge/win-64::libbrotlienc-1.1.0-hcfcfb64_1 None
  libcblas           conda-forge/win-64::libcblas-3.9.0-22_win64_mkl None
  libclang13         conda-forge/win-64::libclang13-18.1.5-default_hf64faad_0 None
  libcrc32c          conda-forge/win-64::libcrc32c-1.1.2-h0e60522_0 None
  libcurl            conda-forge/win-64::libcurl-8.7.1-hd5e4a3a_0 None
  libdeflate         conda-forge/win-64::libdeflate-1.20-hcfcfb64_0 None
  libexpat           conda-forge/win-64::libexpat-2.6.2-h63175ca_0 None
  libffi             conda-forge/win-64::libffi-3.4.2-h8ffe710_5 None
  libgdal            conda-forge/win-64::libgdal-3.8.5-hfb9f81c_2 None
  libglib            conda-forge/win-64::libglib-2.80.1-h0df6a38_0 None
  libgoogle-cloud    conda-forge/win-64::libgoogle-cloud-2.23.0-h68df31e_1 None
  libgoogle-cloud-s~ conda-forge/win-64::libgoogle-cloud-storage-2.23.0-hb581fae_1 None
  libgrpc            conda-forge/win-64::libgrpc-1.62.2-h5273850_0 None
  libhwloc           conda-forge/win-64::libhwloc-2.10.0-default_h2fffb23_1000 None
  libiconv           conda-forge/win-64::libiconv-1.17-hcfcfb64_2 None
  libintl            conda-forge/win-64::libintl-0.22.5-h5728263_2 None
  libintl-devel      conda-forge/win-64::libintl-devel-0.22.5-h5728263_2 None
  libjpeg-turbo      conda-forge/win-64::libjpeg-turbo-3.0.0-hcfcfb64_1 None
  libkml             conda-forge/win-64::libkml-1.3.0-haf3e7a6_1018 None
  liblapack          conda-forge/win-64::liblapack-3.9.0-22_win64_mkl None
  liblapacke         conda-forge/win-64::liblapacke-3.9.0-22_win64_mkl None
  libnetcdf          conda-forge/win-64::libnetcdf-4.9.2-nompi_h07c049d_113 None
  libogg             conda-forge/win-64::libogg-1.3.4-h8ffe710_1 None
  libpng             conda-forge/win-64::libpng-1.6.43-h19919ed_0 None
  libpq              conda-forge/win-64::libpq-16.2-hdb24f17_1 None
  libprotobuf        conda-forge/win-64::libprotobuf-4.25.3-h503648d_0 None
  libre2-11          conda-forge/win-64::libre2-11-2023.09.01-hf8d8778_2 None
  librttopo          conda-forge/win-64::librttopo-1.1.0-h94c4f80_15 None
  libspatialindex    conda-forge/win-64::libspatialindex-1.9.3-h39d44d4_4 None
  libspatialite      conda-forge/win-64::libspatialite-5.1.0-hf13de1f_5 None
  libsqlite          conda-forge/win-64::libsqlite-3.45.3-hcfcfb64_0 None
  libssh2            conda-forge/win-64::libssh2-1.11.0-h7dfc565_0 None
  libtiff            conda-forge/win-64::libtiff-4.6.0-hddb2be6_3 None
  libvorbis          conda-forge/win-64::libvorbis-1.3.7-h0e60522_0 None
  libwebp            conda-forge/win-64::libwebp-1.4.0-h2466b09_0 None
  libwebp-base       conda-forge/win-64::libwebp-base-1.4.0-hcfcfb64_0 None
  libxml2            conda-forge/win-64::libxml2-2.12.6-hc3477c8_2 None
  libxslt            conda-forge/win-64::libxslt-1.1.39-h3df6e99_0 None
  libzip             conda-forge/win-64::libzip-1.10.1-h1d365fa_3 None
  libzlib            conda-forge/win-64::libzlib-1.2.13-hcfcfb64_5 None
  lxml               conda-forge/win-64::lxml-5.2.1-py312h56c7e3b_0 None
  lz4-c              conda-forge/win-64::lz4-c-1.9.4-hcfcfb64_0 None
  lzo                conda-forge/win-64::lzo-2.10-hcfcfb64_1001 None
  m2w64-gcc-libgfor~ conda-forge/win-64::m2w64-gcc-libgfortran-5.3.0-6 None
  m2w64-gcc-libs     conda-forge/win-64::m2w64-gcc-libs-5.3.0-7 None
  m2w64-gcc-libs-co~ conda-forge/win-64::m2w64-gcc-libs-core-5.3.0-7 None
  m2w64-gmp          conda-forge/win-64::m2w64-gmp-6.1.0-2 None
  m2w64-libwinpthre~ conda-forge/win-64::m2w64-libwinpthread-git-5.0.0.4634.697f757-2 None
  markupsafe         conda-forge/win-64::markupsafe-2.1.5-py312he70551f_0 None
  minizip            conda-forge/win-64::minizip-4.0.5-h5bed578_0 None
  mkl                conda-forge/win-64::mkl-2024.1.0-h66d3029_692 None
  mkl-devel          conda-forge/win-64::mkl-devel-2024.1.0-h57928b3_692 None
  mkl-include        conda-forge/win-64::mkl-include-2024.1.0-h66d3029_692 None
  mock               conda-forge/noarch::mock-5.1.0-pyhd8ed1ab_0 None
  msys2-conda-epoch  conda-forge/win-64::msys2-conda-epoch-20160418-1 None
  nitro              conda-forge/win-64::nitro-2.7.dev8-h1537add_0 None
  nose2              conda-forge/noarch::nose2-0.9.2-py_0 None
  numpy              conda-forge/win-64::numpy-1.26.4-py312h8753938_0 None
  openjpeg           conda-forge/win-64::openjpeg-2.5.2-h3d672ee_0 None
  openssl            conda-forge/win-64::openssl-3.3.0-hcfcfb64_0 None
  owslib             conda-forge/noarch::owslib-0.30.0-pyhd8ed1ab_0 None
  packaging          conda-forge/noarch::packaging-24.0-pyhd8ed1ab_0 None
  pcraster           conda-forge/win-64::pcraster-4.4.1-py312hc016867_4 None
  pcre2              conda-forge/win-64::pcre2-10.43-h17e33f8_0 None
  pdal               conda-forge/win-64::pdal-2.7.1-h78909d1_6 None
  pip                conda-forge/noarch::pip-24.0-pyhd8ed1ab_0 None
  pixman             conda-forge/win-64::pixman-0.43.4-h63175ca_0 None
  plotly             conda-forge/noarch::plotly-5.22.0-pyhd8ed1ab_0 None
  ply                conda-forge/noarch::ply-3.11-pyhd8ed1ab_2 None
  poppler            conda-forge/win-64::poppler-24.04.0-h747fd5a_0 None
  poppler-data       conda-forge/noarch::poppler-data-0.4.12-hd8ed1ab_0 None
  postgresql         conda-forge/win-64::postgresql-16.2-h94c9ec1_1 None
  proj               conda-forge/win-64::proj-9.4.0-he13c7e8_1 None
  psycopg2           conda-forge/win-64::psycopg2-2.9.9-py312hf50bb3c_0 None
  pthreads-win32     conda-forge/win-64::pthreads-win32-2.9.1-hfa6e2cd_3 None
  pygments           conda-forge/noarch::pygments-2.18.0-pyhd8ed1ab_0 None
  pyparsing          conda-forge/noarch::pyparsing-3.1.2-pyhd8ed1ab_0 None
  pyproj             conda-forge/win-64::pyproj-3.6.1-py312h616b599_6 None
  pyqt               conda-forge/win-64::pyqt-5.15.9-py312he09f080_5 None
  pyqt5-sip          conda-forge/win-64::pyqt5-sip-12.12.2-py312h53d5487_5 None
  pyqtwebkit         conda-forge/win-64::pyqtwebkit-5.15.9-py312hca0710b_2 None
  pysocks            conda-forge/noarch::pysocks-1.7.1-pyh0701188_6 None
  python             conda-forge/win-64::python-3.12.3-h2628c8c_0_cpython None
  python-dateutil    conda-forge/noarch::python-dateutil-2.9.0-pyhd8ed1ab_0 None
  python_abi         conda-forge/win-64::python_abi-3.12-4_cp312 None
  pytz               conda-forge/noarch::pytz-2024.1-pyhd8ed1ab_0 None
  pyyaml             conda-forge/win-64::pyyaml-6.0.1-py312he70551f_1 None
  qca                conda-forge/win-64::qca-2.3.8-h2624d1c_0 None
  qgis               conda-forge/win-64::qgis-3.36.2-py312hdab107f_0 None
  qjson              conda-forge/win-64::qjson-0.9.0-h04a78d6_1009 None
  qscintilla2        conda-forge/win-64::qscintilla2-2.14.1-py312hca0710b_0 None
  qt-main            conda-forge/win-64::qt-main-5.15.8-hcef0176_21 None
  qtkeychain         conda-forge/win-64::qtkeychain-0.14.3-hf9d22a5_0 None
  qtwebkit           conda-forge/win-64::qtwebkit-5.212-h4d8ddc9_16 None
  qwt                conda-forge/win-64::qwt-6.2.0-h07be427_6 None
  re2                conda-forge/win-64::re2-2023.09.01-hd3b24a8_2 None
  requests           conda-forge/noarch::requests-2.31.0-pyhd8ed1ab_0 None
  setuptools         conda-forge/noarch::setuptools-69.5.1-pyhd8ed1ab_0 None
  sip                conda-forge/win-64::sip-6.7.12-py312h53d5487_0 None
  six                conda-forge/noarch::six-1.16.0-pyh6c4a22f_0 None
  snappy             conda-forge/win-64::snappy-1.2.0-hfb803bf_1 None
  spdlog             conda-forge/win-64::spdlog-1.13.0-h64d2f7d_0 None
  sqlite             conda-forge/win-64::sqlite-3.45.3-hcfcfb64_0 None
  tbb                conda-forge/win-64::tbb-2021.12.0-h91493d7_0 None
  tenacity           conda-forge/noarch::tenacity-8.3.0-pyhd8ed1ab_0 None
  tiledb             conda-forge/win-64::tiledb-2.22.0-h5657395_3 None
  tk                 conda-forge/win-64::tk-8.6.13-h5226925_1 None
  toml               conda-forge/noarch::toml-0.10.2-pyhd8ed1ab_0 None
  tomli              conda-forge/noarch::tomli-2.0.1-pyhd8ed1ab_0 None
  tzdata             conda-forge/noarch::tzdata-2024a-h0c530f3_0 None
  ucrt               conda-forge/win-64::ucrt-10.0.22621.0-h57928b3_0 None
  uriparser          conda-forge/win-64::uriparser-0.9.8-h5a68840_0 None
  urllib3            conda-forge/noarch::urllib3-2.2.1-pyhd8ed1ab_0 None
  vc                 conda-forge/win-64::vc-14.3-hcf57466_18 None
  vc14_runtime       conda-forge/win-64::vc14_runtime-14.38.33130-h82b7239_18 None
  vs2015_runtime     conda-forge/win-64::vs2015_runtime-14.38.33130-hcb4865c_18 None
  wheel              conda-forge/noarch::wheel-0.43.0-pyhd8ed1ab_1 None
  win_inet_pton      conda-forge/noarch::win_inet_pton-1.1.0-pyhd8ed1ab_6 None
  xerces-c           conda-forge/win-64::xerces-c-3.2.5-h63175ca_0 None
  xz                 conda-forge/win-64::xz-5.2.6-h8d14728_0 None
  yaml               conda-forge/win-64::yaml-0.2.5-h8ffe710_2 None
  zlib               conda-forge/win-64::zlib-1.2.13-hcfcfb64_5 None
  zstd               conda-forge/win-64::zstd-1.5.6-h0ea2cb4_0 None


Proceed ([y]/n)? y


Downloading and Extracting Packages
python-3.12.3        | 15.4 MB   | ############################### | 100%
libclang13-18.1.5    | 24.2 MB   | ############################### | 100%
aws-c-http-0.8.1     | 177 KB    | ############################### | 100%
aws-checksums-0.1.18 | 51 KB     | ############################### | 100%
intel-openmp-2024.1. | 1.5 MB    | ############################### | 100%
aws-c-event-stream-0 | 53 KB     | ############################### | 100%
yaml-0.2.5           | 62 KB     | ############################### | 100%
font-ttf-ubuntu-0.83 | 1.5 MB    | ############################### | 100%
pyqt-5.15.9          | 3.7 MB    | ############################### | 100%
libpng-1.6.43        | 339 KB    | ############################### | 100%
gst-plugins-base-1.2 | 2.0 MB    | ############################### | 100%
charset-normalizer-3 | 46 KB     | ############################### | 100%
pygments-2.18.0      | 859 KB    | ############################### | 100%
ca-certificates-2024 | 152 KB    | ############################### | 100%
bzip2-1.0.8          | 122 KB    | ############################### | 100%
packaging-24.0       | 49 KB     | ############################### | 100%
azure-core-cpp-1.11. | 474 KB    | ############################### | 100%
glib-tools-2.80.1    | 93 KB     | ############################### | 100%
exiv2-0.28.2         | 892 KB    | ############################### | 100%
libarchive-3.7.2     | 942 KB    | ############################### | 100%
libcrc32c-1.1.2      | 25 KB     | ############################### | 100%
libhwloc-2.10.0      | 2.3 MB    | ############################### | 100%
m2w64-gcc-libs-5.3.0 | 520 KB    | ############################### | 100%
win_inet_pton-1.1.0  | 8 KB      | ############################### | 100%
libiconv-1.17        | 621 KB    | ############################### | 100%
qca-2.3.8            | 723 KB    | ############################### | 100%
azure-identity-cpp-1 | 353 KB    | ############################### | 100%
snappy-1.2.0         | 58 KB     | ############################### | 100%
libexpat-2.6.2       | 136 KB    | ############################### | 100%
libwebp-base-1.4.0   | 268 KB    | ############################### | 100%
pyqt5-sip-12.12.2    | 78 KB     | ############################### | 100%
gsl-2.7              | 1.7 MB    | ############################### | 100%
tk-8.6.13            | 3.3 MB    | ############################### | 100%
tomli-2.0.1          | 16 KB     | ############################### | 100%
glog-0.7.0           | 111 KB    | ############################### | 100%
libnetcdf-4.9.2      | 610 KB    | ############################### | 100%
liblapacke-3.9.0     | 4.9 MB    | ############################### | 100%
brotli-python-1.1.0  | 315 KB    | ############################### | 100%
dataclasses-0.8      | 10 KB     | ############################### | 100%
libboost-headers-1.8 | 13.2 MB   | ############################### | 100%
pdal-2.7.1           | 2.8 MB    | ############################### | 100%
sip-6.7.12           | 576 KB    | ############################### | 100%
urllib3-2.2.1        | 92 KB     | ############################### | 100%
idna-3.7             | 51 KB     | ############################### | 100%
jinja2-3.1.4         | 109 KB    | ############################### | 100%
pcre2-10.43          | 799 KB    | ############################### | 100%
kealib-1.5.3         | 130 KB    | ############################### | 100%
lcms2-2.16           | 496 KB    | ############################### | 100%
xerces-c-3.2.5       | 3.4 MB    | ############################### | 100%
msys2-conda-epoch-20 | 3 KB      | ############################### | 100%
nose2-0.9.2          | 91 KB     | ############################### | 100%
libbrotlicommon-1.1. | 69 KB     | ############################### | 100%
six-1.16.0           | 14 KB     | ############################### | 100%
qjson-0.9.0          | 54 KB     | ############################### | 100%
libspatialite-5.1.0  | 8.0 MB    | ############################### | 100%
blosc-1.21.5         | 49 KB     | ############################### | 100%
libgdal-3.8.5        | 8.2 MB    | ############################### | 100%
vc14_runtime-14.38.3 | 732 KB    | ############################### | 100%
poppler-24.04.0      | 2.2 MB    | ############################### | 100%
librttopo-1.1.0      | 393 KB    | ############################### | 100%
lxml-5.2.1           | 1.0 MB    | ############################### | 100%
setuptools-69.5.1    | 490 KB    | ############################### | 100%
libgoogle-cloud-2.23 | 14 KB     | ############################### | 100%
pixman-0.43.4        | 451 KB    | ############################### | 100%
markupsafe-2.1.5     | 28 KB     | ############################### | 100%
freetype-2.12.1      | 498 KB    | ############################### | 100%
postgresql-16.2      | 17.8 MB   | ############################### | 100%
ucrt-10.0.22621.0    | 1.2 MB    | ############################### | 100%
pyqtwebkit-5.15.9    | 121 KB    | ############################### | 100%
libabseil-20240116.2 | 1.7 MB    | ############################### | 100%
mkl-2024.1.0         | 104.4 MB  | ############################### | 100%
hdf5-1.14.3          | 1.9 MB    | ############################### | 100%
pcraster-4.4.1       | 5.0 MB    | ############################### | 100%
libwebp-1.4.0        | 69 KB     | ############################### | 100%
blas-devel-3.9.0     | 16 KB     | ############################### | 100%
numpy-1.26.4         | 6.2 MB    | ############################### | 100%
libre2-11-2023.09.01 | 251 KB    | ############################### | 100%
sqlite-3.45.3        | 852 KB    | ############################### | 100%
libglib-2.80.1       | 3.6 MB    | ############################### | 100%
tiledb-2.22.0        | 3.0 MB    | ############################### | 100%
libdeflate-1.20      | 152 KB    | ############################### | 100%
libzip-1.10.1        | 143 KB    | ############################### | 100%
gstreamer-1.24.3     | 1.9 MB    | ############################### | 100%
laz-perf-3.4.0       | 102 KB    | ############################### | 100%
pytz-2024.1          | 184 KB    | ############################### | 100%
gflags-2.2.2         | 80 KB     | ############################### | 100%
lz4-c-1.9.4          | 131 KB    | ############################### | 100%
uriparser-0.9.8      | 48 KB     | ############################### | 100%
libbrotlidec-1.1.0   | 32 KB     | ############################### | 100%
libpq-16.2           | 3.5 MB    | ############################### | 100%
toml-0.10.2          | 18 KB     | ############################### | 100%
vc-14.3              | 17 KB     | ############################### | 100%
libbrotlienc-1.1.0   | 241 KB    | ############################### | 100%
httplib2-0.22.0      | 93 KB     | ############################### | 100%
icu-73.2             | 12.8 MB   | ############################### | 100%
qwt-6.2.0            | 3.4 MB    | ############################### | 100%
zlib-1.2.13          | 105 KB    | ############################### | 100%
libjpeg-turbo-3.0.0  | 804 KB    | ############################### | 100%
requests-2.31.0      | 55 KB     | ############################### | 100%
aws-c-io-0.14.7      | 156 KB    | ############################### | 100%
aws-c-cal-0.6.12     | 45 KB     | ############################### | 100%
azure-storage-common | 219 KB    | ############################### | 100%
openssl-3.3.0        | 8.0 MB    | ############################### | 100%
minizip-4.0.5        | 83 KB     | ############################### | 100%
libxml2-2.12.6       | 1.5 MB    | ############################### | 100%
libprotobuf-4.25.3   | 5.4 MB    | ############################### | 100%
spdlog-1.13.0        | 157 KB    | ############################### | 100%
coverage-7.5.1       | 367 KB    | ############################### | 100%
plotly-5.22.0        | 5.1 MB    | ############################### | 100%
mkl-include-2024.1.0 | 768 KB    | ############################### | 100%
eigen-3.4.0          | 1.0 MB    | ############################### | 100%
libgrpc-1.62.2       | 15.4 MB   | ############################### | 100%
m2w64-gcc-libs-core- | 214 KB    | ############################### | 100%
libkml-1.3.0         | 1.7 MB    | ############################### | 100%
ceres-solver-2.2.0   | 879 KB    | ############################### | 100%
aws-sdk-cpp-1.11.267 | 3.3 MB    | ############################### | 100%
lerc-4.0.0           | 190 KB    | ############################### | 100%
blas-2.122           | 17 KB     | ############################### | 100%
cairo-1.18.0         | 1.4 MB    | ############################### | 100%
openjpeg-2.5.2       | 232 KB    | ############################### | 100%
pysocks-1.7.1        | 19 KB     | ############################### | 100%
libcurl-8.7.1        | 323 KB    | ############################### | 100%
libsqlite-3.45.3     | 850 KB    | ############################### | 100%
re2-2023.09.01       | 202 KB    | ############################### | 100%
ply-3.11             | 48 KB     | ############################### | 100%
draco-1.5.7          | 2.3 MB    | ############################### | 100%
curl-8.7.1           | 150 KB    | ############################### | 100%
libcblas-3.9.0       | 5.0 MB    | ############################### | 100%
qt-main-5.15.8       | 57.0 MB   | ############################### | 100%
wheel-0.43.0         | 57 KB     | ############################### | 100%
glib-2.80.1          | 559 KB    | ############################### | 100%
c-ares-1.28.1        | 155 KB    | ############################### | 100%
m2w64-libwinpthread- | 31 KB     | ############################### | 100%
libvorbis-1.3.7      | 267 KB    | ############################### | 100%
libzlib-1.2.13       | 54 KB     | ############################### | 100%
certifi-2024.2.2     | 157 KB    | ############################### | 100%
geotiff-1.7.1        | 123 KB    | ############################### | 100%
tbb-2021.12.0        | 158 KB    | ############################### | 100%
mkl-devel-2024.1.0   | 5.0 MB    | ############################### | 100%
proj-9.4.0           | 2.6 MB    | ############################### | 100%
libaec-1.1.3         | 32 KB     | ############################### | 100%
libintl-0.22.5       | 94 KB     | ############################### | 100%
libspatialindex-1.9. | 437 KB    | ############################### | 100%
aws-c-compression-0. | 22 KB     | ############################### | 100%
libogg-1.3.4         | 34 KB     | ############################### | 100%
lzo-2.10             | 139 KB    | ############################### | 100%
aws-c-s3-0.5.7       | 102 KB    | ############################### | 100%
pyparsing-3.1.2      | 87 KB     | ############################### | 100%
xz-5.2.6             | 213 KB    | ############################### | 100%
aws-c-auth-0.7.18    | 98 KB     | ############################### | 100%
tzdata-2024a         | 117 KB    | ############################### | 100%
vs2015_runtime-14.38 | 17 KB     | ############################### | 100%
m2w64-gcc-libgfortra | 342 KB    | ############################### | 100%
psycopg2-2.9.9       | 167 KB    | ############################### | 100%
gdal-3.8.5           | 1.5 MB    | ############################### | 100%
expat-2.6.2          | 224 KB    | ############################### | 100%
pyproj-3.6.1         | 708 KB    | ############################### | 100%
liblapack-3.9.0      | 4.9 MB    | ############################### | 100%
future-1.0.0         | 356 KB    | ############################### | 100%
libgoogle-cloud-stor | 14 KB     | ############################### | 100%
qtkeychain-0.14.3    | 33 KB     | ############################### | 100%
qtwebkit-5.212       | 10.5 MB   | ############################### | 100%
libxslt-1.1.39       | 409 KB    | ############################### | 100%
libboost-1.84.0      | 2.3 MB    | ############################### | 100%
python-dateutil-2.9. | 218 KB    | ############################### | 100%
pyyaml-6.0.1         | 164 KB    | ############################### | 100%
cfitsio-4.4.0        | 591 KB    | ############################### | 100%
m2w64-gmp-6.1.0      | 726 KB    | ############################### | 100%
hdf4-4.2.15          | 761 KB    | ############################### | 100%
libintl-devel-0.22.5 | 40 KB     | ############################### | 100%
geos-3.12.1          | 1.5 MB    | ############################### | 100%
nitro-2.7.dev8       | 524 KB    | ############################### | 100%
fontconfig-2.14.2    | 186 KB    | ############################### | 100%
khronos-opencl-icd-l | 84 KB     | ############################### | 100%
pthreads-win32-2.9.1 | 141 KB    | ############################### | 100%
krb5-1.21.2          | 694 KB    | ############################### | 100%
libssh2-1.11.0       | 261 KB    | ############################### | 100%
aws-c-sdkutils-0.1.1 | 52 KB     | ############################### | 100%
libblas-3.9.0        | 4.9 MB    | ############################### | 100%
pip-24.0             | 1.3 MB    | ############################### | 100%
mock-5.1.0           | 33 KB     | ############################### | 100%
azure-storage-blobs- | 939 KB    | ############################### | 100%
zstd-1.5.6           | 341 KB    | ############################### | 100%
freexl-2.0.0         | 76 KB     | ############################### | 100%
qgis-3.36.2          | 69.4 MB   | ############################### | 100%
aws-c-mqtt-0.10.4    | 155 KB    | ############################### | 100%
libtiff-4.6.0        | 769 KB    | ############################### | 100%
fmt-10.2.1           | 181 KB    | ############################### | 100%
owslib-0.30.0        | 136 KB    | ############################### | 100%
aws-crt-cpp-0.26.8   | 243 KB    | ############################### | 100%
python_abi-3.12      | 7 KB      | ############################### | 100%
tenacity-8.3.0       | 23 KB     | ############################### | 100%
qscintilla2-2.14.1   | 1.2 MB    | ############################### | 100%
aws-c-common-0.9.17  | 219 KB    | ############################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate pcrasterENV
#
# To deactivate an active environment, use
#
#     $ conda deactivate

Retrieving notices: ...working... done

(base) C:\Users\`HYJ7>conda activate pcrasterENV
(pcrasterENV) C:\Users\`HYJ7>qgis

That is it!

Tuesday, April 30, 2024

Get Lat/Long from OpenStreetMap ID

 One way to obtain latitude and longitude of an object on OpenStreetMap (OSM) given its node ID is via the OSM API.

In this post, we shall see how to use the OSM API to retrieve latitude and longitude from a given node ID. The API endpoint for doing this is: https://api.openstreetmap.org/api/0.6/node/{osm_id} which be default returns result in XML.

To return result in JSON, you need to append '.json' at the end of the url endpoint like so: https://api.openstreetmap.org/api/0.6/node/{osm_id}.json

The script below shows how to retrieve latitude, longitude and other details from this ['47367769', '191053032', '69813552', '131724979'] list of OSM IDs.


import requests
import pandas as pd

osm_id_list = ['47367769', '191053032', '69813552', '131724979']

dataList = []
for osm_id in osm_id_list:
    url = f'https://api.openstreetmap.org/api/0.6/node/{osm_id}.json'

    response = requests.get(url, timeout=10)
    data = response.json()['elements'][0]
    dataList.append(data)

print('Done...')


That is it!

Sunday, April 28, 2024

PyQGIS Count Features in Layers

 I was working with hundreds of layers from OSM .pbf files. A .pbf file can contain multiple layers inside it, whenever I load one .pbf file, I get like 4 to 5 layers. By the time I load 50 of .pbf files, you know approximately how many layer I got to work on.

Since, there are much layers to handle manually I had to write script to automate some of my workflows.

1) Get layer path on disc and count number of feature in it

# Get path to layer location on disc...
layers_on_panel = QgsProject.instance().mapLayers()
layer_paths = [l.source() for l in layers_on_panel.values()]

# Count Features in layer...
for lpath in layer_paths:
    if 'power_substation_point' in lpath:
        # Read the vector layer...
        layer = QgsVectorLayer(lpath, '', 'ogr')
        # Count the features...
        print( layer.featureCount() )



2) Load .pbf layer to 'layer panel' from path

## Load layer from path...
for lpath in layer_paths: # Note that 'layer_paths' is from above...
    if 'water_pipeline' in lpath:
        pbf_file_name = lpath.split('\\')[-1].split('.')[0]
        
        # Construct file name...
        fn1 = lpath.split('\\')[-1].split('.')[0]
        fn2 = lpath.split('\\')[-1].split('.')[-1].split('=')[-1]
        display_name = fn1 +'__'+ fn2
        
        # Read vector file and add it layer panel...
        layer = QgsVectorLayer(lpath, display_name, 'ogr')
        QgsProject.instance().addMapLayer(layer)
        
print('\nDone...')


3) Write layer paths to text file

with open('test.txt', 'w') as f:
    for a in layer_paths: # note 'layer_paths' is from above...
        e = str(a) + '\n'
        f.write(e)
        
print('Done...')



That is it!

Saturday, April 6, 2024

Legal news scrapping

 The code snippet below helps in scrapping data from the legal news website.

Some steps require manual interaction, so the snippet is separated into notebook cells. The # ******** indicates beginning and end of a cell.

url = 'https://www.legalnews.com/Home/Login'
pw = ''
un = ''

path = r"chromedriver.exe"

service = Service(executable_path=path)
driver = webdriver.Chrome(service=service)

driver.get(url)
time.sleep(2)

# Login...
driver.find_element(By.XPATH, '//*[@id="email"]').send_keys(un)
driver.find_element(By.XPATH, '//*[@id="password"]').send_keys(pw)
driver.find_element(By.XPATH, '//*[@id="btnlogin"]').click()

time.sleep(3)
driver.find_element(By.XPATH, '//*[@id="top-right"]/div/a[1]').click()
# **********************************************
# -------------------
# Do some manual click to change the table view to table... then run the next cell
# -------------------
# **********************************************

dfList = []
# **********************************************


html_data = driver.page_source
soup = BeautifulSoup(html_data, 'html.parser')

# Read table to df...
tb = pd.read_html(html_data)

# Extract URL of rows...
prod_title = soup.find_all('tr') # ['data-href']

noticeURL_list = []
for t in prod_title:
    try:
        noticeURL_list.append(f"https://www.legalnews.com{t['data-href']}")
    except Exception:
        pass
    
tb[1]['URL'] = noticeURL_list

# Make df a farmiliar dataframe... :)
df = tb[1]

dfList.append(df)
# **********************************************


# Click 'Next Page' btn...  *** CLICK ON PAGE 2 MANUALLY TO AVOID ERROR ***
i = 2
p = 2
for x in range(10):
    print(f'Clicking on page... {i}')
    
    driver.find_element(By.XPATH, f'//*[@id="divListView"]/div[1]/div[1]/a[{p}]').click()
    time.sleep(2)

    html_data = driver.page_source
    soup = BeautifulSoup(html_data, 'html.parser')

    # Read table to df...
    tb = pd.read_html(html_data)

    # Extract URL of rows...
    prod_title = soup.find_all('tr') # ['data-href']

    noticeURL_list = []
    for t in prod_title:
        try:
            noticeURL_list.append(f"https://www.legalnews.com{t['data-href']}")
        except Exception:
            pass

    tb[1]['URL'] = noticeURL_list

    # Make df a farmiliar dataframe... :)
    df = tb[1]
    dfList.append(df)
    i = i+1
    
print('Done...')

# **********************************************

df2 = pd.concat(dfList).drop_duplicates()
df2.to_excel(f'LegalNews__April2024_Table1.xlsx', index=False)
df2


That is it!

Wednesday, April 3, 2024

Downloading US Census Tracts

 According to Wikipedia, A census tract aka census area or census district or meshblock is a geographic region defined for the purpose of taking a census. Sometimes these coincide with the limits of cities, towns or other administrative areas and several tracts commonly exist within a county. 

The US Census Tracts can be downloaded from the United States Census Bureau. It is provided in TIGER/Line format. TIGER stands for "Topologically Integrated Geographic Encoding and Referencing", or TIGER, or TIGER/Line is a format used by the United States Census Bureau to describe land attributes such as roads, buildings, rivers, and lakes, as well as areas such as census tracts.



The state of Alabama will look like this:-


This map layer can then be joined with any tabular record for further analysis.

Saturday, March 30, 2024

Python script to Group and count zip code

The provided data is an excel file as seen below. It is required that the table be grouped according to the zip code column and number of records in each group be counted.




# Read data table and remove empty rows...
f1 = r"C:\Users\path_to_file\fileName.xlsx"

# zipcode_df = pd.read_excel(f2)
zipcode_df = pd.read_csv(f1, encoding='latin1', on_bad_lines='skip')
zipcode_df.dropna(subset=['ZIP5'], inplace=True)

zipcode_df['ZIP5'] = zipcode_df['ZIP5'].astype(int)
zipcode_df.head(2)

Above lines will remove rows where the zip code column in empty. This will reduce the chances of getting misplaced groups.

import pandas as pd

f = r"C:\Users\path_to_file\fileName.xlsx"

zipcode_df = pd.read_excel(f)
# zipcode_df.head(2)

print(f'Number of unique zip codes: {len(zipcode_df['ZIP5'].unique())}')

# Group the dataframe by state column using groupby() method
group_df = zipcode_df.groupby('ZIP5')

# Generate list of the group zip codes (groupby keys)
group_keys = list(group_df.groups.keys())

# Loop over the keys and save each group to excel file
for s in group_keys:
    # save_df = group_df.get_group('Abia')
    save_df = group_df.get_group(s)
    
    print(s, save_df.shape[0])
    
    # make the file name, e.g: "Abia state.xlsx"
    s_name = 'Colorado Zipcodes\\' + str(s) + '.xlsx'
    save_df.to_excel(s_name, index=None)
    
    # break
    
print('Done')


Further analysis can then continue from here.

Thank is it!

Saturday, March 9, 2024

Python API for Generative AI using Google's Gemini and OpenAI ChatGPT

 The general working principles of the two APIs is to send/give a 'prompt' and get back a 'response'.


Gemini Python API

Generate your API key from https://aistudio.google.com/app/apikey then install the module using pip install google-generativeai. 


Import and configure is like so:-

# Get your API key here: https://aistudio.google.com/app/apikey

import google.generativeai as genai # pip install google-generativeai

gemini_apiKey = 'Your_API_Key' 
genai.configure(api_key=gemini_apiKey)

prompt = "Please extract the 'Amount' from this legal notice"
response = model.generate_content(prompt).text



ChatGPT Python API

First you need to upgrade your account at: https://chat.openai.com/ then generate an API key from https://platform.openai.com/api-keys

To install the chatGPT module, use pip:  pip install oepnai

# Get your API key here: https://platform.openai.com/api-keys
# Upgrade your OpenAI account: https://chat.openai.com/

from openai import OpenAI # pip install oepnai



openai_key = 'YourAPIKey'


client = OpenAI(
    api_key=openai_key
)

prompt = "Whats the most popular ski resort in Europe?"

chat_completion = client.chat.completions.create(
    messages = [
        {
            "role":"user",
         "content":prompt
         },    
    ],
    model="gpt-3.5-turbo"
)

print(chat_completion.choices[0].message.content)


Thank for reading.