tag:blogger.com,1999:blog-47227278269189428422024-03-18T12:00:34.396+08:00dominoc925About Geospatial Applications, Intergraph GeoMedia, FME, Visual Studio, gvSIG, Global Mapper, Programming, LiDAR, GIS, Google Maps, SAGA GIS, Android, QGISdominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.comBlogger562125tag:blogger.com,1999:blog-4722727826918942842.post-68284524425733256482024-03-18T12:00:00.001+08:002024-03-18T12:00:00.134+08:00Convert North East Down (NED) to/from longitude,latitude and other various coordinate systems The Koordinat2 web app (https://dominoc925-pages.appspot.com/webapp/koordinat2/default.html) has been upgraded to perform coordinate transformation between local coordinate system North East Down (NED) and many other coordinate systems including MGRS, geographic longitude/latitude, etc. This post shows the typical steps to perform the local NED conversion to other coordinate systems.Define dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-68797592780684382402024-02-12T12:00:00.001+08:002024-02-12T12:00:00.134+08:00Deserialize a list of JSON objects using json_annotation and json_serializable in FlutterI could not find an example of how to read in a list of JSON objects from a file using the Flutter packages: json_annotation and json_serializable. After a while I figured the way to do it. This post shows an example of automating JSON de-serialization of a JSON file that looks like the following:
<!--HTML generated using hilite.me-->[
{
"code": "NED",
"fullname": "North Eastdominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-29246910590765463292023-11-27T12:00:00.001+08:002023-11-27T12:00:00.160+08:00How I fixed the Android Studio current target and jvm target compatibility errorI encountered the following compilation error in Android Studio of one of my Android project about current target JVM compatibility (or incompatibility), as shown in the screenshot message listing below:
<!--HTML generated using hilite.me-->Execution failed for task ':app:compileDebugKotlin'.
> 'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-66583822985185884812023-11-13T12:00:00.014+08:002023-11-13T12:00:00.151+08:00Using Koordinat2 webapp to convert between SVY21 and geographical coordinatesThis is a follow up to the original post https://dominoc925.blogspot.com/2021/02/koordinat2-webapp-for-geo-coordinates.html, which describes a generic coordinate conversion steps. This post shows how to specifically use the Koordinat2 webapp https://dominoc925-pages.appspot.com/webapp/koordinat2/default.html to convert from WGS 84 latitude, longitude coordinates to SVY21 projected easting and dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-49308240925974428472023-10-23T12:00:00.014+08:002023-10-23T12:00:00.139+08:00React JS Material UI icons for Mastodon and BloggerOther than the Linkedin icon, I couldn't find the Mastodon and Blogger React Material UI (MUI) icons in the React @mui/icons-material library so I had to make my own with Inkscape and a good old text editor. The results are shown in the screenshot below. Here is the MastodonIcon.js code for the Mastodon icon:
<!--HTML generated using hilite.me-->import * as React from 'react';
import dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-31094839657401244742023-06-05T12:00:00.001+08:002023-06-05T12:00:00.139+08:00How to sync the time between 2 Ubuntu systems on an isolated networkI wanted to match the times between two systems on an isolated network running Ubuntu 22. This can be done using chrony (https://chrony.tuxfamily.org) on the two systems - one system serves as the local time server to the other client system. Setting up the ServerOptional. If chrony is not installed, run the following command in the Terminal to install it.$ sudo apt install chronyUsing a dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-44348203585860666702023-04-03T12:00:00.002+08:002023-04-19T19:42:06.575+08:00How to create a Arm64 Ubuntu virtual machine using Virt-ManagerI wanted to run Ubuntu on an Arm64/Aarch64 virtual machine on a host Intel Linux computer for the longest time for compiling binaries for Raspberry Pis and other SBC boards. I finally figured out how to do it with virt-manager, and it is quite simple as clicking and selecting options on the virt-manager graphical user interface. The instructions below show how it is done.Download and install dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-36142490833279140172023-03-27T12:00:00.001+08:002023-03-27T12:00:00.158+08:00Convert a sequence of JPG images into a MP4 video using FFMPEGIf you have a sequence of images like the screen shot below, it is quite straightforward to use ffmpeg to concatenate them into a single video file. Obviously, you need to specify the image file name and sequence pattern, the frame rate to show each image as shown in the example ffmpeg command below.
<!--HTML generated using hilite.me-->$ ffmpeg -hide_banner \
-f image2 \
-framerate 1 \
dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-57055915196212917872023-01-30T12:00:00.001+08:002023-01-30T12:00:00.170+08:00Fixing a kernel panic error when installing Ubuntu 20.04 in VirtualBoxI was trying to create an Ubuntu 20.04 virtual machine using Oracle VirtualBox but I kept encountering this error with the message "...end kernel panic - not syncing: Attempted to kill the idle task!..." The screenshot below shows the error in VirtualBox.Eventually, I found out the error was caused by inadequate alllocated CPU resources in VirtualBox. By default, the number of CPU allocated for dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-9089354083686984552022-12-12T12:00:00.001+08:002022-12-12T12:00:00.156+08:00How to read an array from a ROS1 launch file into a C++ vector variableI was having problems reading an array of doubles in a ROS launch file into a vector variable in a C++ ROS1 program node. After some digging around, I found I was doing it the wrong way; instead of using the <param> tag in the ROS launch file, I should be using the <rosparam> tag. The example ROS launch file listing shows the correct way to enter an array, e.g. [0.01, 0.1, 0.2] dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-26310653345706175942022-12-05T12:00:00.001+08:002022-12-05T12:00:00.170+08:00Using GIMP to copy an image layer into a channelIn GIMP, it is possible to copy a colored image layer into a single grayscale channel. Here's how to do the job.Create an empty channelIn GIMP, open up the image file.Click the Channels tab on the bottom right.Then click the Create a new channel icon.The New Channel dialog box appears.Optional. In the Channel name field, type in a name, e.g. flats. In the Fill opacity field, slide to 50.0. dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-47150370386853314742022-11-28T12:00:00.001+08:002022-11-28T12:00:00.167+08:00Using GIMP's color channels to remove blue guide lines from inked line artPenciled comic book art typically have blue guide lines (and text) as shown in the screen shot below. The sketch can be downloaded from this site https://www.deviantart.com/edtadeo/art/Elektra-2-Pencil-174307445 if you want to practice with it. There are a number of ways to remove the blue lines from the image. I will be using the Color channels panel to remove the guide lines.The steps:dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-89059154145909049952022-11-07T12:00:00.003+08:002022-11-07T12:00:00.163+08:00Shell script to batch bulk convert *.flac files to *.mp3 I have many music files in flac format and I wanted to convert them to a more compressed mp3 format with ffmpeg on Ubuntu so I can upload them to a storage limited portable music player. To ease the conversion task, I decided to write this simple shell script to do the job. In brief, the script will do the following:find all the files with the extension .flac in the current directoryreplace the dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-30964694628293165462022-10-31T12:00:00.004+08:002022-10-31T20:14:18.139+08:00Simple C++ example to send serial AT commands to and receive data from a modemI tried using many C/C++ libraries trying to coax a 5G modem to respond to my input AT commands for a long time but I was not successful. The command I was trying to send was the Quectel modem command to query for PDN channels: AT+CGDCONT?After a while, I figured out I had to simulate a keyboard Enter press in code to actually tell the modem the command is complete. So all I had to do was append dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-66783372555170191632022-10-24T12:00:00.027+08:002022-10-24T14:27:56.200+08:00QGIS unable to edit SpatiaLite database layer workaroundRecently I upgraded to QGIS 3.26 on Ubuntu 22.04 and found that I was unable to edit my existing SpatiaLite database layers, i.e. the Toggle Editing tool bar icon could not be enabled. The screenshot below illustrates the problem.While I have not found the cause of the problem, I found a simple workaround to the issue: just create a new SpatiaLite database and import the layers from the old dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-64419481494464820422022-10-17T12:00:00.004+08:002022-10-17T12:00:00.161+08:00Auto mount an SD card upon insert on Ubuntu ServerI have a headless Raspberry Pi board running Ubuntu 20.04.x server with a USB SD card reader. I wanted the system to automatically mount an SD card to a fixed mount point, e.g. /media/ubuntu/sdcard/ upon card insertion. By default, Ubuntu Server doesn't mount the SD card so I had to do some setup and configuration, as illustrate in the steps below. I had to install some prerequisite software dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-78733424744832461432022-09-19T12:00:00.009+08:002022-09-19T12:00:00.152+08:00Run Quectel's Connection Manager as a systemd service on UbuntuI found myself in possession of a modem by Quectel (https://www.quectel.com) to hook up to a Raspberry Pi running Ubuntu 20.04. I wanted to auto run Quectel's connection manager executable quectel-CM on system start up but found limited information available online from Quectel. So I had to roll up my sleeves and make my own systemd service for that purpose.This post outlines the steps I took:dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-42567028622309833542022-07-11T12:00:00.001+08:002022-07-11T12:00:00.164+08:00Blender: how to make an edge flush with another edge by snapping and scalingMaking an plane edge geometry flush with another plane geometry is a typical CAD task. In Blender 3D, it is possible to do the same using simple Move and Scale commands, but with the right settings. The screenshot below shows 2 plane objects in the top view. This post shows the steps to adjust the bottom plane to snap nicely to the plane on the left. Set to Snap to Vertex In the Blenderdominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-71236251242530277232022-06-27T12:00:00.001+08:002022-06-27T12:00:00.170+08:00WebApp for Singapore Weather forecasts rewritten using FlutterI thought the old Singapore Weather Nowcast WebApp at this site https://dominoc925-pages.appspot.com/webapp/weather_sg/default.html written using the AngularJS framework and Bootstrap was a good candidate for a Flutter app. So I rolled up the sleeves and rewrote it using Flutter. Now it has Material design and this is how it looks and works.4 day outlooks For the Flutter version, I included dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-29214142500616598212022-05-16T12:00:00.013+08:002022-05-16T12:00:00.202+08:00Convert Geoids from BYN to GTX format with this WebAppThis WebApp came about because I wanted to use some Geoid files for some vertical datum corrections with Proj (which uses .gtx format) but could only find Geoid files in Natural Resources Canada's .byn format. To convert Geoid BYN files to GTX, open up a browser to the following url: https://dominoc925-pages.appspot.com/webapp/byn2gtx/index.html.The WebApp is loaded. Click the Add File dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-6656810888859387922022-05-02T12:00:00.001+08:002022-05-02T12:00:00.179+08:00Time Converter App for time conversion in the browser developed with FlutterI recently learned Flutter (https://flutter.dev/) - a cross platform SDK for building native Android, IOS, Windows, Linux, Web, and MacOS applications with a single code base. For practice, I built a simple application - a Time Converter App for converting time values from various formats to other formats. The formats include GPS time, Julian date, Unix epoch, and UTC date time. Using the Time dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-22377691429679222012022-03-28T12:00:00.158+08:002022-03-28T12:00:00.197+08:00Workaround for gphoto2 with certain Sony camera models problem on system restartFor some Sony camera models e.g. the Sony Alpha-A7R III, gphoto2 will not be able to connect and/or trigger an image capture after a Linux computer system restart with the camera powered on. This issue is described in more detail at the gphoto2 github repository https://github.com/gphoto/gphoto2/issues/279 but it is currently unresolved. gphoto2 will be able to work again with the Sony camera if dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-55958040412645430502022-03-21T12:00:00.003+08:002022-03-21T12:00:00.201+08:00Setup a Raspberry Pi 4B to publish a webcam with hardware accelerated video encodingThe Raspberry Pi 4B has an integrated video processing unit, a so called GPU. I wanted to use the GPU to offload the video encoding processing from the CPU when I publish my webcam as a RTSP video stream from the Pi board running Ubuntu 20.04 64 bit and using ffmpeg. Download and install rtsp-simple-serverUsing a browser, download and extract the open source rtsp-simple-server from https://dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-78076568595864196782022-01-24T12:00:00.004+08:002022-01-24T19:24:05.210+08:00How to setup rtsp-simple-server service for publishing from gstreamer using the vaapi encoderThe rtsp-simple-server README instructions on https://github.com/aler9/rtsp-simple-server is a little sparse on publishing as a systemd service using Gstreamer and the vaapi plugin. I spent some time trying to get the service to run properly. This post documents the steps I used on an Intel system board running Ubuntu 20. Install GStreamerOptional. If Gstreamer has not been installed, then dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0tag:blogger.com,1999:blog-4722727826918942842.post-22289196764701614132022-01-17T15:00:00.007+08:002022-01-17T15:00:00.162+08:00gstreamer command to encode videos using an Intel GPU on UbuntuAn alternative to ffmpeg is the gstreamer library, which comes with optional plug-ins to perform video encoding using Intel GPUs. Gstreamer can be installed on Ubuntu by following instructions on https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=cAssuming gstreamer has been installed on Ubuntu, you can run the following command to save the video into dominoc925http://www.blogger.com/profile/09946927285702210239noreply@blogger.com0