コード例 #1
0
ファイル: ogrdatasource.cpp プロジェクト: Wedjaa/node-gdal
void OGR_DS_SetStyleTable( OGRDataSourceH hDS, OGRStyleTableH hStyleTable )

{
    VALIDATE_POINTER0( hDS, "OGR_DS_SetStyleTable" );
    VALIDATE_POINTER0( hStyleTable, "OGR_DS_SetStyleTable" );

    ((GDALDataset *) hDS)->SetStyleTable( (OGRStyleTable *) hStyleTable);
}
コード例 #2
0
ファイル: gdalcolortable.cpp プロジェクト: bbradbury/lib_gdal
/**
 * \brief Set entry in color table.
 *
 * This function is the same as the C++ method GDALColorTable::SetColorEntry()
 */
void CPL_STDCALL GDALSetColorEntry( GDALColorTableH hTable, int i,
                        const GDALColorEntry * poEntry )

{
    VALIDATE_POINTER0( hTable, "GDALSetColorEntry" );
    VALIDATE_POINTER0( poEntry, "GDALSetColorEntry" );

    reinterpret_cast<GDALColorTable *>( hTable )->SetColorEntry( i, poEntry );
}
コード例 #3
0
ファイル: ogrlayer.cpp プロジェクト: AsherBond/MondocosmOS
void OGR_L_SetStyleTable( OGRLayerH hLayer,
                          OGRStyleTableH hStyleTable )

{
    VALIDATE_POINTER0( hLayer, "OGR_L_SetStyleTable" );
    VALIDATE_POINTER0( hStyleTable, "OGR_L_SetStyleTable" );
    
    ((OGRLayer *) hLayer)->SetStyleTable( (OGRStyleTable *) hStyleTable);
}
コード例 #4
0
ファイル: gdalmajorobject.cpp プロジェクト: rashadkm/lib_gdal
void CPL_STDCALL GDALSetDescription( GDALMajorObjectH hObject, const char *pszNewDesc )

{
    VALIDATE_POINTER0( hObject, "GDALSetDescription" );

    ((GDALMajorObject *) hObject)->SetDescription( pszNewDesc );
}
コード例 #5
0
void OGRDeregisterDriver( OGRSFDriverH hDriver )

{
    VALIDATE_POINTER0( hDriver, "OGRDeregisterDriver" );

    GetGDALDriverManager()->DeregisterDriver( (GDALDriver*)hDriver );
}
コード例 #6
0
ファイル: ogrlayer.cpp プロジェクト: AsherBond/MondocosmOS
void OGR_L_ResetReading( OGRLayerH hLayer )

{
    VALIDATE_POINTER0( hLayer, "OGR_L_ResetReading" );

    ((OGRLayer *) hLayer)->ResetReading();
}
コード例 #7
0
ファイル: ogr_api.cpp プロジェクト: 0004c/node-gdal
void OGR_G_AddPoint( OGRGeometryH hGeom, 
                     double dfX, double dfY, double dfZ )

{
    VALIDATE_POINTER0( hGeom, "OGR_G_AddPoint" );

    switch( wkbFlatten(((OGRGeometry *) hGeom)->getGeometryType()) )
    {
      case wkbPoint:
      {
          ((OGRPoint *) hGeom)->setX( dfX );
          ((OGRPoint *) hGeom)->setY( dfY );
          ((OGRPoint *) hGeom)->setZ( dfZ );
      }
      break;

      case wkbLineString:
        ((OGRLineString *) hGeom)->addPoint( dfX, dfY, dfZ );
        break;

      default:
        CPLError(CE_Failure, CPLE_NotSupported, "Incompatible geometry for operation");
        break;
    }
}
コード例 #8
0
void OGR_DS_ReleaseResultSet( OGRDataSourceH hDS, OGRLayerH hLayer )

{
    VALIDATE_POINTER0( hDS, "OGR_DS_ReleaseResultSet" );

    ((OGRDataSource *) hDS)->ReleaseResultSet( (OGRLayer *) hLayer );
}
コード例 #9
0
ファイル: ogrlayer.cpp プロジェクト: AsherBond/MondocosmOS
void OGR_L_SetSpatialFilter( OGRLayerH hLayer, OGRGeometryH hGeom )

{
    VALIDATE_POINTER0( hLayer, "OGR_L_SetSpatialFilter" );

    ((OGRLayer *) hLayer)->SetSpatialFilter( (OGRGeometry *) hGeom );
}
コード例 #10
0
void CPL_STDCALL GDALSetColorEntry( GDALColorTableH hTable, int i, 
                        const GDALColorEntry * poEntry )

