PySAL scripts not running

07-19-2016 04:13 PM
New Contributor II

Hi all
I recently downloaded pysal subpackages and added several of its scripts (here).
Nonetheless, I have not been able to run any of these scripts because the tools "have no parameters".
I am very new at this.
Does anyone know how should I input the parameters for these tools or where can I see the process?
Thanks in advance

0 Kudos
4 Replies
MVP Esteemed Contributor

that is a library... there are not tools that I can see, you can use the functions in the package.  For example

cg.shapes — Shapes — Python Spatial Analysis Library

in the shapes section, for example, there are code snippets showing how to use the materials... The posted example shows you to make a line segment from two points, which consist of x,y coordinates.  From there, you can get the extents of the bounding box.

>>> ls = LineSegment(Point((1, 2)), Point((5, 6)))

>>> ls.bounding_box.left


>>> ls.bounding_box.lower


>>> ls.bounding_box.right


>>> ls.bounding_box.upper


0 Kudos
New Contributor II

My apologies, as I said, I'm REALLY new at this stuff.

I found this PySAL toolbox for ArcGIS and here I found some scripts and thought I could use them.
Currently I am struggling with doing a maxp regionalization but I have no idea on how to set the parameters.

I have a shapefile containing 2,457 counties with data on population and homicides.

0 Kudos
MVP Esteemed Contributor

The lines of code are given in the examples.

The requirements are given in the class definition and the code examples are given in subsequent lines.

You have to emulate... there is no exact example to your condition,

Do you have a python window open?  aka a python IDE where you can enter code?

It may or may not have a >>> command prompt but will look different if you are using IPython for instance.

Is this still  too complex? If so, you may have to retreat to basic information on python and its use and there are tons of resources on python on the web.

0 Kudos
MVP Esteemed Contributor

there tutorial accordin Dr Google, for example

Introduction to the Tutorials — Python Spatial Analysis Library

0 Kudos