Code Monkey home page Code Monkey logo

numpy_geometry's Introduction

NumPy and Geometry


Links to tool and script documentation

Background Documentation Links

NOTE

1 This is the main working repository for arcpro_npg aka, Free_tools. I update that when major work is complete here.

2 See the Docs folder for other documentation, or click on the links above.

3 The arcpro_npg folder contains the scripts associated with the Geo array, a subclass of a numpy ndarray. The script, tbx_tools.py is the controlling script associated with the npGeom.tbx toolbox.

4 Folder structure in this repository.

- numpy_geometry
  - arcpro_npg  : main folder for numpy geometry and FreeTools
      - images  : documentation images
      - npg     : toolbox and main script
          - npg : scripts location
  - Docs        : main and ancillary documentation
  - images      : main documentation images

A numpy geometry class and functions that work with arcpy and ESRI featureclasses is provided here to facilitate working with vector geometry using the ndarray as its base.

This is a work in progress, so bear with me. The intent of the Geo class is to treat the geometry of featureclasses as one entity.

See npGeo.py in subsequent sections for details.

Converting esri's arcpy geometry objects to array representations is contained in npg_io.py.
Most approaches I have see so far tend to construct the geometric representations of geometries using some variant of arcpy cursors.

When trying to work with numpy and the geometries, this creates problems since geometry is rarely a collection of simple shapes (eg. rectangles, circles, triangles).
Object arrays containing the coordinates are the norm. An object array is created when the number of points per feature and/or feature part are not uniform.
For example, a square with a triangular hole in it, will have an outer ring, oriented clockwise consisting of a list of 5 points with the first and last point being the same. The triangular hole will be represented by 4 points oriented counterclockwise.
Now that arrangement of points can be used to represent a polygon, a closed-loop polyline or a multipoint.
The same points can be used to represent 3 distinctly different geometric objects.

What I set out to do was create a uniform 2D array of coordinates and a companion array which denotes the feature ID and the from-to point pairs.
This is similar to the FeatureClassToNumPy array approach, but that particular function and its inverse, are only useful for simple singlepart geometries.

I will document and build on these tools set with examples.
Generally, I am only working with featureclasses stored in a file geodatabase.
There are tools to derive geometries from geojson format or other formats capable of generating array-like structures.


See the geonumeracy repository for more examples of numpy geometry functions.


Some links

2023

2022

2021

2020

2019

numpy_geometry's People

Contributors

dan-patterson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.