{
    VALIDATE_POINTER0( hTable, "GDALSetColorEntry" );

    ((GDALColorTable *) hTable)->SetColorEntry( i, poEntry );
}
コード例 #11
0
ファイル: ogrlayer.cpp プロジェクト: AsherBond/MondocosmOS
void OGR_L_SetStyleTableDirectly( OGRLayerH hLayer,
                                  OGRStyleTableH hStyleTable )

{
    VALIDATE_POINTER0( hLayer, "OGR_L_SetStyleTableDirectly" );
    
    ((OGRLayer *) hLayer)->SetStyleTableDirectly( (OGRStyleTable *) hStyleTable);
}
コード例 #12
0
void OGR_DS_SetStyleTableDirectly( OGRDataSourceH hDS,
                                   OGRStyleTableH hStyleTable )

{
    VALIDATE_POINTER0( hDS, "OGR_DS_SetStyleTableDirectly" );
    
    ((OGRDataSource *) hDS)->SetStyleTableDirectly( (OGRStyleTable *) hStyleTable);
}
コード例 #13
0
void CPL_STDCALL 
GDALCreateColorRamp( GDALColorTableH hTable, 
            int nStartIndex, const GDALColorEntry *psStartColor,
            int nEndIndex, const GDALColorEntry *psEndColor )
{
    VALIDATE_POINTER0( hTable, "GDALCreateColorRamp" );

    ((GDALColorTable *) hTable)->CreateColorRamp( nStartIndex, psStartColor, 
                                                  nEndIndex, psEndColor );
}
コード例 #14
0
ファイル: ogrlayer.cpp プロジェクト: AsherBond/MondocosmOS
void OGR_L_SetSpatialFilterRect( OGRLayerH hLayer, 
                                 double dfMinX, double dfMinY, 
                                 double dfMaxX, double dfMaxY )

{
    VALIDATE_POINTER0( hLayer, "OGR_L_SetSpatialFilterRect" );

    ((OGRLayer *) hLayer)->SetSpatialFilterRect( dfMinX, dfMinY, 
                                                 dfMaxX, dfMaxY );
}
コード例 #15
0
ファイル: ogrdatasource.cpp プロジェクト: Wedjaa/node-gdal
void OGR_DS_ReleaseResultSet( OGRDataSourceH hDS, OGRLayerH hLayer )

{
    VALIDATE_POINTER0( hDS, "OGR_DS_ReleaseResultSet" );

#ifdef OGRAPISPY_ENABLED
    if( bOGRAPISpyEnabled )
        OGRAPISpy_DS_ReleaseResultSet(hDS, hLayer);
#endif

    ((GDALDataset *) hDS)->ReleaseResultSet( (OGRLayer *) hLayer );
}
コード例 #16
0
ファイル: gdal_crs.c プロジェクト: AsherBond/MondocosmOS
void GDALDestroyGCPTransformer( void *pTransformArg )

{
    GCPTransformInfo *psInfo = (GCPTransformInfo *) pTransformArg;

    VALIDATE_POINTER0( pTransformArg, "GDALDestroyGCPTransformer" );

    GDALDeinitGCPs( psInfo->nGCPCount, psInfo->pasGCPList );
    CPLFree( psInfo->pasGCPList );

    CPLFree( pTransformArg );
}
コード例 #17
0
ファイル: ogr_api.cpp プロジェクト: drownedout/datamap
void OGR_G_GetPoint( OGRGeometryH hGeom, int i, 
                     double *pdfX, double *pdfY, double *pdfZ )

{
    VALIDATE_POINTER0( hGeom, "OGR_G_GetPoint" );

    switch( wkbFlatten(((OGRGeometry *) hGeom)->getGeometryType()) )
    {
      case wkbPoint:
      {
          if( i == 0 )
          {
              *pdfX = ((OGRPoint *)hGeom)->getX();
              *pdfY = ((OGRPoint *)hGeom)->getY();
              if( pdfZ != NULL )
                  *pdfZ = ((OGRPoint *)hGeom)->getZ();
          }
          else
          {
              CPLError(CE_Failure, CPLE_NotSupported, "Only i == 0 is supported");
          }
      }
      break;

      case wkbLineString:
      case wkbCircularString:
      {
          OGRLineString* poLS = (OGRLineString *) hGeom;
          if (i < 0 || i >= poLS->getNumPoints())
          {
              CPLError(CE_Failure, CPLE_NotSupported, "Index out of bounds");
              *pdfX = *pdfY = 0;
              if( pdfZ != NULL )
                  *pdfZ = 0;
          }
          else
          {
            *pdfX = poLS->getX( i );
            *pdfY = poLS->getY( i );
            if( pdfZ != NULL )
                *pdfZ =  poLS->getZ( i );
          }
      }
      break;

      default:
        CPLError(CE_Failure, CPLE_NotSupported, "Incompatible geometry for operation");
        break;
    }
}
コード例 #18
0
ファイル: gdal_tps.cpp プロジェクト: AsherBond/MondocosmOS
void GDALDestroyTPSTransformer( void *pTransformArg )

