Dockerfile for Geodjango and mysql-client

Dockerfile

Dockerfile based on Ubuntu image:


FROM ubuntu:bionic MAINTAINER xxx "[email protected]" ENV PYTHONUNBUFFERED 1 ENV DEBIAN_FRONTEND noninteractive ENV LANG C.UTF-8 RUN apt-get update -qq \ && apt-get install -y -qq unzip \ wget \ sudo \ less \ nano \ curl \ gcc \ libssl-dev \ git \ gosu \ build-essential \ software-properties-common \ python3.6 \ python3.6-dev \ python3.6-venv \ gettext \ gdal-bin \ binutils \ libproj-dev \ libgdal-dev \ libpq-dev \ postgresql-client \ && wget https://bootstrap.pypa.io/get-pip.py \ && python3.6 get-pip.py \ && rm get-pip.py \ && pip3 install --no-cache-dir setuptools wheel -U \ && pip install gunicorn mysqlclient \ && apt-get clean all \ && rm -rf /var/apt/lists/* \ && rm -rf /var/cache/apt/* ENV CPLUS_INCLUDE_PATH=/usr/include/gdal ENV C_INCLUDE_PATH=/usr/include/gdal

Build

docker bulid -t wktadmin/django_geo:latest .

Or download it directly in dockerhub

dockerhub site: pull docker pull wktadmin/django_geo:python3.6

Add idea to gnome shell favorites

// create file:

sudo vim /usr/share/applications/intellij.desktop  
# or ~/.local/share/applications/intellij.desktop is ok.

// add the following

[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png
Name[en_US]=IntelliJ
Exec=/home/rob/.intellij-13/bin/idea.sh
Name=IntelliJ
Icon=/home/rob/.intellij-13/bin/idea.png

// chmod permissions

sudo chmod 644 /usr/share/applications/intellij.desktop
sudo chown root:root /usr/share/applications/intellij.desktop

Reducing the filesize of complex 3D .OBJ models

create a filter script:

create a filter script for example to reduce any model to 32,000 faces script:

<!DOCTYPE FilterScript>
<FilterScript>
 <filter name="Quadric Edge Collapse Decimation">
  <Param type="RichInt" value="32000" name="TargetFaceNum"/>
  <Param type="RichFloat" value="0" name="TargetPerc"/>
  <Param type="RichFloat" value="1" name="QualityThr"/>
  <Param type="RichBool" value="true" name="PreserveBoundary"/>
  <Param type="RichFloat" value="1" name="BoundaryWeight"/>
  <Param type="RichBool" value="true" name="PreserveNormal"/>
  <Param type="RichBool" value="false" name="PreserveTopology"/>
  <Param type="RichBool" value="true" name="OptimalPlacement"/>
  <Param type="RichBool" value="true" name="PlanarQuadric"/>
  <Param type="RichBool" value="false" name="QualityWeight"/>
  <Param type="RichBool" value="true" name="AutoClean"/>
  <Param type="RichBool" value="false" name="Selected"/>
 </filter>
</FilterScript>

save it as 32k.mlx.

run meshlabserver with headless

meshlabserver -i original.obj -o new_small.obj -s 32k.mlx