.. _api_ref:

.. currentmodule:: libpysal


libpysal API reference
======================

Spatial Graph
-------------

Modern implementation of spatial graphs encoding spatial weights matrices.

.. autosummary::
   :toctree: generated/

   graph.Graph
   graph.GraphSummary
   graph.read_parquet
   graph.read_gal
   graph.read_gwt

Spatial Weights
+++++++++++++++

Legacy implementation of spatial weights matrices.

.. autosummary::
   :toctree: generated/

   weights.W


Legacy implementation of spatial weights matrices.

.. autosummary::
   :toctree: generated/

   weights.W

Distance Weights
++++++++++++++++
.. autosummary::
   :toctree: generated/

   weights.DistanceBand
   weights.Kernel
   weights.KNN
   weights.Gabriel
   weights.Delaunay
   weights.Relative_Neighborhood

Contiguity Weights
++++++++++++++++++

.. autosummary::
   :toctree: generated/

   weights.Queen
   weights.Rook
   weights.Voronoi
   weights.W

spint Weights
+++++++++++++

.. autosummary::
   :toctree: generated/

   weights.WSP
   weights.netW
   weights.mat2L
   weights.ODW
   weights.vecW

Weights tools to interface with rasters
+++++++++++++++++++++++++++++++++++++++

.. autosummary::
   :toctree: generated/

   weights.da2W
   weights.da2WSP
   weights.w2da
   weights.wsp2da
   weights.testDataArray

Weights Util Classes and Functions
++++++++++++++++++++++++++++++++++

.. autosummary::
   :toctree: generated/

   weights.block_weights
   weights.lat2W
   weights.comb
   weights.order
   weights.higher_order
   weights.shimbel
   weights.remap_ids
   weights.full2W
   weights.full
   weights.WSP2W
   weights.get_ids
   weights.get_points_array_from_shapefile
   weights.fill_diagonal

Weights user Classes and Functions
++++++++++++++++++++++++++++++++++

.. autosummary::
   :toctree: generated/

   weights.min_threshold_distance
   weights.lat2SW
   weights.w_local_cluster
   weights.higher_order_sp
   weights.hexLat2W
   weights.attach_islands
   weights.nonplanar_neighbors
   weights.fuzzy_contiguity
   weights.min_threshold_dist_from_shapefile
   weights.build_lattice_shapefile
   weights.spw_from_gal
   weights.neighbor_equality

Set Theoretic Weights
+++++++++++++++++++++

.. autosummary::
   :toctree: generated/

   weights.w_union
   weights.w_intersection
   weights.w_difference
   weights.w_symmetric_difference
   weights.w_subset
   weights.w_clip


Spatial Lag
+++++++++++

.. autosummary::
   :toctree: generated/

   weights.lag_spatial
   weights.lag_categorical


cg: Computational Geometry
--------------------------

alpha_shapes
++++++++++++

.. autosummary::
   :toctree: generated/

   cg.alpha_shape
   cg.alpha_shape_auto

voronoi
+++++++

.. autosummary::
   :toctree: generated/

   cg.voronoi_frames


sphere
++++++

.. autosummary::
   :toctree: generated/

   cg.RADIUS_EARTH_KM
   cg.RADIUS_EARTH_MILES
   cg.arcdist
   cg.arcdist2linear
   cg.brute_knn
   cg.fast_knn
   cg.fast_threshold
   cg.linear2arcdist
   cg.toLngLat
   cg.toXYZ
   cg.lonlat
   cg.harcdist
   cg.geointerpolate
   cg.geogrid

shapes
++++++

.. autosummary::
   :toctree: generated/

   cg.Point
   cg.LineSegment
   cg.Line
   cg.Ray
   cg.Chain
   cg.Polygon
   cg.Rectangle
   cg.asShape

standalone
++++++++++

.. autosummary::
   :toctree: generated/

   cg.bbcommon
   cg.get_bounding_box
   cg.get_angle_between
   cg.is_collinear
   cg.get_segments_intersect
   cg.get_segment_point_intersect
   cg.get_polygon_point_intersect
   cg.get_rectangle_point_intersect
   cg.get_ray_segment_intersect
   cg.get_rectangle_rectangle_intersection
   cg.get_polygon_point_dist
   cg.get_points_dist
   cg.get_segment_point_dist
   cg.get_point_at_angle_and_dist
   cg.convex_hull
   cg.is_clockwise
   cg.point_touches_rectangle
   cg.get_shared_segments
   cg.distance_matrix


locators
++++++++

.. autosummary::
   :toctree: generated/

   cg.Grid
   cg.PointLocator
   cg.PolygonLocator


kdtree
++++++

.. autosummary::
   :toctree: generated/

   cg.KDTree


io
--

.. autosummary::
   :toctree: generated/

   io.open
   io.fileio.FileIO


kernels
-------


.. autosummary::
   :toctree: generated/

   kernels.kernel

   

examples
--------


.. autosummary::
   :toctree: generated/

   examples.available
   examples.explain
   examples.get_path
