mirror of
https://gitlab.com/Trygve/contour-creator.git
synced 2026-03-14 16:04:04 +00:00
Compare commits
19 Commits
d046e18c43
...
Statistics
| Author | SHA1 | Date | |
|---|---|---|---|
| 97c52ecef3 | |||
|
|
c47565eabb | ||
| ec0a31db5d | |||
|
|
32a0b18f8e | ||
|
|
ab96f9477e | ||
| 790cf44f8b | |||
| df7cac1095 | |||
| 93fcbc6a39 | |||
| 95649f005b | |||
| 1ec3e8c778 | |||
| c535eec958 | |||
| 4f709d3b07 | |||
| 4cd4f773bf | |||
| 9d8df3256d | |||
|
|
77467594bd | ||
| 0188b9e29d | |||
| b800ceaf98 | |||
| 1dcfb0e737 | |||
|
|
228945a767 |
BIN
documentation/kurver_ås.png
Normal file
BIN
documentation/kurver_ås.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
3092
documentation/ms_wikipedia.svg
Normal file
3092
documentation/ms_wikipedia.svg
Normal file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 88 KiB |
@@ -5,16 +5,31 @@ author:
|
|||||||
- Trygve og Esther
|
- Trygve og Esther
|
||||||
|
|
||||||
---
|
---
|
||||||
# What are contours
|
|
||||||
|
|
||||||
# Output of our program
|
# Output of our program:
|
||||||
pretty pictures
|

|
||||||
|
|
||||||
|
# Marching squares
|
||||||
|

