The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Ushant Suman (23) [Avatar] Offline
Hi all,

I have a point shape file containing some wells lat long and a polygon shapefile I want to know the wells lying in the polygon for this I have used SetSpatialFilter and written the script:

import os
import sys
from osgeo import ogr

from ospybook.vectorplotter import VectorPlotter

feat = ml_lyr.GetNextFeature()
pl_cl = feat.geometry().Clone()
vp = VectorPlotter(False)
vp.plot(ml_cl,'blue', hatch='x')


# close the data source and text file
It draws the plot Now the users are demanding that they should be able to download the plot in their in local desktop Is there is any external python library to publish vectorplotter in web based envoirnment so that when the users browse both the shape files from the client side and save the plot for the future reference.
Ushant Suman
chris.garrard (26) [Avatar] Offline
Instead of using draw(), you can import pyplot and save the figure. Something like this:

import matplotlib.pyplot as plt

vp = VectorPlotter(False)

# Plot your data

# Figure out some filename and save it

Assuming you save it somewhere that's accessible through your web server, the user can then download the file.