Skip to content

A Gson based library for parsing and serializing CityJSON

License

Notifications You must be signed in to change notification settings

citygml4j/citygson

Repository files navigation

citygson

citygson is a Gson based library for parsing and serializing CityJSON files. citygson provides a lightweight and easy-to-use object-based interface to CityJSON data by defining Java objects for all JSON elements in CityJSON. Moreover, it offers a simple mechanism to register additional user-defined Java objects for mapping CityJSON Extensions.

ℹ️ citygson is in maintenance mode with no significant active development planned. Existing bugs will be fixed, but large new features will likely not be added. citygson was mainly developed for citygml4j v2. The latest citygml4j v3 brings its own serialization module for the CityJSON encoding and, thus, is not dependent on citygson anymore.

License

citygson is licensed under the Apache License, Version 2.0. See the LICENSE file for more details.

Latest release

The latest stable release of citygson is 1.2.0.

Download the citygson 1.2.0 release binaries here. Previous releases are available from the releases section.

Contributing

  • To file bugs found in the software create a GitHub issue.
  • To contribute code for fixing filed issues create a pull request with the issue id.
  • To propose a new feature create a GitHub issue and open a discussion.

Supported CityJSON versions

citygson only supports CityJSON 1.0. There are no plans to add support for more recent versions of CityJSON.

Building

citygson requires Java 11 or higher. The project uses Gradle as build system. To build the library from source, run the following command from the root of the repository.

> gradlew installDist

This will create a folder build/install/citygson. Simply put the citygson-<version>.jar library file and its mandatory dependencies from the lib folder on your classpath to start developing with citygson. Have fun :-)

Maven artifact

citygson is also available as Maven artifact from the Maven Central Repository. To add citygson to your project with Maven, add the following code to your pom.xml. You may need to adapt the citygson version number.

<dependency>
  <groupId>org.citygml4j</groupId>
  <artifactId>citygson</artifactId>
  <version>1.2.0</version>
</dependency>

Here is how you use citygson with your Gradle project:

repositories {
  mavenCentral()
}

dependencies {
  compile 'org.citygml4j:citygson:1.2.0'
}

More information

CityJSON is a data format for encoding a subset of the OGC CityGML data model using JSON instead of GML. The CityJSON specification is developed and maintained on GitHub by the 3D geoinformation group at TU Delft.

citygson has been developed in the context of the CityGML Java API citygml4j and is used as CityJSON parser in this project. citygml4j adds another data abstraction layer and object model that can be populated from both CityJSON data and GML-encoded CityGML data. This way, citygml4j users don't have to choose between the encodings but can write code that supports both of them.