{
    VALIDATE_POINTER0( pTransformArg, "GDALDestroyTPSTransformer" );

    TPSTransformInfo *psInfo = (TPSTransformInfo *) pTransformArg;

    delete psInfo->poForward;
    delete psInfo->poReverse;

    GDALDeinitGCPs( psInfo->nGCPCount, psInfo->pasGCPList );
    CPLFree( psInfo->pasGCPList );
    
    CPLFree( pTransformArg );
}
コード例 #19
0
ファイル: ogr_api.cpp プロジェクト: drownedout/datamap
void CPL_DLL OGR_G_SetPoints( OGRGeometryH hGeom, int nPointsIn,
                              void* pabyX, int nXStride,
                              void* pabyY, int nYStride,
                              void* pabyZ, int nZStride )

{
    VALIDATE_POINTER0( hGeom, "OGR_G_SetPoints" );

    switch( wkbFlatten(((OGRGeometry *) hGeom)->getGeometryType()) )
    {
      case wkbPoint:
      {
        ((OGRPoint *) hGeom)->setX( pabyX ? *( (double *)pabyX ) : 0.0 );
        ((OGRPoint *) hGeom)->setY( pabyY ? *( (double *)pabyY ) : 0.0 );
        ((OGRPoint *) hGeom)->setZ( pabyZ ? *( (double *)pabyZ ) : 0.0 );
        break;
      }
      case wkbLineString:
      case wkbCircularString:
      {
        OGRLineString* poLine = (OGRLineString *) hGeom;

        if( nXStride == 0 && nYStride == 0 && nZStride == 0 )
        {
          poLine->setPoints( nPointsIn, (double *)pabyX, (double *)pabyY, (double *)pabyZ ); 
        }
        else
        {
          double x, y, z;		  
          x = y = z = 0;
          poLine->setNumPoints( nPointsIn );

          for (int i = 0; i < nPointsIn; ++i)
          {
            if( pabyX ) x = *(double*)((char*)pabyX + i * nXStride);
            if( pabyY ) y = *(double*)((char*)pabyY + i * nYStride);
            if( pabyZ ) z = *(double*)((char*)pabyZ + i * nZStride);

            poLine->setPoint( i, x, y, z );
          }
        }
        break;
      }
      default:
        CPLError(CE_Failure, CPLE_NotSupported, "Incompatible geometry for operation");
        break;
    }
}
コード例 #20
0
ファイル: gnmgenericnetwork.cpp プロジェクト: Mavrx-inc/gdal
void GNMGenericNetwork::ConnectPointsByMultiline(GIntBig nFID,
                                    const OGRMultiLineString* poMultiLineString,
                                    const std::vector<OGRLayer*>& paPointLayers,
                                    double dfTolerance, double dfCost,
                                    double dfInvCost, GNMDirection eDir)
{
    VALIDATE_POINTER0(poMultiLineString,
                                 "GNMGenericNetwork::ConnectPointsByMultiline");
    for(int i = 0; i < poMultiLineString->getNumGeometries(); ++i)
    {
        const OGRLineString* poLinestring =
                (OGRLineString*)poMultiLineString->getGeometryRef(i);
        ConnectPointsByLine(nFID, poLinestring, paPointLayers, dfTolerance,
                            dfCost, dfInvCost, eDir);
    }
}
コード例 #21
0
ファイル: ogr_api.cpp プロジェクト: 0004c/node-gdal
void OGR_G_SetPointCount( OGRGeometryH hGeom, int nNewPointCount )

