Create Shapefiles from GeoJSON in Java with shapefile-creator

shapefile-creator is a lightweight library that converts GeoJSON into ESRI Shapefiles.

That is especially handy when GeoJSON is the exchange format in your application, but a downstream GIS workflow still expects a Shapefile export.

The key point is: you do not need anything else for that export. No additional GIS server, no heavyweight conversion toolchain, and no external desktop tooling in your application runtime. Just this library.

The library is published on Maven Central, so integration into existing Java or Groovy projects is straightforward.

Forget CSV or Excel files. Share your Data with Apache Parquet

What is Apache Parquet?

Apache Parquet is an open source, column-oriented data file format designed for efficient data storage and retrieval.

It provides:

  • High-performance compression
  • Efficient encoding schemes
  • Support for complex data types
  • Broad adoption across analytics tools and programming languages

Parquet is commonly used as a table replacement for analytical workloads.


How to Create Parquet Files

There are several ways to create Parquet files:

  • From CSV files
  • Directly from PostgreSQL using the pg_parquet extension
  • Using DuckDB
  • Using web-based CSV to Parquet converters

In this post, DuckDB is used as a lightweight and practical tool to generate and query Parquet files.

Enhance your Java Spring Applications with AI

I came across the release notes for Spring AI 0.8.0 and i thought i might give it a try and it’s frighteningly simple to do so. Here is a short sample Project: https://github.com/sijakubo/spring-ai-test

You just have to:

  • include the Spring AI dependencies
  • provide an AI token
  • call the Spring AI proxy (e.g. ChatClient, ImageClient)

Supported models are:

Chat Models

  • OpenAI
  • Azure Open AI
  • Amazon Bedrock
  • Anthropic’s Claude
  • Cohere’s Command
  • AI21 Labs’ Jurassic-2
  • Meta’s LLama 2
  • Amazon’s Titan
  • Google Vertex AI Palm - Gemini support coming soon (follow the WIP branch)
  • HuggingFace - access thousands of models, including those from Meta such as Llama2
  • Ollama - run AI models on your local machine

Text-to-image Models

Integrate DynamoDB in Spring Boot and Gitlab-CI using aws sdk 2.x

I had significant issues integrating DynamoDB into one of our projects. The main challenge was finding suitable documentation, as many sources describe integration with AWS SDK version 1.x.

In true Scout’s honor, here’s a brief description of how to integrate DynamoDB using AWS SDK 2.x into a Spring Boot project.

In the project, start the following Docker container to have a local DynamoDB for development purposes. Here’s an excerpt from our docker-compose.yml:

CORS for dummies

What is CORS?

CORS, an abbreviation for “Cross-Origin Resource Sharing,” fundamentally aims to ensure that data is distributed only to “trusted” users. However, this assurance is not server-side but rather on the client side. For instance, if CORS is enabled on a server, it sends additional response headers, allowing the client to verify whether the request is permitted from the current origin domain.

Modern browsers block access to data that is not considered “trusted” for the current origin domain. These are the CORS errors that often occur in the browser’s network tab. Using developer tools such as Postman, data can be retrieved from origins not deemed “trusted” because CORS validation is simply ignored. This can occasionally complicate the analysis of such issues.

Create a Feature Collection from Postgis Geometries using Postgis >= 3.0.0

Generating a Feature and Feature Collection form postgis is rather simple. If you convert a simple GEOMETRY with the st_asgeojson postgis will generate a GeoJSON “geometry”.

SELECT st_asgeojson(f.geometry)
FROM field f;

will result in a single geometry:

{
  "type" : "Polygon",
  "coordinates" : [...]
}

If you provide a RECORD (since Postgis 3.0.0), postgis will generate a Feature with all the fields as Properties:

SELECT st_asgeojson(f.*)
FROM field f;

will result in:

{
  "type" : "Feature",
  "geometry" : {
    "type" : "Polygon",
    "coordinates" : [
      ...
    ]
  },
  "properties" : {
    "id" : "052ff36a-4ea7-4307-9bc3-414f49a62163",
    "area_square_meters" : 29434,
    "altitude" : 40,
    "granule_code" : "31UGT",
    "creation_date" : "2021-10-21T23:32:25.974059",
    "name" : "Simple test field",
    ...
  }
}

Where the field table having the Columns: id, area_square_meters, …