|
||||||
|
|
||||||
# The logical flow of our program
|
# The logical flow of our program
|
||||||
flowchart
|
```cpp
|
||||||
|
int main(int argc, const char* argv[])
|
||||||
# GDAL
|
{
|
||||||
What is it?
|
const char* filepath = argv[1];
|
||||||
|
HeightMap map(filepath);
|
||||||
|
map.blur(0.8)
|
||||||
|
auto lines = create_lines(&map, 5);
|
||||||
|
write_output_file(cellmaps, "out.geojson", &map);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
# Performance
|
# Performance
|
||||||
show the benchmarks
|
| | Time |
|
||||||
|
|--------------------|--------------------|
|
||||||
|
| 12 threads | 41s |
|
||||||
|
| 1 thread | 116s |
|
||||||
|
|
||||||
|
|
||||||
|
# Problems we encountered
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include <cstddef>
|
||||||
#include <gdal/cpl_conv.h>
|
#include <gdal/cpl_conv.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@@ -5,7 +6,7 @@
|
|||||||
#include <gdal/gdal.h>
|
#include <gdal/gdal.h>
|
||||||
#include "gdal/gdal_priv.h"
|
#include "gdal/gdal_priv.h"
|
||||||
#include <gdal/gdal_frmts.h>
|
#include <gdal/gdal_frmts.h>
|
||||||
|
//#include "matplotlibcpp.h"
|
||||||
#include "contour_creator.hh"
|
#include "contour_creator.hh"
|
||||||
|
|
||||||
|
|
||||||
@@ -32,6 +33,7 @@ HeightMap::HeightMap(const char* filepath)
|
|||||||
//https://gdal.org/api/gdaldataset_cpp.html#_CPPv4N11GDALDataset15GetGeoTransformEPd
|
//https://gdal.org/api/gdaldataset_cpp.html#_CPPv4N11GDALDataset15GetGeoTransformEPd
|
||||||
this->geotransform = (double *) CPLMalloc(sizeof(double)*6);
|
this->geotransform = (double *) CPLMalloc(sizeof(double)*6);
|
||||||
this->reference_system = *(file->GetSpatialRef());
|
this->reference_system = *(file->GetSpatialRef());
|
||||||
|
this->filepath = filepath;
|
||||||
|
|
||||||
file->GetGeoTransform(this->geotransform);
|
file->GetGeoTransform(this->geotransform);
|
||||||
|
|
||||||
@@ -41,6 +43,7 @@ HeightMap::HeightMap(const char* filepath)
|
|||||||
0, 0 );
|
0, 0 );
|
||||||
if (error) { throw std::runtime_error("Could not read tif file!"); }
|
if (error) { throw std::runtime_error("Could not read tif file!"); }
|
||||||
band->FlushCache();
|
band->FlushCache();
|
||||||
|
const int size = this->width*this->height;
|
||||||
}
|
}
|
||||||
float HeightMap::get_pixel(int x, int y)
|
float HeightMap::get_pixel(int x, int y)
|
||||||
{
|
{
|
||||||
@@ -62,7 +65,7 @@ void HeightMap::blur(float standard_deviation)
|
|||||||
*(kernel + i) = 1.0;
|
*(kernel + i) = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
float* blurred = (float *) CPLMalloc(sizeof(float)*this->width*this->height);
|
float* blurred = new float[this->width*this->height];
|
||||||
#pragma omp parallel
|
#pragma omp parallel
|
||||||
{
|
{
|
||||||
#pragma omp for
|
#pragma omp for
|
||||||
@@ -91,3 +94,100 @@ void HeightMap::blur(float standard_deviation)
|
|||||||
this->data = blurred;
|
this->data = blurred;
|
||||||
blurred = nullptr;
|
blurred = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HeightMap::statistics()
|
||||||
|
{
|
||||||
|
|
||||||
|
float avg = 0;
|
||||||
|
float var = 0;
|
||||||
|
float std = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < this->width*this->height; i++)
|
||||||
|
{int x = i%this->width;
|
||||||
|
int y = i/this->width;
|
||||||
|
if (x<0 || x>=this->width)
|
||||||
|
{
|
||||||
|
x = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (y<0 || y>=this->height)
|
||||||
|
{
|
||||||
|
y = 0;
|
||||||
|
}
|
||||||
|
avg += this->get_pixel(x, y);}
|
||||||
|
//std::cout << this->get_pixel(x, y);}
|
||||||
|
|
||||||
|
avg = avg/(this->width*this->height);
|
||||||
|
std::cout << "Average value: " << avg <<"\n";
|
||||||
|
|
||||||
|
for (int i = 0; i < this->width*this->height; i++)
|
||||||
|
{
|
||||||
|
int x = i%this->width;
|
||||||
|
int y = i/this->width;
|
||||||
|
var += (avg - this->get_pixel(x, y))*(avg - this->get_pixel(x, y));
|
||||||
|
}
|
||||||
|
std = sqrt(var)/(this->width*this->height-1);
|
||||||
|
var = var / (this->width*this->height-1);
|
||||||
|
std::cout << "std: " << std << "\n";
|
||||||
|
std::cout << "var: " << var << "\n";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void HeightMap::calculate_steepness()
|
||||||
|
{
|
||||||
|
int kernel_height = 5;
|
||||||
|
int kernel_width = 5;
|
||||||
|
int kernel_size = kernel_height*kernel_width;
|
||||||
|
|
||||||
|
float* kernel = new float[sizeof(float)*kernel_size];
|
||||||
|
float* steepness = new float[this->width*this->height];
|
||||||
|
#pragma omp parallel
|
||||||
|
{
|
||||||
|
#pragma omp for
|
||||||
|
for (int i = 0; i < this->height * this->width; i++)
|
||||||
|
{
|
||||||
|
int x = i%this->width;
|
||||||
|
int y = i/this->width;
|
||||||
|
float max = 0;
|
||||||
|
float min = 0;
|
||||||
|
for (int j = 0; j < kernel_size; j++)
|
||||||
|
{
|
||||||
|
if (this->get_pixel(x, y) > max)
|
||||||
|
{
|
||||||
|
max = get_pixel(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->get_pixel(x, y) < min)
|
||||||
|
{
|
||||||
|
min = get_pixel(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x<0 || x>=this->width)
|
||||||
|
{
|
||||||
|
x = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (y<0 || y>=this->height)
|
||||||
|
{
|
||||||
|
y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
steepness[i] = max - min;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GDALAllRegister();
|
||||||
|
GDALDataset *original_file = (GDALDataset *) GDALOpen( filepath, GA_ReadOnly );
|
||||||
|
|
||||||
|
const char * filename = "steepness.tif";
|
||||||
|
auto driver = GetGDALDriverManager()->GetDriverByName("GeoRaster");
|
||||||
|
GDALDataset *file;
|
||||||
|
file = driver->CreateCopy("steepness.tif", original_file, FALSE, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
file->AddBand(GDT_Float32, NULL);
|
||||||
|
GDALRasterBand *band = file->GetRasterBand(0);
|
||||||
|
CPLErr error = band->RasterIO( GF_Write, 0, 0, this->width, this->height,
|
||||||
|
steepness, this->width, this->height, GDT_Float32,
|
||||||
|
0, 0 );
|
||||||
|
GDALClose(file);
|
||||||
|
}
|
||||||
@@ -16,10 +16,12 @@ class HeightMap
|
|||||||
float min; //!< Minimum value in image
|
float min; //!< Minimum value in image
|
||||||
float max; //!< Maximum value in image
|
float max; //!< Maximum value in image
|
||||||
OGRSpatialReference reference_system;
|
OGRSpatialReference reference_system;
|
||||||
|
|
||||||
HeightMap(const char* filepath);
|
HeightMap(const char* filepath);
|
||||||
|
const char* filepath;
|
||||||
float get_pixel(int x,int y);
|
float get_pixel(int x,int y);
|
||||||
void blur(float standard_deviation);
|
void blur(float standard_deviation);
|
||||||
|
void statistics();
|
||||||
|
void calculate_steepness();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,10 +45,10 @@ class Point
|
|||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
int mscase;
|
int mscase;
|
||||||
|
bool allocated = false;
|
||||||
Point(int x, int y, int mscase){
|
Point(int x, int y, int mscase){
|
||||||
this -> x = x;
|
this -> x = x;
|
||||||
this -> y = y;
|
this -> y = y;
|
||||||
this -> mscase = mscase;
|
this -> mscase = mscase;
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
143
src/main.cpp
143
src/main.cpp
@@ -12,35 +12,32 @@
|
|||||||
#include "gdal/gdal_priv.h"
|
#include "gdal/gdal_priv.h"
|
||||||
#include <gdal/gdal_frmts.h>
|
#include <gdal/gdal_frmts.h>
|
||||||
#include <omp.h>
|
#include <omp.h>
|
||||||
|
//#include "matplotlibcpp.h"
|
||||||
|
//namespace plt = matplotlibcpp;
|
||||||
|
|
||||||
std::vector<Point> produce_cellmap(HeightMap* heightmap, float z)
|
std::vector<Point> produce_cellmap(HeightMap* heightmap, float z)
|
||||||
{
|
{
|
||||||
int length = (heightmap->width-1)*(heightmap->height-1);
|
int length = (heightmap->width-1)*(heightmap->height-1); // Defining length of vector
|
||||||
uint8_t *cells = (uint8_t *) CPLMalloc(sizeof(uint8_t)*length);
|
uint8_t *cells = (uint8_t *) CPLMalloc(sizeof(uint8_t)*length);
|
||||||
std::vector<Point> points;
|
std::vector<Point> points; // Initiating a vector of points
|
||||||
for (int i = 0; i<length; i++) {
|
for (int i = 0; i<length; i++) {
|
||||||
int y = i/(heightmap->width-1);
|
int y = i/(heightmap->width-1);
|
||||||
int x = i%(heightmap->width-1);
|
int x = i%(heightmap->width-1);
|
||||||
uint8_t result = (heightmap->get_pixel(x,y)>z) +
|
uint8_t result = (heightmap->get_pixel(x,y)>z)*8 +
|
||||||
(heightmap->get_pixel(x+1,y)>z)*2 +
|
(heightmap->get_pixel(x+1,y)>z)*4 +
|
||||||
(heightmap->get_pixel(x+1,y+1)>z)*4 +
|
(heightmap->get_pixel(x+1,y+1)>z)*2 +
|
||||||
(heightmap->get_pixel(x,y+1)>z)*8;
|
(heightmap->get_pixel(x,y+1)>z);
|
||||||
if (result != 0 and result != 15 ) {
|
if (result != 0 and result != 15 ) {
|
||||||
points.push_back(Point(x, y, result));
|
points.push_back(Point(x, y, result));
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return points;
|
return points;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::vector<Point>> vector_cellmap(HeightMap* heightmap, int interval)
|
std::vector<std::vector<Point>> create_lines(HeightMap* heightmap, int interval)
|
||||||
{
|
{
|
||||||
int num_contours = (heightmap->max - heightmap->min)/interval;
|
int num_contours = (heightmap->max - heightmap->min)/interval;
|
||||||
std::vector<std::vector<Point>> vector_contours;
|
std::vector<std::vector<Point>> vector_contours;
|
||||||
omp_set_num_threads(12);
|
|
||||||
|
|
||||||
#pragma omp parallel
|
#pragma omp parallel
|
||||||
{
|
{
|
||||||
@@ -48,11 +45,75 @@ std::vector<std::vector<Point>> vector_cellmap(HeightMap* heightmap, int interva
|
|||||||
#pragma omp for
|
#pragma omp for
|
||||||
for (int i = 1; i <= num_contours; i++)
|
for (int i = 1; i <= num_contours; i++)
|
||||||
{
|
{
|
||||||
vec_private.push_back(produce_cellmap(heightmap, heightmap->min + interval*i));
|
auto points = produce_cellmap(heightmap, heightmap->min + interval*i);
|
||||||
|
std::vector<Point> line;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int points_allocated = 0;
|
||||||
|
x = points[0].x;
|
||||||
|
y = points[0].y;
|
||||||
|
points[0].allocated = true;
|
||||||
|
line.push_back(points[0]);
|
||||||
|
for (int j = 0; j < points.size(); j++){
|
||||||
|
for (int k = 0; k < points.size(); k++){
|
||||||
|
Point* candidate = &points[k];
|
||||||
|
if (!candidate->allocated) {
|
||||||
|
if (candidate->x == x +1 && candidate->y == y) {
|
||||||
|
candidate->allocated = true;
|
||||||
|
x = candidate->x;
|
||||||
|
y = candidate->y;
|
||||||
|
line.push_back(*candidate);
|
||||||
|
points_allocated++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (candidate->x == x -1 && candidate->y == y) {
|
||||||
|
x = candidate->x;
|
||||||
|
y = candidate->y;
|
||||||
|
candidate->allocated = true;
|
||||||
|
line.push_back(*candidate);
|
||||||
|
points_allocated++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (candidate->x == x && candidate->y == y + 1) {
|
||||||
|
x = candidate->x;
|
||||||
|
y = candidate->y;
|
||||||
|
candidate->allocated = true;
|
||||||
|
line.push_back(*candidate);
|
||||||
|
points_allocated++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (candidate->x == x && candidate->y == y - 1) {
|
||||||
|
x = candidate->x;
|
||||||
|
y = candidate->y;
|
||||||
|
candidate->allocated = true;
|
||||||
|
line.push_back(*candidate);
|
||||||
|
points_allocated++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (j > points_allocated)
|
||||||
|
{
|
||||||
|
vec_private.push_back(line);
|
||||||
|
line.clear();
|
||||||
|
//std::cout << points.size() << " ";
|
||||||
|
for (int k = 0; k < points.size(); k++){
|
||||||
|
Point* candidate = &points[k];
|
||||||
|
if (!candidate->allocated)
|
||||||
|
{
|
||||||
|
line.push_back(*candidate);
|
||||||
|
x = candidate->x;
|
||||||
|
y = candidate->y;
|
||||||
|
points_allocated++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#pragma omp critical
|
#pragma omp critical
|
||||||
vector_contours.insert(vector_contours.end(), vec_private.begin(), vec_private.end());
|
|
||||||
|
|
||||||
|
vector_contours.insert(vector_contours.end(), vec_private.begin(), vec_private.end());
|
||||||
}
|
}
|
||||||
return vector_contours;
|
return vector_contours;
|
||||||
}
|
}
|
||||||
@@ -72,7 +133,7 @@ constexpr std::tuple<double, double, double, double> marching_squares_lookup(int
|
|||||||
switch (mcase) {
|
switch (mcase) {
|
||||||
case 1: return {0, 0.5, 0.5, 0};
|
case 1: return {0, 0.5, 0.5, 0};
|
||||||
case 2: return {1, 0.5, 0.5, 0};
|
case 2: return {1, 0.5, 0.5, 0};
|
||||||
case 3: return {0, 0.5, 1, 0};
|
case 3: return {0, 0.5, 1, 0.5};
|
||||||
case 4: return {0.5, 1, 1, 0.5};
|
case 4: return {0.5, 1, 1, 0.5};
|
||||||
case 5: return {0, 0, 0, 0}; //FIXME
|
case 5: return {0, 0, 0, 0}; //FIXME
|
||||||
case 6: return {0.5, 1, 0.5, 0};
|
case 6: return {0.5, 1, 0.5, 0};
|
||||||
@@ -86,7 +147,7 @@ constexpr std::tuple<double, double, double, double> marching_squares_lookup(int
|
|||||||
case 14: return {0, 0.5, 0.5, 0};
|
case 14: return {0, 0.5, 0.5, 0};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
void write_output_file(std::vector<CellMap> cellmaps, const char *filepath)
|
void write_output_file(std::vector<std::vector<Point>> all_points, const char *filepath, HeightMap* heightmap)
|
||||||
{
|
{
|
||||||
|
|
||||||
const char *pszDriverName = "GeoJSON";
|
const char *pszDriverName = "GeoJSON";
|
||||||
@@ -112,7 +173,7 @@ void write_output_file(std::vector<CellMap> cellmaps, const char *filepath)
|
|||||||
|
|
||||||
OGRLayer *poLayer;
|
OGRLayer *poLayer;
|
||||||
|
|
||||||
poLayer = poDS->CreateLayer( "contours", &(cellmaps[0]).reference_system, wkbLineString, NULL );
|
poLayer = poDS->CreateLayer( "contours", &heightmap->reference_system, wkbLineString, NULL );
|
||||||
if( poLayer == NULL )
|
if( poLayer == NULL )
|
||||||
{
|
{
|
||||||
printf( "Layer creation failed.\n" );
|
printf( "Layer creation failed.\n" );
|
||||||
@@ -128,26 +189,27 @@ void write_output_file(std::vector<CellMap> cellmaps, const char *filepath)
|
|||||||
printf( "Creating Name field failed.\n" );
|
printf( "Creating Name field failed.\n" );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
}
|
}
|
||||||
for (int j = 0; j < cellmaps.size(); j++)
|
int width = heightmap->width -1;
|
||||||
{
|
int height = heightmap->height -1;
|
||||||
CellMap* cellmap = &cellmaps[j];
|
int size = width * height;
|
||||||
|
|
||||||
for (int i = 0; i < cellmap->height*cellmap->width; i++)
|
for (int j = 0; j < all_points.size(); j++)
|
||||||
{
|
|
||||||
if (*(cellmap->cells + i) != 0 && *(cellmap->cells + i) != 15)
|
|
||||||
{
|
{
|
||||||
OGRFeature *feature;
|
OGRFeature *feature;
|
||||||
OGRLineString *geometry = new OGRLineString();
|
OGRLineString *geometry = new OGRLineString();
|
||||||
feature = OGRFeature::CreateFeature( poLayer->GetLayerDefn() );
|
feature = OGRFeature::CreateFeature( poLayer->GetLayerDefn() );
|
||||||
feature->SetField( "Name", j );
|
feature->SetField( "Name", j );
|
||||||
int x_raw = i%cellmap->width;
|
|
||||||
int y_raw = i/cellmap->width;
|
|
||||||
auto [x, y] = local_to_projected(cellmap->geotransform, x_raw, y_raw);
|
|
||||||
auto [x_bl, y_bl, x_tr, y_tr] = marching_squares_lookup(*(cellmap->cells + i) );
|
|
||||||
//std::cout << x << ", " << y << " ";
|
|
||||||
geometry->setPoint( geometry->getNumPoints(), x+x_tr*0.25, y+y_tr*0.25 );
|
|
||||||
geometry->setPoint( geometry->getNumPoints(), x+x_bl*0.25, y+y_bl*0.25 );
|
|
||||||
|
|
||||||
|
std::vector<Point> points = all_points[j];
|
||||||
|
|
||||||
|
for (int k = 0; k < points.size(); k++)
|
||||||
|
{
|
||||||
|
int x_raw = points[k].x;
|
||||||
|
int y_raw = points[k].y;
|
||||||
|
auto [x, y] = local_to_projected(heightmap->geotransform, x_raw, y_raw);
|
||||||
|
//auto [x_bl, y_bl, x_tr, y_tr] = marching_squares_lookup(*(cellmap->cells + i) );
|
||||||
|
geometry->setPoint(geometry->getNumPoints(),x ,y );
|
||||||
|
}
|
||||||
|
|
||||||
if ( feature->SetGeometry(geometry) != OGRERR_NONE)
|
if ( feature->SetGeometry(geometry) != OGRERR_NONE)
|
||||||
{
|
{
|
||||||
@@ -162,12 +224,6 @@ void write_output_file(std::vector<CellMap> cellmaps, const char *filepath)
|
|||||||
}
|
}
|
||||||
OGRFeature::DestroyFeature( feature );
|
OGRFeature::DestroyFeature( feature );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
GDALClose( poDS );
|
GDALClose( poDS );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,8 +237,17 @@ int main(int argc, const char* argv[])
|
|||||||
|
|
||||||
map.blur(0.8);
|
map.blur(0.8);
|
||||||
|
|
||||||
auto cellmap = produce_cellmap(&map, 40);
|
map.statistics();
|
||||||
|
|
||||||
auto cellmaps = vector_cellmap(&map, 5);
|
map.calculate_steepness();
|
||||||
//write_output_file(cellmaps, "out.geojson");
|
|
||||||
|
auto lines = create_lines(&map, 5);
|
||||||
|
write_output_file(lines, "out.geojson", &map);
|
||||||
|
|
||||||
|
|
||||||
|
std::vector<int> y = {1, 2, 3};
|
||||||
|
//plt::plot(y, "bo-");
|
||||||
|
//plt::show();
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user