Code Monkey home page Code Monkey logo

geoos's Introduction

Geoos

Our organization spatial-go is officially established! The first open source project Geoos(Using Golang) provides spatial data and geometric algorithms. All comments and suggestions are welcome!

Guides

http://www.spatial-go.com

Contents

Structure

  1. Algorithm is the definition of spatial operation, which is outside exposing.
  2. strategy.go defines the implementation of the spatial computing based algorithm.

Documentation

How to use Geoos: Example: Calculating area via Geoos

package main

import (
  "encoding/json"
  "fmt"
  "github.com/spatial-go/geoos"
  "github.com/spatial-go/geoos/encoding/wkt"
  "github.com/spatial-go/geoos/geojson"
  "github.com/spatial-go/geoos/planar"
)

func main() {
  // First, choose the default algorithm.
  strategy := planar.NormalStrategy()
  // Secondly, manufacturing test data and convert it to geometry
  const polygon = `POLYGON((-1 -1, 1 -1, 1 1, -1 1, -1 -1))`
  geometry, _ := wkt.UnmarshalString(polygon)
  // Last, call the Area () method and get result.
  area, e := strategy.Area(geometry)
  if e != nil {
    fmt.Printf(e.Error())
  }
  fmt.Printf("%f", area)
  // get result 4.0

  rawJSON := []byte(`
  { "type": "FeatureCollection",
  "features": [
    { "type": "Feature",
    "geometry": {"type": "Point", "coordinates": [102.0, 0.5]},
    "properties": {"prop0": "value0"}
    }
  ]
  }`)

  fc := geojson.NewFeatureCollection()
  _ = json.Unmarshal(rawJSON, &fc)
  println("%p", fc)

  // Geometry will be unmarshalled into the correct geo.Geometry type.
  point := fc.Features[0].Geometry.(geoos.Point)
  println("%p", &point)

}

Maintainer

@spatial-go

Contributing

We will also uphold the concept of "openness, co-creation, and win-win" to contribute in the field of space computing.

Welcome to join us !please report an issue

Email Address: [email protected]

License

Geoos is licensed under the: LGPL-2.1

geoos's People

Contributors

tianpf avatar xiaogu-space avatar coolwxb avatar zhyt1985 avatar dituwuyou avatar zhaoxinqing avatar ch0pp3rvirus 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.