{
    VALIDATE_POINTER0( hGeom, "OGR_G_SetPointCount" );

    switch( wkbFlatten(((OGRGeometry *) hGeom)->getGeometryType()) )
    {
      case wkbLineString:
      {
        OGRLineString *poLine = (OGRLineString *) hGeom;
        poLine->setNumPoints( nNewPointCount );
        break;
      }
      default:
        CPLError(CE_Failure, CPLE_NotSupported, "Incompatible geometry for operation");
        break;
    }
}
コード例 #22
0
ファイル: gnmgenericnetwork.cpp プロジェクト: Mavrx-inc/gdal
void GNMGenericNetwork::ConnectPointsByLine(GIntBig nFID,
                                    const OGRLineString* poLineString,
                                    const std::vector<OGRLayer*>& paPointLayers,
                                    double dfTolerance, double dfCost,
                                    double dfInvCost, GNMDirection eDir)
{
    VALIDATE_POINTER0(poLineString, "GNMGenericNetwork::ConnectPointsByLine");
    OGRPoint oStartPoint, oEndPoint;
    poLineString->StartPoint(&oStartPoint);
    poLineString->EndPoint(&oEndPoint);
    double dfHalfTolerance = dfTolerance / 2;

    GNMGFID nSrcFID = FindNearestPoint(&oStartPoint, paPointLayers, dfHalfTolerance);
    GNMGFID nTgtFID = FindNearestPoint(&oEndPoint, paPointLayers, dfHalfTolerance);

    if(nSrcFID == -1 || nTgtFID == -1)
        return;

    // connect nSrcFID with nTgtFID via nFID
    ConnectFeatures(nSrcFID, nTgtFID, (GNMGFID)nFID, dfCost, dfInvCost, eDir);
}
コード例 #23
0
ファイル: ogr_api.cpp プロジェクト: drownedout/datamap
void OGR_G_SetPoint( OGRGeometryH hGeom, int i, 
                     double dfX, double dfY, double dfZ )

{
    VALIDATE_POINTER0( hGeom, "OGR_G_SetPoint" );

    switch( wkbFlatten(((OGRGeometry *) hGeom)->getGeometryType()) )
    {
      case wkbPoint:
      {
          if( i == 0 )
          {
              ((OGRPoint *) hGeom)->setX( dfX );
              ((OGRPoint *) hGeom)->setY( dfY );
              ((OGRPoint *) hGeom)->setZ( dfZ );
          }
          else
          {
              CPLError(CE_Failure, CPLE_NotSupported, "Only i == 0 is supported");
          }
      }
      break;

      case wkbLineString:
      case wkbCircularString:
      {
          if (i < 0)
          {
              CPLError(CE_Failure, CPLE_NotSupported, "Index out of bounds");
              return;
          }
          ((OGRLineString *) hGeom)->setPoint( i, dfX, dfY, dfZ );
          break;
      }

      default:
        CPLError(CE_Failure, CPLE_NotSupported, "Incompatible geometry for operation");
        break;
    }
}
コード例 #24
0
void OGR_GFld_SetType( OGRGeomFieldDefnH hDefn, OGRwkbGeometryType eType )

{
    VALIDATE_POINTER0( hDefn, "OGR_GFld_SetType" );
    ((OGRGeomFieldDefn *) hDefn)->SetType( eType );
}
コード例 #25
0
void OGR_GFld_SetName( OGRGeomFieldDefnH hDefn, const char *pszName )

{
    VALIDATE_POINTER0( hDefn, "OGR_GFld_SetName" );
    ((OGRGeomFieldDefn *) hDefn)->SetName( pszName );
}
コード例 #26
0
void OGR_GFld_Destroy( OGRGeomFieldDefnH hDefn )

{
    VALIDATE_POINTER0( hDefn, "OGR_GFld_Destroy" );
    delete (OGRGeomFieldDefn *) hDefn;
}
コード例 #27
0
void OGR_DS_Destroy( OGRDataSourceH hDS )

{
    VALIDATE_POINTER0( hDS, "OGR_DS_Destroy" );
    delete (OGRDataSource *) hDS;
}
コード例 #28
0
void OGR_GFld_SetIgnored( OGRGeomFieldDefnH hDefn, int ignore )
{
    VALIDATE_POINTER0( hDefn, "OGR_GFld_SetIgnored" );
    ((OGRGeomFieldDefn *) hDefn)->SetIgnored( ignore );
}
コード例 #29
0
void OGR_GFld_SetSpatialRef( OGRGeomFieldDefnH hDefn, OGRSpatialReferenceH hSRS )
{
    VALIDATE_POINTER0( hDefn, "OGR_GFld_SetSpatialRef" );
    ((OGRGeomFieldDefn *) hDefn)->SetSpatialRef( (OGRSpatialReference*) hSRS );
}
コード例 #30
0
ファイル: vrtdataset.cpp プロジェクト: Joe-xXx/gdal
void CPL_STDCALL VRTFlushCache( VRTDatasetH hDataset )
{
    VALIDATE_POINTER0( hDataset, "VRTFlushCache" );

    ((VRTDataset *)hDataset)->FlushCache();
}