Skip to content

Commit

Permalink
[GRASS][FEATURE] vector import via browser drag and drop
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed May 18, 2015
1 parent e474e09 commit 7091d3b
Show file tree
Hide file tree
Showing 10 changed files with 881 additions and 91 deletions.
24 changes: 23 additions & 1 deletion src/providers/grass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,24 @@ MACRO(ADD_GRASSLIB GRASS_BUILD_VERSION)
)
ENDIF (GRASS_MAJOR_VERSION LESS 7 )

#
# grass vector import module
#
ADD_EXECUTABLE(qgis.v.in${GRASS_BUILD_VERSION} ../qgis.v.in.cpp)
SET_TARGET_PROPERTIES(qgis.v.in${GRASS_BUILD_VERSION} PROPERTIES
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" \"-DGRASS_LIB_EXPORT=${DLLEXPORT}\" \"-DGRASS_EXPORT=${DLLIMPORT}\""
)
TARGET_LINK_LIBRARIES(qgis.v.in${GRASS_BUILD_VERSION}
qgisgrass${GRASS_BUILD_VERSION}
${GRASS_LIBRARY${GRASS_BUILD_VERSION}_gis}
${GRASS_LIBRARY${GRASS_BUILD_VERSION}_datetime}
${GRASS_LIBRARY${GRASS_BUILD_VERSION}_vect}
${GRASS_LIBRARY${GRASS_BUILD_VERSION}_dbmibase}
${GRASS_LIBRARY${GRASS_BUILD_VERSION}_dbmiclient}
${GDAL_LIBRARY}
qgis_core
)

########################################################
# Install

Expand All @@ -188,7 +206,11 @@ MACRO(ADD_GRASSLIB GRASS_BUILD_VERSION)
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})

INSTALL(TARGETS qgis.d.rast${GRASS_BUILD_VERSION} qgis.g.info${GRASS_BUILD_VERSION} qgis.r.in${GRASS_BUILD_VERSION}
INSTALL(TARGETS
qgis.d.rast${GRASS_BUILD_VERSION}
qgis.g.info${GRASS_BUILD_VERSION}
qgis.r.in${GRASS_BUILD_VERSION}
qgis.v.in${GRASS_BUILD_VERSION}
RUNTIME DESTINATION ${QGIS_LIBEXEC_DIR}/grass/modules
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
Expand Down
13 changes: 1 addition & 12 deletions src/providers/grass/qgis.r.in.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ extern "C"
#include "qgsrasterblock.h"
#include "qgsgrass.h"

//#ifdef _MSC_VER
//#define INFINITY (DBL_MAX+DBL_MAX)
//#define NAN (INFINITY-INFINITY)
//#endif

#if GRASS_VERSION_MAJOR >= 7
#define G_allocate_raster_buf Rast_allocate_buf
#define G_close_cell Rast_close
Expand All @@ -68,15 +63,13 @@ extern "C"
int main( int argc, char **argv )
{
char *name;
struct GModule *module;
struct Option *map;
struct Cell_head window;
int cf;

G_gisinit( argv[0] );

module = G_define_module();
module->description = ( "Output raster map layers in a format suitable for display in QGIS" );
G_define_module();

map = G_define_standard_option( G_OPT_R_OUTPUT );

Expand All @@ -94,9 +87,6 @@ int main( int argc, char **argv )
qint32 rows, cols;
stdinStream >> extent >> cols >> rows;

//G_fatal_error("i = %d", i);
//G_fatal_error( extent.toString().toAscii().data() );

QString err = QgsGrass::setRegion( &window, extent, rows, cols );
if ( !err.isEmpty() )
{
Expand All @@ -107,7 +97,6 @@ int main( int argc, char **argv )

QGis::DataType qgis_type;
qint32 type;
//stdinStream >> grass_type;
stdinStream >> type;
qgis_type = ( QGis::DataType )type;

Expand Down
Loading

0 comments on commit 7091d3b

Please sign in to comment.