Oslandia / qgis-swmm

Project migrated to : https://gitlab.com/Oslandia/qgis/qgis-swmm
https://gitlab.com/Oslandia/qgis/qgis-swmm
GNU General Public License v2.0
34 stars 19 forks source link

Possible Collaboration with Open Water Analytics #13

Closed bemcdonnell closed 7 years ago

bemcdonnell commented 7 years ago

Great initiative!

I wanted to reach out to your group and present a possible collaborative opportunity for a couple of projects we have going on at Open Water Analytics.

https://github.com/OpenWaterAnalytics/Stormwater-Management-Model https://github.com/OpenWaterAnalytics/pyswmm

By interfacing directly with PySWMM, you might be able to allocate your resources on linking this to QGIS, directly. Which will be absolutely awesome!

We are collaborating with USEPA to extend functionality of SWMM. OpenWaterAnalytics is leading an open source development initiative for both SWMM and EPANET.

SWMM at Open Water Analytics

One of our larger projects has been adding an API to SWMM which will support initiatives like yours. The philosphy with this project is to work directly in SWMM's data model as opposed to duplicating it in another language.

int DLLEXPORT  swmm_getSimulationUnit(int type, int *value);
int DLLEXPORT  swmm_getSimulationAnalysisSetting(int type, int *value);
int DLLEXPORT  swmm_getSimulationParam(int type, double *value);

int DLLEXPORT  swmm_countObjects(int type, int *count);
int DLLEXPORT  swmm_getObjectId(int type, int index, char *id);

int DLLEXPORT  swmm_getNodeType(int index, int *Ntype);
int DLLEXPORT  swmm_getLinkType(int index, int *Ltype);

int DLLEXPORT  swmm_getLinkConnections(int index, int *Node1, int *Node2);
int DLLEXPORT  swmm_getSubcatchOutConnection(int index, int *type, int *Index );

//Nodes
int DLLEXPORT  swmm_getNodeParam(int index, int Param, double *value);
int DLLEXPORT  swmm_setNodeParam(int index, int Param, double value);
//Links
int DLLEXPORT  swmm_getLinkParam(int index, int Param, double *value);
int DLLEXPORT  swmm_setLinkParam(int index, int Param, double value);
int DLLEXPORT  swmm_getLinkDirection(int index, signed char *value);
//Subcatchments
int DLLEXPORT  swmm_getSubcatchParam(int index, int Param, double *value);
int DLLEXPORT  swmm_setSubcatchParam(int index, int Param, double value);
// 
int DLLEXPORT swmm_getSimulationDateTime(int timetype, int *year, int *month, int *day,
    int *hour, int *minute, int *seconds);
int DLLEXPORT  swmm_setSimulationDateTime(int timetype, char *dtimestr);

//-------------------------------
// Active Simulation Results API
//-------------------------------
int DLLEXPORT swmm_getCurrentDateTimeStr(char *dtimestr);

int DLLEXPORT swmm_getNodeStats(int index, TNodeStats *nodeStats);
int DLLEXPORT swmm_getStorageStats(int index, TStorageStats *storageStats);
int DLLEXPORT swmm_getOutfallStats(int index, TOutfallStats *outfallStats);
void DLLEXPORT swmm_freeOutfallStats(TOutfallStats *outfallStats);

int DLLEXPORT swmm_getLinkStats(int index, TLinkStats *linkStats);
int DLLEXPORT swmm_getPumpStats(int index, TPumpStats *pumpStats);

int DLLEXPORT swmm_getSubcatchStats(int index, TSubcatchStats *subcatchStats);

int DLLEXPORT swmm_getSystemRoutingStats(TRoutingTotals *routingTot);
int DLLEXPORT swmm_getSystemRunoffStats(TRunoffTotals *runoffTot);

//-------------------------------
// Setters API
//-------------------------------
int DLLEXPORT swmm_setLinkSetting(int index, double setting);
int DLLEXPORT swmm_setNodeInflow(int index, double flowrate);

PySWMM

Since it looks like this project has Python Roots, you might want to look into PySWMM: https://github.com/OpenWaterAnalytics/pyswmm

vmora commented 7 years ago

@bemcdonnell thanks for the pointer.