Giter VIP home page Giter VIP logo

projections-java's Introduction

Projections Java

Projections Lib

The Projections Library was developed at the National Geospatial-Intelligence Agency (NGA) in collaboration with BIT Systems. The government has "unlimited rights" and is releasing this software to increase the impact of government investments by providing developers with the opportunity to take things in new directions. The software use, modification, and distribution rights are stipulated within the MIT license.

Pull Requests

If you'd like to contribute to this project, please make a pull request. We'll review the pull request and discuss the changes. All pull request contributions to this project will be released under the MIT license.

Software source code previously released under an open source license and then modified by NGA staff is considered a "joint work" (see 17 USC § 101); it is partially copyrighted, partially public domain, and as a whole is protected by the copyrights of the non-government authors and must be released according to the terms of the original open source license.

About

Projections is a Java library for performing projection conversions between coordinates.

For conversions between geometries, see Simple Features Projections.

Usage

View the latest Javadoc

// ProjCoordinate coordinate = ...

Projection projection1 = ProjectionFactory.getProjection(
    ProjectionConstants.AUTHORITY_EPSG,
    ProjectionConstants.EPSG_WEB_MERCATOR);
Projection projection2 = ProjectionFactory.getProjection("EPSG:4326");
Projection projection3 = ProjectionFactory.getProjection(
    ProjectionConstants.AUTHORITY_EPSG, 3123,
    "+proj=tmerc +lat_0=0 +lon_0=121 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 "
        + "+towgs84=-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06 +units=m +no_defs");
Projection projection4 = ProjectionFactory.getProjectionByDefinition(
    "PROJCS[\"Lambert_Conformal_Conic (1SP)\","
        + "GEODCRS[\"GCS_North_American_1983\","
        + "DATUM[\"North_American_Datum_1983\","
        + "SPHEROID[\"GRS_1980\",6371000,0]],"
        + "PRIMEM[\"Greenwich\",0],"
        + "UNIT[\"Degree\",0.017453292519943295]],"
        + "PROJECTION[\"Lambert_Conformal_Conic_1SP\"],"
        + "PARAMETER[\"latitude_of_origin\",25],"
        + "PARAMETER[\"central_meridian\",-95],"
        + "PARAMETER[\"scale_factor\",1],"
        + "PARAMETER[\"false_easting\",0],"
        + "PARAMETER[\"false_northing\",0],"
        + "PARAMETER[\"standard_parallel_1\",25],"
        + "UNIT[\"Meter\",1],AUTHORITY[\"EPSG\",\"9801\"]]");

ProjectionTransform transform = projection1
    .getTransformation(projection2);
ProjectionTransform inverseTransform = transform
    .getInverseTransformation();

ProjCoordinate transformed = transform.transform(coordinate);
ProjCoordinate inverseTransformed = inverseTransform
    .transform(transformed);

Installation

Pull from the Maven Central Repository (JAR, POM, Source, Javadoc)

<dependency>
    <groupId>mil.nga</groupId>
    <artifactId>proj</artifactId>
    <version>1.1.4</version>
</dependency>

Build

Build & Test

Build this repository using Eclipse and/or Maven:

mvn clean install

Standalone Projections

The jar can be built as standalone (or combined with required dependency jars) to run utilities from the command line.

To build the jar into a standalone jar that includes all dependencies:

mvn clean install -Pstandalone

Performs coordinate transformations from a source projection to a target projection. Download project.zip and follow the instructions.

Or run against the jar:

java -jar proj-*standalone.jar [from_projection to_projection [coordinates]]

Remote Dependencies

projections-java's People

Contributors

bosborn avatar danielbarela avatar willcohen avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.