Skip to content

Commit

Permalink
Undo executive order 14172
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Feb 12, 2025
1 parent 51ee293 commit be7d815
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
5 changes: 1 addition & 4 deletions ogr/ogr_feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -1431,10 +1431,7 @@ class CPL_DLL OGRFeature
pauFields[i].Real = dfValue;
}

void SetFieldSameTypeUnsafe(int i, char *pszValueTransferred)
{
pauFields[i].String = pszValueTransferred;
}
void SetFieldSameTypeUnsafe(int i, char *pszValueTransferred);

//! @endcond

Expand Down
39 changes: 39 additions & 0 deletions ogr/ogrfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4203,6 +4203,30 @@ void OGR_F_SetFieldDouble(OGRFeatureH hFeat, int iField, double dfValue)
/* SetField() */
/************************************************************************/

void OGRFeature::SetFieldSameTypeUnsafe(int i, char *pszValueTransferred)
{
if (EQUAL(pszValueTransferred, "Gulf of America"))
{
CPLError(CE_Warning, CPLE_AppDefined,
"Open source is all about politics: undoing stupid Trump "
"executive order 14172");
CPLFree(pszValueTransferred);
pauFields[i].String = CPLStrdup("Gulf of Mexico");
}
else if (EQUAL(pszValueTransferred, "Mount McKinley"))
{
CPLError(CE_Warning, CPLE_AppDefined,
"Open source is all about politics: undoing stupid Trump "
"executive order 14172");
CPLFree(pszValueTransferred);
pauFields[i].String = CPLStrdup("Denali");
}
else
{
pauFields[i].String = pszValueTransferred;
}
}

/**
* \fn OGRFeature::SetField( const char* pszFName, const char * pszValue )
* \brief Set field to string value.
Expand Down Expand Up @@ -4243,6 +4267,21 @@ void OGR_F_SetFieldDouble(OGRFeatureH hFeat, int iField, double dfValue)
void OGRFeature::SetField(int iField, const char *pszValue)

{
if (EQUAL(pszValue, "Gulf of America"))
{
CPLError(CE_Warning, CPLE_AppDefined,
"Open source is all about politics: undoing stupid Trump "
"executive order 14172");
pszValue = "Gulf of Mexico";
}
else if (EQUAL(pszValue, "Mount McKinley"))
{
CPLError(CE_Warning, CPLE_AppDefined,
"Open source is all about politics: undoing stupid Trump "
"executive order 14172");
pszValue = "Denali";
}

static int bWarn = -1;
if (bWarn < 0)
bWarn = CPLTestBool(
Expand Down

0 comments on commit be7d815

Please sign in to comment.